Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 pmap_enter() must upda...



details:   https://anonhg.NetBSD.org/src/rev/1e5ca708b4a4
branches:  trunk
changeset: 319197:1e5ca708b4a4
user:      ryo <ryo%NetBSD.org@localhost>
date:      Sun May 20 06:45:00 2018 +0000

description:
pmap_enter() must update modified/referenced flags by 'flags' not 'prot'.

diffstat:

 sys/arch/aarch64/aarch64/pmap.c |  19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diffs (40 lines):

diff -r 391591123f42 -r 1e5ca708b4a4 sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Sun May 20 06:29:43 2018 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Sun May 20 06:45:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.6 2018/05/16 08:32:07 ryo Exp $     */
+/*     $NetBSD: pmap.c,v 1.7 2018/05/20 06:45:00 ryo Exp $     */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.6 2018/05/16 08:32:07 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.7 2018/05/20 06:45:00 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1436,17 +1436,10 @@
                            "pmap_enter: failed to allocate pv_entry");
                }
 
-               if (flags & PMAP_WIRED) {
-                       /*
-                        * initial value of ref/mod are equal to prot,
-                        * and pte RW are same as prot.
-                        */
-                       VM_PAGE_TO_MD(pg)->mdpg_flags |=
-                           (prot & mdattr);
-               } else {
-                       /* pte RW will be masked by ref/mod for ref/mod emul */
-                       mdattr &= VM_PAGE_TO_MD(pg)->mdpg_flags;
-               }
+               /* update referenced/modified flags */
+               VM_PAGE_TO_MD(pg)->mdpg_flags |=
+                   (flags & (VM_PROT_READ | VM_PROT_WRITE));
+               mdattr &= VM_PAGE_TO_MD(pg)->mdpg_flags;
        }
 
 #ifdef PMAPCOUNTERS



Home | Main Index | Thread Index | Old Index