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>
This commit is contained in:
Ard Biesheuvel 2024-11-12 16:16:37 +01:00 committed by mergify[bot]
parent 31ff325228
commit e80b17d21a
1 changed files with 6 additions and 4 deletions

View File

@ -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;
}
//