All of lore.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 13:13:32 -0300	[thread overview]
Message-ID: <20160928161332.GM3877@thinpad.lan.raisama.net> (raw)
In-Reply-To: <697476ea-81b0-f33a-bace-31f420dad676@gnu.org>

On Wed, Sep 28, 2016 at 06:07:13PM +0200, Paolo Bonzini wrote:
> 
> 
> On 28/09/2016 17:59, Eduardo Habkost wrote:
> > On Wed, Sep 28, 2016 at 05:09:46PM +0200, Paolo Bonzini wrote:
> >>
> >>
> >> On 28/09/2016 17:05, Eduardo Habkost wrote:
> >>>> Hmm, right.  Even though XSAVE could be migrated as a blob, QEMU
> >>>> marshals and unmarshals the registers out and back into the xsave data,
> >>>> so that unknown features are indeed unmigratable.
> >>>>
> >>>> But are the property names necessary?  It makes no sense to
> >>>> enable/disable XSAVE components separately from the other CPUID bits
> >>>> that enable them.  Could we just mark all unknown features as
> >>>> unmigratable without giving them names?
> >>>
> >>> We could, as we don't really need to make them configurable. But
> >>> giving them names will also allow us to return more useful data
> >>> to libvirt in case GET_SUPPORTED_CPUID returns some bits as
> >>> unsupported. The new CPU runnability/comparison APIs are all
> >>> based on property names.
> >>
> >> The names could, or perhaps should, be obtained also from
> >> x86_ext_save_areas (apart from the legacy x87 and sse components which
> >> are guaranteed to be there).  Basically property names such as "avx"
> >> trigger both the regular CPUID bits and the XSAVE components.
> > 
> > Yes, this makes sense. If XSTATE_YMM_BIT is missing, for example,
> > it is more useful to say "avx" is unsupported by the host, than
> > something like "xsave-component-ymm".
> 
> So instead of looking at wi->feat_names[i] we could have a wrapper that
> returns the name and special cases xsave components words?  This should
> be used in both x86_cpu_get_migratable_flags and
> report_unavailable_features, but not elsewhere as far as I could see.

Sounds good to me. I will do it.

-- 
Eduardo

WARNING: multiple messages have this Message-ID (diff)
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: [Qemu-devel] [PATCH] target-i386: fix losing XCR0 processor state component bits
Date: Wed, 28 Sep 2016 13:13:32 -0300	[thread overview]
Message-ID: <20160928161332.GM3877@thinpad.lan.raisama.net> (raw)
In-Reply-To: <697476ea-81b0-f33a-bace-31f420dad676@gnu.org>

On Wed, Sep 28, 2016 at 06:07:13PM +0200, Paolo Bonzini wrote:
> 
> 
> On 28/09/2016 17:59, Eduardo Habkost wrote:
> > On Wed, Sep 28, 2016 at 05:09:46PM +0200, Paolo Bonzini wrote:
> >>
> >>
> >> On 28/09/2016 17:05, Eduardo Habkost wrote:
> >>>> Hmm, right.  Even though XSAVE could be migrated as a blob, QEMU
> >>>> marshals and unmarshals the registers out and back into the xsave data,
> >>>> so that unknown features are indeed unmigratable.
> >>>>
> >>>> But are the property names necessary?  It makes no sense to
> >>>> enable/disable XSAVE components separately from the other CPUID bits
> >>>> that enable them.  Could we just mark all unknown features as
> >>>> unmigratable without giving them names?
> >>>
> >>> We could, as we don't really need to make them configurable. But
> >>> giving them names will also allow us to return more useful data
> >>> to libvirt in case GET_SUPPORTED_CPUID returns some bits as
> >>> unsupported. The new CPU runnability/comparison APIs are all
> >>> based on property names.
> >>
> >> The names could, or perhaps should, be obtained also from
> >> x86_ext_save_areas (apart from the legacy x87 and sse components which
> >> are guaranteed to be there).  Basically property names such as "avx"
> >> trigger both the regular CPUID bits and the XSAVE components.
> > 
> > Yes, this makes sense. If XSTATE_YMM_BIT is missing, for example,
> > it is more useful to say "avx" is unsupported by the host, than
> > something like "xsave-component-ymm".
> 
> So instead of looking at wi->feat_names[i] we could have a wrapper that
> returns the name and special cases xsave components words?  This should
> be used in both x86_cpu_get_migratable_flags and
> report_unavailable_features, but not elsewhere as far as I could see.

Sounds good to me. I will do it.

-- 
Eduardo

  reply	other threads:[~2016-09-28 16:13 UTC|newest]

Thread overview: 22+ 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  5:31 ` [Qemu-devel] " Wanpeng Li
2016-09-28  7:54 ` Paolo Bonzini
2016-09-28  7:54   ` [Qemu-devel] " Paolo Bonzini
2016-09-28  8:38   ` Wanpeng Li
2016-09-28  8:38     ` [Qemu-devel] " Wanpeng Li
2016-09-28 14:57   ` Eduardo Habkost
2016-09-28 14:57     ` [Qemu-devel] " Eduardo Habkost
2016-09-28 15:01     ` Paolo Bonzini
2016-09-28 15:01       ` [Qemu-devel] " Paolo Bonzini
2016-09-28 15:05       ` Eduardo Habkost
2016-09-28 15:05         ` [Qemu-devel] " Eduardo Habkost
2016-09-28 15:09         ` Paolo Bonzini
2016-09-28 15:09           ` [Qemu-devel] " Paolo Bonzini
2016-09-28 15:59           ` Eduardo Habkost
2016-09-28 15:59             ` [Qemu-devel] " Eduardo Habkost
2016-09-28 16:07             ` Paolo Bonzini
2016-09-28 16:07               ` [Qemu-devel] " Paolo Bonzini
2016-09-28 16:13               ` Eduardo Habkost [this message]
2016-09-28 16:13                 ` Eduardo Habkost
2016-09-28 16:29                 ` Eduardo Habkost
2016-09-28 16:29                   ` [Qemu-devel] " 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=20160928161332.GM3877@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.