Module Name:    src
Committed By:   thorpej
Date:           Mon Jul  5 10:00:22 UTC 2021

Modified Files:
        src/sys/arch/alpha/alpha: pmap.c

Log Message:
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@.


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/arch/alpha/alpha/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.294 src/sys/arch/alpha/alpha/pmap.c:1.295
--- src/sys/arch/alpha/alpha/pmap.c:1.294	Sun Jul  4 22:42:35 2021
+++ src/sys/arch/alpha/alpha/pmap.c	Mon Jul  5 10:00:22 2021
@@ -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 @@ pmap_enter(pmap_t pmap, vaddr_t va, padd
 
 		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. */

Reply via email to