mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
7959b06748
commit
40e06cad13
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue