public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: devel@edk2.groups.io, Ard Biesheuvel <ardb+tianocore@kernel.org>,
	 Jiewen Yao <jiewen.yao@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	 Gerd Hoffmann <kraxel@redhat.com>,
	Erdem Aktas <erdemaktas@google.com>,
	 James Bottomley <jejb@linux.ibm.com>,
	Min Xu <min.m.xu@intel.com>,  Michael Roth <michael.roth@amd.com>
Subject: Re: [PATCH] OvmfPkg/ResetVector: Fix assembler bit test flag check
Date: Sat, 15 Jul 2023 02:26:59 +0200	[thread overview]
Message-ID: <CAMj1kXHKu1OUK+kxjA3B6S=YWR84f2To6rvankWw_b8NZhaGgA@mail.gmail.com> (raw)
In-Reply-To: <f1e2264e03edf91c1020b989e123c332d3754376.1689366506.git.thomas.lendacky@amd.com>

On Fri, 14 Jul 2023 at 22:28, Tom Lendacky <thomas.lendacky@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.lendacky@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,

  reply	other threads:[~2023-07-15  0:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14 20:28 [PATCH] OvmfPkg/ResetVector: Fix assembler bit test flag check Lendacky, Thomas
2023-07-15  0:26 ` Ard Biesheuvel [this message]
2023-09-19  7:59 ` [edk2-devel] " Gerd Hoffmann
2023-09-19 13:19   ` Lendacky, Thomas via groups.io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMj1kXHKu1OUK+kxjA3B6S=YWR84f2To6rvankWw_b8NZhaGgA@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox