summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-11-12 16:16:37 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-11-26 23:53:16 +0000
commite80b17d21aaefcebf21fb8414ba98327b5e03701 (patch)
tree027d0069b104469ca19d3bbeb0287f31e7eb2feb
parent31ff3252284b62f0fb919f92607ea75e882c451b (diff)
downloadedk2-e80b17d21aaefcebf21fb8414ba98327b5e03701.tar.gz
ArmPkg/ArmMmuLib: Ignore EL3 in RELEASE code
Remove the code path for execution at EL3, which just dumps an error. None of the other code is remotely suitable for execution at EL3, and so just ASSERT()'ing here is sufficient, and simplifies future changes related to VHE. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
index b83373d4b5..64386aac1e 100644
--- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
+++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
@@ -568,6 +568,11 @@ ArmConfigureMmu (
UINT64 TCR;
EFI_STATUS Status;
+ ASSERT (ArmReadCurrentEL () < AARCH64_EL3);
+ if (ArmReadCurrentEL () == AARCH64_EL3) {
+ return EFI_UNSUPPORTED;
+ }
+
if (MemoryTable == NULL) {
ASSERT (MemoryTable != NULL);
return EFI_INVALID_PARAMETER;
@@ -617,7 +622,7 @@ ArmConfigureMmu (
ASSERT (0); // Bigger than 48-bit memory space are not supported
return EFI_UNSUPPORTED;
}
- } else if (ArmReadCurrentEL () == AARCH64_EL1) {
+ } else {
// Due to Cortex-A57 erratum #822227 we must set TG1[1] == 1, regardless of EPD1.
TCR = T0SZ | TCR_TG0_4KB | TCR_TG1_4KB | TCR_EPD1;
@@ -643,9 +648,6 @@ ArmConfigureMmu (
ASSERT (0); // Bigger than 48-bit memory space are not supported
return EFI_UNSUPPORTED;
}
- } else {
- ASSERT (0); // UEFI is only expected to run at EL2 and EL1, not EL3.
- return EFI_UNSUPPORTED;
}
//