On Fri, 14 Jul 2023 at 22:28, Tom Lendacky <thomas.lenda...@amd.com> wrote:
>
> 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.lenda...@amd.com>
> ---
>  OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm 
> b/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
> index c5c683ebed3e..429a58c5efd3 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

Merged as #4646

Thanks,


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106947): https://edk2.groups.io/g/devel/message/106947
Mute This Topic: https://groups.io/mt/100149226/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to