diff options
author | skra <skra@FreeBSD.org> | 2016-02-17 12:30:59 +0000 |
---|---|---|
committer | skra <skra@FreeBSD.org> | 2016-02-17 12:30:59 +0000 |
commit | 2ae033135f01061978704eff3d7292153170186b (patch) | |
tree | 03813e643fe0c1d2e70a301a893ce15749d32c03 /sys/arm | |
parent | 2b856586f6695b4170b30adfd863ba7e185ef015 (diff) | |
download | FreeBSD-src-2ae033135f01061978704eff3d7292153170186b.zip FreeBSD-src-2ae033135f01061978704eff3d7292153170186b.tar.gz |
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.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/pmap-v6.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 525280c..c41bd41 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -1022,6 +1022,7 @@ pmap_preboot_map_attr(vm_paddr_t pa, vm_offset_t va, vm_size_t size, 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); |