qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: "Yang, Weijiang" <weijiang.yang@intel.com>
Cc: "Zhong, Yang" <yang.zhong@intel.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	 "yang.zhong@linux.intel.com" <yang.zhong@linux.intel.com>,
	 "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [RESEND PATCH v2] target/i386: Switch back XFRM value
Date: Mon, 27 Mar 2023 09:33:25 +0200	[thread overview]
Message-ID: <CAATJJ0JLFA3b=KYP-OKXzritJGY1GuuRh+E4D6XZ3RLa6zKn_g@mail.gmail.com> (raw)
In-Reply-To: <253335ef-5e63-0182-f92b-a576b2459cff@intel.com>

On Thu, Oct 27, 2022 at 2:36 AM Yang, Weijiang <weijiang.yang@intel.com> wrote:
>
>
> On 10/26/2022 7:57 PM, Zhong, Yang wrote:
> > The previous patch wrongly replaced FEAT_XSAVE_XCR0_{LO|HI} with
> > FEAT_XSAVE_XSS_{LO|HI} in CPUID(EAX=12,ECX=1):{ECX,EDX}, which made
> > SGX enclave only supported SSE and x87 feature(xfrm=0x3).
> >
> > Fixes: 301e90675c3f ("target/i386: Enable support for XSAVES based features")
> >
> > Signed-off-by: Yang Zhong <yang.zhong@linux.intel.com>
> > ---
> >   target/i386/cpu.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> > index ad623d91e4..19aaed877b 100644
> > --- a/target/i386/cpu.c
> > +++ b/target/i386/cpu.c
> > @@ -5584,8 +5584,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
> >           } else {
> >               *eax &= env->features[FEAT_SGX_12_1_EAX];
> >               *ebx &= 0; /* ebx reserve */
> > -            *ecx &= env->features[FEAT_XSAVE_XSS_LO];
> > -            *edx &= env->features[FEAT_XSAVE_XSS_HI];
> > +            *ecx &= env->features[FEAT_XSAVE_XCR0_LO];
> > +            *edx &= env->features[FEAT_XSAVE_XCR0_HI];
>
> Oops, that's my fault to replace with wrong definitions, thanks for the fix!
>
> Reviewed-by:  Yang Weijiang <weijiang.yang@intel.com>

Hi,
I do not have any background on this but stumbled over this and wondered,
is there any particular reason why this wasn't applied yet?

It seemed to fix a former mistake, was acked and then ... silence

> >
> >               /* FP and SSE are always allowed regardless of XSAVE/XCR0. */
> >               *ecx |= XSTATE_FP_MASK | XSTATE_SSE_MASK;
>


-- 
Christian Ehrhardt
Senior Staff Engineer, Ubuntu Server
Canonical Ltd


  reply	other threads:[~2023-03-27  7:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 11:57 [RESEND PATCH v2] target/i386: Switch back XFRM value Yang Zhong
2022-10-27  0:28 ` Yang, Weijiang
2023-03-27  7:33   ` Christian Ehrhardt [this message]
2023-03-27  8:03     ` Yang, Weijiang
2023-04-06  5:32       ` Yang Zhong

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-all 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='CAATJJ0JLFA3b=KYP-OKXzritJGY1GuuRh+E4D6XZ3RLa6zKn_g@mail.gmail.com' \
    --to=christian.ehrhardt@canonical.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weijiang.yang@intel.com \
    --cc=yang.zhong@intel.com \
    --cc=yang.zhong@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).