Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 2016 12:30:59 +0000 (UTC)
From:      Svatopluk Kraus <skra@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295693 - head/sys/arm/arm
Message-ID:  <201602171230.u1HCUxtt015970@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: skra
Date: Wed Feb 17 12:30:59 2016
New Revision: 295693
URL: https://svnweb.freebsd.org/changeset/base/295693

Log:
  Evaluate also VM_PROT_EXECUTE protection in pmap_preboot_map_attr().
  Before this change all mappings done by this function were executable
  as pte entries have NOT EXECUTABLE bit.
  
  The function is used only for static device mappings at present. Thus
  this is also a fix as DEVICE memory should not be mapped as executable.

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

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Wed Feb 17 11:40:03 2016	(r295692)
+++ head/sys/arm/arm/pmap-v6.c	Wed Feb 17 12:30:59 2016	(r295693)
@@ -1022,6 +1022,7 @@ pmap_preboot_map_attr(vm_paddr_t pa, vm_
 	pt2_entry_t *pte2p;
 
 	l2_prot = prot & VM_PROT_WRITE ? PTE2_AP_KRW : PTE2_AP_KR;
+	l2_prot |= (prot & VM_PROT_EXECUTE) ? PTE2_X : PTE2_NX;
 	l2_attr = vm_memattr_to_pte2(attr);
 	l1_prot = ATTR_TO_L1(l2_prot);
 	l1_attr = ATTR_TO_L1(l2_attr);



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