Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Jun 2010 11:21:29 -0500
From:      Alan Cox <alc@cs.rice.edu>
To:        ppc@freebsd.org
Cc:        Marcel Moolenaar <marcel@freebsd.org>, Alan Cox <alc@cs.rice.edu>
Subject:   BookE pmap_enter() bug?
Message-ID:  <4C053389.1040204@cs.rice.edu>

index | next in thread | raw e-mail

[-- Attachment #1 --]
I've been reviewing the various pmap_enter() implementations and came 
across the following bit of code in the BookE pmap_enter():

        if (prot & VM_PROT_EXECUTE) {
            flags |= PTE_SX;
            if (!su)
                flags |= PTE_UX;

            /*
             * Check existing flags for execute permissions: if we
             * are turning execute permissions on, icache should
             * be flushed.
             */
            if ((flags & (PTE_UX | PTE_SX)) == 0)
                sync++;
        }


This will never flush the instruction cache because the new flags, not 
the old flags, are being used.  I suspect that the attached change 
should be made.

Alan


[-- Attachment #2 --]
Index: powerpc/booke/pmap.c
===================================================================
--- powerpc/booke/pmap.c	(revision 208657)
+++ powerpc/booke/pmap.c	(working copy)
@@ -1621,7 +1621,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_
 			 * are turning execute permissions on, icache should
 			 * be flushed.
 			 */
-			if ((flags & (PTE_UX | PTE_SX)) == 0)
+			if ((pte->flags & (PTE_UX | PTE_SX)) == 0)
 				sync++;
 		}
 
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C053389.1040204>