Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 2013 15:12:37 +0000 (UTC)
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254532 - in head/sys/arm: arm include
Message-ID:  <201308191512.r7JFCb32005933@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <zbb@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))



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