summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2023-07-14 15:28:26 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-07-14 22:52:58 +0000
commite674096accc8e57cd0dd84679905e1222423251e (patch)
treed80b2c4dd81054c5eba0fc6ee64b06736f85039b
parentff3382a51ca726a90f49623a2b2d2e8ad8459ce2 (diff)
downloadedk2-e674096accc8e57cd0dd84679905e1222423251e.zip
edk2-e674096accc8e57cd0dd84679905e1222423251e.tar.gz
edk2-e674096accc8e57cd0dd84679905e1222423251e.tar.bz2
OvmfPkg/ResetVector: Fix assembler bit test flag check
Commit 63c50d3ff2854a76432b752af4f2a76f33ff1974 changed the check that is used to determine if SEV-ES is active. Originally, a CMP instruction with a supporting JZ instruction was used for the check. It was changed to use the BT instruction but not JZ instruction. The result of a BT instruction changes the the carry flag (CF) and not the zero flag (ZF). As a result, the wrong condition is being checked. Update the JZ to a JNC to properly detect if SEV-ES is active. Fixes: 63c50d3ff285 ("OvmfPkg/ResetVector: cache the SEV status MSR...") Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
-rw-r--r--OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm2
1 files changed, 1 insertions, 1 deletions
diff --git a/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm b/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
index c5c683e..429a58c 100644
--- a/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
+++ b/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
@@ -44,7 +44,7 @@ Transition32FlatTo64Flat:
mov ecx, 1
bt [SEV_ES_WORK_AREA_STATUS_MSR], ecx
- jz EnablePaging
+ jnc EnablePaging
;
; SEV-ES is active, perform a quick sanity check against the reported