public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: Wanpeng Li <kernellwp@gmail.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org,
	Wanpeng Li <wanpeng.li@hotmail.com>,
	Richard Henderson <rth@twiddle.net>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] target-i386: fix losing XCR0 processor state component bits
Date: Wed, 28 Sep 2016 11:57:37 -0300	[thread overview]
Message-ID: <20160928145737.GJ3877@thinpad.lan.raisama.net> (raw)
In-Reply-To: <b8f568ac-64a3-852c-deb5-fa67fc147005@gnu.org>

On Wed, Sep 28, 2016 at 09:54:27AM +0200, Paolo Bonzini wrote:
> 
> 
> On 28/09/2016 07:31, Wanpeng Li wrote:
> > From: Wanpeng Li <wanpeng.li@hotmail.com>
> > 
> > Commit 96193c22a "target-i386: Move xsave component mask to features array"
> > leverages features array to handle XCR0 processor state component bits, 
> > however, it introduces a regression:
> > 
> > warning: host doesn't support requested feature: CPUID.0DH:EAX [bit 0]
> > warning: host doesn't support requested feature: CPUID.0DH:EAX [bit 1]
> > warning: host doesn't support requested feature: CPUID.0DH:EAX [bit 2]
> > 
> > My desktop doesn't have enough advance features, so just X87,SSE,AVX 
> > warnings are splat when I boot a guest.

Oops. I assume this is reproducible only using "-cpu host"?

> > 
> > The get migratable flags logic in x86_cpu_filter_features() path will 
> > filter out the feature flags which are unsupported and unmigratable. 
> > However, the bits of XCR0 processor state component featureword don't 
> > have feat_names, and some features like SSE/AVX etc have feat_names in 
> > CPUID.01H:EDX, CPUID.01H:ECX, so they are treated as unsupported.
> > 
> > This patch fix it by don't filter out XCR0 processor state components 
> > bits though they don't have feat_names just as before commit 96193c22ab3.
> > 
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Richard Henderson <rth@twiddle.net>
> > Cc: Eduardo Habkost <ehabkost@redhat.com>
> > Cc: Michael S. Tsirkin <mst@redhat.com>
> > Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> > ---
> >  target-i386/cpu.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> > index ad09246..9d24eff 100644
> > --- a/target-i386/cpu.c
> > +++ b/target-i386/cpu.c
> > @@ -2156,6 +2156,10 @@ static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
> >          r = kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax,
> >                                                      wi->cpuid_ecx,
> >                                                      wi->cpuid_reg);
> > +        if ((w == FEAT_XSAVE_COMP_LO) ||
> > +            (w == FEAT_XSAVE_COMP_HI)) {
> > +            return r;
> > +        }
> >      } else if (tcg_enabled()) {
> >          r = wi->tcg_features;
> >      } else {
> > 
> 
> I think the right place to add the test is x86_cpu_get_migratable_flags.

This can be fixed by adding actual property names to the
FEAT_XSAVE_COMP_* bits. This way we will be able to report
meaningful names to management in case GET_SUPPORTED_CPUID says a
given xsave component is not supported yet, and will ensure we
correctly treat still-unknown xsave components as unmigratable.

-- 
Eduardo

  parent reply	other threads:[~2016-09-28 14:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28  5:31 [PATCH] target-i386: fix losing XCR0 processor state component bits Wanpeng Li
2016-09-28  7:54 ` Paolo Bonzini
2016-09-28  8:38   ` Wanpeng Li
2016-09-28 14:57   ` Eduardo Habkost [this message]
2016-09-28 15:01     ` Paolo Bonzini
2016-09-28 15:05       ` Eduardo Habkost
2016-09-28 15:09         ` Paolo Bonzini
2016-09-28 15:59           ` Eduardo Habkost
2016-09-28 16:07             ` Paolo Bonzini
2016-09-28 16:13               ` Eduardo Habkost
2016-09-28 16:29                 ` Eduardo Habkost

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=20160928145737.GJ3877@thinpad.lan.raisama.net \
    --to=ehabkost@redhat.com \
    --cc=bonzini@gnu.org \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=wanpeng.li@hotmail.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