Author: raj
Date: Mon Aug 19 15:12:36 2013
New Revision: 254532
URL: http://svnweb.freebsd.org/changeset/base/254532

Log:
  Clear all L2 PTE protection bits before their configuration.
  
  Revise L2_S_PROT_MASK to include all of the protection bits.  Notice that
  clearing these bits does not always take away the corresponding permissions
  (for example, permission is granted when the bit is cleared). The bits are
  cleared but are to be set or left cleared accordingly in pmap_set_prot(),
  pmap_enter_locked(), etc.
  
  Clear L2_XN along with L2_S_PROT_MASK in pmap_set_prot() so that all
  permissions related bits are cleared before actual configuration.
  
  Submitted by: Zbigniew Bodek <z...@semihalf.com>
  Reviewed by:  gber
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/include/pmap.h

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 19 14:56:17 2013        (r254531)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:12:36 2013        (r254532)
@@ -1046,7 +1046,7 @@ static void
 pmap_set_prot(pt_entry_t *ptep, vm_prot_t prot, uint8_t user)
 {
 
-       *ptep &= ~L2_S_PROT_MASK;
+       *ptep &= ~(L2_S_PROT_MASK | L2_XN);
 
        if (!(prot & VM_PROT_EXECUTE))
                *ptep |= L2_XN;

Modified: head/sys/arm/include/pmap.h
==============================================================================
--- head/sys/arm/include/pmap.h Mon Aug 19 14:56:17 2013        (r254531)
+++ head/sys/arm/include/pmap.h Mon Aug 19 15:12:36 2013        (r254532)
@@ -390,7 +390,7 @@ extern int pmap_needs_pte_sync;
 #define        L2_S_PROT_U             (L2_AP0(2))     /* user read */
 #define L2_S_REF               (L2_AP0(1))     /* reference flag */
 
-#define        L2_S_PROT_MASK          (L2_S_PROT_U|L2_S_PROT_R)
+#define        L2_S_PROT_MASK          (L2_S_PROT_U|L2_S_PROT_R|L2_APX)
 #define        L2_S_EXECUTABLE(pte)    (!(pte & L2_XN))
 #define        L2_S_WRITABLE(pte)      (!(pte & L2_APX))
 #define        L2_S_REFERENCED(pte)    (!!(pte & L2_S_REF))
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to