summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-11-15 12:12:32 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-11-26 23:53:16 +0000
commit91171b6b945bf5f6eb03d99056917017ce9451e1 (patch)
tree9f47d731614d460aef6f1cb80c9ed3110c07c252
parentf60a839480aae4fbea5165e81f074f9562448f78 (diff)
downloadedk2-91171b6b945bf5f6eb03d99056917017ce9451e1.tar.gz
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 <ardb@kernel.org>
-rw-r--r--ArmVirtPkg/PrePi/AArch64/ArchPrePi.c2
1 files changed, 1 insertions, 1 deletions
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);
}
}