summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorHeyi Guo <heyi.guo@linaro.org>2016-04-14 17:24:47 +0800
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-04-14 11:38:36 +0200
commit40e06cad13787d8397949a9c5dd3e41f2cf3caed (patch)
tree72d77852d2c0c44714b1f16e296d0dcd9734cda6 /ArmPkg
parent7959b06748495da65d268de2c6643001e069ff80 (diff)
downloadedk2-40e06cad13787d8397949a9c5dd3e41f2cf3caed.tar.gz
edk2-40e06cad13787d8397949a9c5dd3e41f2cf3caed.tar.bz2
edk2-40e06cad13787d8397949a9c5dd3e41f2cf3caed.zip
ArmPkg/AArch64Mmu: Fix XN attribute for device memory
Now XN attribute will be set automatically if the region is declared as device memory. However, the function ArmMemoryAttributeToPageAttribute is to get attribute for block and page descriptors, not for table descriptors, so attribute TT_TABLE_*XN does not really take effect. Need to use TT_*XN_MASK instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c b/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c
index b7d23c6f32..918957d4ff 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c
@@ -51,9 +51,9 @@ ArmMemoryAttributeToPageAttribute (
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE:
if (ArmReadCurrentEL () == AARCH64_EL2)
- return TT_ATTR_INDX_DEVICE_MEMORY | TT_TABLE_XN;
+ return TT_ATTR_INDX_DEVICE_MEMORY | TT_XN_MASK;
else
- return TT_ATTR_INDX_DEVICE_MEMORY | TT_TABLE_UXN | TT_TABLE_PXN;
+ return TT_ATTR_INDX_DEVICE_MEMORY | TT_UXN_MASK | TT_PXN_MASK;
}
}