diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c index f3507b2f27..6a2970f8cf 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c @@ -464,7 +464,12 @@ GcdAttributeToPageAttribute ( PageAttributes |= TT_AP_RW_RW; } } else { - PageAttributes |= TT_UXN_MASK; + if (ArmReadCurrentEL () == AARCH64_EL1) { + // + // TODO: Add EL2&0 support. + // + PageAttributes |= TT_UXN_MASK; + } if ((GcdAttributes & EFI_MEMORY_RO) != 0) { PageAttributes |= TT_AP_NO_RO;