Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha/alpha Fix a bug introduced in pmap.c,v 1.287 ...



details:   https://anonhg.NetBSD.org/src/rev/ebe4d2c2987a
branches:  trunk
changeset: 1022117:ebe4d2c2987a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jul 05 10:00:22 2021 +0000

description:
Fix a bug introduced in pmap.c,v 1.287 where, when creating the PTE
in pmap_enter(), we would erroneously disregard MOD/REF attributes
already present on the page, thus causing FOW/FOR to be set incorrectly.
Normally this is not a big problem (an extra page fault will be taken
to resolve it), but if you access the mapping in interrupt context
(such as during IDE PIO, for example), a KASSERT can fire due to
acquiring an rwlock in interrupt context while servicing that fault.

Reported and bisected-to-commit by rin@.

diffstat:

 sys/arch/alpha/alpha/pmap.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 9fc5d4c41d01 -r ebe4d2c2987a sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Mon Jul 05 08:50:31 2021 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Mon Jul 05 10:00:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.294 2021/07/04 22:42:35 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.295 2021/07/05 10:00:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.294 2021/07/04 22:42:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.295 2021/07/05 10:00:22 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2344,7 +2344,7 @@
 
                lock = pmap_pvh_lock(pg);
                mutex_enter(lock);
-               md->pvh_listx |= attrs;
+               attrs = (md->pvh_listx |= attrs);
                mutex_exit(lock);
 
                /* Set up referenced/modified emulation for new mapping. */



Home | Main Index | Thread Index | Old Index