Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/aarch64/aarch64 Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/711c5d5aced9
branches:  netbsd-9
changeset: 962990:711c5d5aced9
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 22 10:32:38 2019 +0000

description:
Pull up following revision(s) (requested by ryo in ticket #214):

        sys/arch/aarch64/aarch64/pmap.c: revision 1.44
        sys/arch/aarch64/aarch64/pmap.c: revision 1.46

- remove incorrect KASSERT. mmap(2) with prot=PROT_WRITE calls pmap_enter(..., PROT_WRITE) internally.
- fix to update page reference flags when only PROT_WRITE or PROT_EXECUTE specified
ref/mod bit should be set according to 'flags' argument, not 'prot'.  r1.44 was incomplete.

diffstat:

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

diffs (41 lines):

diff -r 532dce6ed791 -r 711c5d5aced9 sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Sun Sep 22 10:29:44 2019 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Sun Sep 22 10:32:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.41 2019/05/17 06:05:07 mrg Exp $    */
+/*     $NetBSD: pmap.c,v 1.41.2.1 2019/09/22 10:32:38 martin 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.41 2019/05/17 06:05:07 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41.2.1 2019/09/22 10:32:38 martin Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1718,10 +1718,11 @@
        /*
         * read permission is treated as an access permission internally.
         * require to add PROT_READ even if only PROT_WRITE or PROT_EXEC
-        * for wired mapping.
         */
-       if ((flags & PMAP_WIRED) && (prot & (VM_PROT_WRITE|VM_PROT_EXECUTE)))
+       if (prot & (VM_PROT_WRITE|VM_PROT_EXECUTE))
                prot |= VM_PROT_READ;
+       if (flags & (VM_PROT_WRITE|VM_PROT_EXECUTE))
+               flags |= VM_PROT_READ;
 
        mdattr = VM_PROT_READ | VM_PROT_WRITE;
        if (need_update_pv) {
@@ -1818,8 +1819,6 @@
 int
 pmap_enter(struct pmap *pm, vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags)
 {
-       KASSERT((prot & VM_PROT_READ) || !(prot & VM_PROT_WRITE));
-
        return _pmap_enter(pm, va, pa, prot, flags, false);
 }
 



Home | Main Index | Thread Index | Old Index