OvmfPkg/ResetVector: Fix assembler bit test flag check

Commit 63c50d3ff2 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: 63c50d3ff2 ("OvmfPkg/ResetVector: cache the SEV status MSR...")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
This commit is contained in:
Tom Lendacky 2023-07-14 15:28:26 -05:00 committed by mergify[bot]
parent ff3382a51c
commit e674096acc
1 changed files with 1 additions and 1 deletions

View File

@ -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