From 6f07aeb49c2d94e460cbd3f36b8cfa81355c825f Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Wed, 6 Nov 2024 21:01:07 +0000 Subject: ArmPlatformPkg: Document that we don't support HCR_EL2.E2H being set The existing code here predates its existence as it's assuming that CPTR_EL2 has the traditional layout rather than being like CPACR_EL1 (likely also true elsewhere for other registers), and the UEFI spec has nothing to say on the matter. One assumes the intent is that if you're in EL2 you're in EL2 proper, and it would be very strange to enter EDK2 with E2H set. Document this existing assumption. Signed-off-by: Jessica Clarke --- ArmPlatformPkg/Sec/AArch64/Helper.S | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/Sec/AArch64/Helper.S b/ArmPlatformPkg/Sec/AArch64/Helper.S index c784c4a1cd..121f99838c 100644 --- a/ArmPlatformPkg/Sec/AArch64/Helper.S +++ b/ArmPlatformPkg/Sec/AArch64/Helper.S @@ -28,6 +28,8 @@ ASM_FUNC(SetupExceptionLevel2) orr x0, x0, #(1 << 5) // Enable EL2 SError and Abort msr hcr_el2, x0 // Write back our settings + // NB: We assume that we have not been entered on VHE systems with + // HCR_EL2.E2H set. msr cptr_el2, xzr // Disable copro traps to EL2 // Enable Timer access for non-secure EL1 and EL0 -- cgit v1.2.3