From 91171b6b945bf5f6eb03d99056917017ce9451e1 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 15 Nov 2024 12:12:32 +0100 Subject: ArmVirtPkg/PrePi: Don't clear HCR_EL2 fields when setting TGE HCR_EL2 may contain fields that should be preserved (such as E2H, which may be RES1 for all intents and purposes other than reading back the register). So preserve the existing value when setting the TGE bit. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/PrePi/AArch64/ArchPrePi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmVirtPkg/PrePi/AArch64/ArchPrePi.c b/ArmVirtPkg/PrePi/AArch64/ArchPrePi.c index a7f53132c7..592f5b7d40 100644 --- a/ArmVirtPkg/PrePi/AArch64/ArchPrePi.c +++ b/ArmVirtPkg/PrePi/AArch64/ArchPrePi.c @@ -17,6 +17,6 @@ ArchInitialize ( { if (ArmReadCurrentEL () == AARCH64_EL2) { // Trap General Exceptions. All exceptions that would be routed to EL1 are routed to EL2 - ArmWriteHcr (ARM_HCR_TGE); + ArmWriteHcr (ArmReadHcr () | ARM_HCR_TGE); } } -- cgit