Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 Don't do ref/mod emulation for KENTRY pages.



details:   https://anonhg.NetBSD.org/src/rev/894a093f2ad2
branches:  trunk
changeset: 327069:894a093f2ad2
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Feb 26 17:35:21 2014 +0000

description:
Don't do ref/mod emulation for KENTRY pages.
l2pte_minidata -> l2pte_minidata_p

diffstat:

 sys/arch/arm/arm32/pmap.c |  31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diffs (109 lines):

diff -r eac77c573af6 -r 894a093f2ad2 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Wed Feb 26 16:16:18 2014 +0000
+++ b/sys/arch/arm/arm32/pmap.c Wed Feb 26 17:35:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.267 2014/02/26 02:07:58 matt Exp $  */
+/*     $NetBSD: pmap.c,v 1.268 2014/02/26 17:35:21 matt Exp $  */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -209,7 +209,7 @@
 #include <arm/locore.h>
 #include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.267 2014/02/26 02:07:58 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.268 2014/02/26 17:35:21 matt Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -601,6 +601,8 @@
 #define        PV_BEEN_EXECD(f)  (((f) & (PVF_REF | PVF_EXEC)) == (PVF_REF | PVF_EXEC))
 #endif
 #define        PV_IS_EXEC_P(f)   (((f) & PVF_EXEC) != 0)
+#define        PV_IS_KENTRY_P(f) (((f) & PVF_KENTRY) != 0)
+#define        PV_IS_WRITE_P(f)  (((f) & PVF_WRITE) != 0)
 
 /*
  * Macro to determine if a mapping might be resident in the
@@ -879,11 +881,12 @@
         * Insert unmanaged entries, writeable first, at the head of
         * the pv list.
         */
-       if (__predict_true((flags & PVF_KENTRY) == 0)) {
-               while (*pvp != NULL && (*pvp)->pv_flags & PVF_KENTRY)
+       if (__predict_true(!PV_IS_KENTRY_P(flags))) {
+               while (*pvp != NULL && PV_IS_KENTRY_P((*pvp)->pv_flags))
                        pvp = &SLIST_NEXT(*pvp, pv_link);
-       } else if ((flags & PVF_WRITE) == 0) {
-               while (*pvp != NULL && (*pvp)->pv_flags & PVF_WRITE)
+       }
+       if (!PV_IS_WRITE_P(flags)) {
+               while (*pvp != NULL && PV_IS_WRITE_P((*pvp)->pv_flags))
                        pvp = &SLIST_NEXT(*pvp, pv_link);
        }
 #endif
@@ -1067,8 +1070,8 @@
        struct pv_entry *npv;
        u_int flags, oflags;
 
-       KASSERT((clr_mask & PVF_KENTRY) == 0);
-       KASSERT((set_mask & PVF_KENTRY) == 0);
+       KASSERT(!PV_IS_KENTRY_P(clr_mask));
+       KASSERT(!PV_IS_KENTRY_P(set_mask));
 
        if ((npv = pmap_find_pv(md, pm, va)) == NULL)
                return (0);
@@ -2175,7 +2178,7 @@
                /*
                 * Kernel entries are unmanaged and as such not to be changed.
                 */
-               if (oflags & PVF_KENTRY)
+               if (PV_IS_KENTRY_P(oflags))
                        continue;
                pv->pv_flags &= ~maskbits;
 
@@ -2623,7 +2626,7 @@
                         * Move it back on the list and advance the end-of-list
                         * pointer.
                         */
-                       if (pv->pv_flags & PVF_KENTRY) {
+                       if (PV_IS_KENTRY_P(pv->pv_flags)) {
                                *pvp = pv;
                                pvp = &SLIST_NEXT(pv, pv_link);
                                pv = npv;
@@ -3280,7 +3283,7 @@
 
        pv = pmap_remove_pv(md, pa, pmap_kernel(), va);
        KASSERT(pv);
-       KASSERT(pv->pv_flags & PVF_KENTRY);
+       KASSERT(PV_IS_KENTRY_P(pv->pv_flags));
 
        /*
         * If we are removing a writeable mapping to a cached exec page,
@@ -3880,7 +3883,7 @@
 #endif
 
                pv = pmap_find_pv(md, pm, va);
-               if (pv == NULL) {
+               if (pv == NULL || PV_IS_KENTRY_P(pv->pv_flags)) {
                        goto out;
                }
 
@@ -3940,7 +3943,7 @@
 #endif
 
                pv = pmap_find_pv(md, pm, va);
-               if (pv == NULL) {
+               if (pv == NULL || PV_IS_KENTRY_P(pv->pv_flags)) {
                        goto out;
                }
 
@@ -6436,7 +6439,7 @@
 
                while (va < next_bucket) {
                        const pt_entry_t opte = *ptep;
-                       if (!l2pte_minidata(opte)) {
+                       if (!l2pte_minidata_p(opte)) {
                                cpu_dcache_wbinv_range(va, PAGE_SIZE);
                                cpu_tlb_flushD_SE(va);
                                l2pte_set(ptep, opte & ~L2_B, opte);



Home | Main Index | Thread Index | Old Index