qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 1/2] i386/cpu: Clear FEAT_XSAVE_COMP_{LO, HI} when XSAVE is not available
Date: Thu, 16 Jul 2020 23:22:06 +0800	[thread overview]
Message-ID: <adeb9bc9-ccbd-9752-4052-bdf08ceebb49@intel.com> (raw)
In-Reply-To: <20200716151554.GL1274972@habkost.net>

On 7/16/2020 11:15 PM, Eduardo Habkost wrote:
> On Thu, Jul 16, 2020 at 04:20:18PM +0800, Xiaoyao Li wrote:
>> Per Intel SDM vol 1, 13.2, if CPUID.1:ECX.XSAVE[bit 26] is 0, the
>> processor provides no further enumeration through CPUID function 0DH.
> 
> Can you explain what's the bug you are trying to fix?
> env->features[FEAT_XSAVE_COMP_*] is already initialized as zero.

When "-cpu host", it's not zero I think.

> 
>>
>> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
>> ---
>>   target/i386/cpu.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
>> index 1e5123251d74..f5f11603e805 100644
>> --- a/target/i386/cpu.c
>> +++ b/target/i386/cpu.c
>> @@ -6261,6 +6261,8 @@ static void x86_cpu_enable_xsave_components(X86CPU *cpu)
>>       uint64_t mask;
>>   
>>       if (!(env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE)) {
>> +        env->features[FEAT_XSAVE_COMP_LO] = 0;
>> +        env->features[FEAT_XSAVE_COMP_HI] = 0;
>>           return;
>>       }
>>   
>> -- 
>> 2.18.4
>>
> 



  reply	other threads:[~2020-07-16 15:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  8:20 [PATCH 0/2] Two Fixes for xsave compoent features Xiaoyao Li
2020-07-16  8:20 ` [PATCH 1/2] i386/cpu: Clear FEAT_XSAVE_COMP_{LO, HI} when XSAVE is not available Xiaoyao Li
2020-07-16 15:15   ` [PATCH 1/2] i386/cpu: Clear FEAT_XSAVE_COMP_{LO,HI} " Eduardo Habkost
2020-07-16 15:22     ` Xiaoyao Li [this message]
2020-08-18  7:45   ` [PATCH 1/2] i386/cpu: Clear FEAT_XSAVE_COMP_{LO, HI} " Paolo Bonzini
2020-07-16  8:20 ` [PATCH 2/2] i386/cpu: Mask off unsupported XSAVE components Xiaoyao Li
2020-07-16 15:14   ` Eduardo Habkost
2020-07-16 15:28     ` Xiaoyao Li

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=adeb9bc9-ccbd-9752-4052-bdf08ceebb49@intel.com \
    --to=xiaoyao.li@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).