linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Bader <stefan.bader@canonical.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Matt Wilson <msw@amazon.com>,
	"Justin M. Forbes" <jmforbes@linuxtx.org>,
	xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH/RFC] Fix xsave bug on older Xen hypervisors
Date: Fri, 07 Sep 2012 18:13:55 +0200	[thread overview]
Message-ID: <504A1D43.2050909@canonical.com> (raw)
In-Reply-To: <504A347B0200007800099E92@nat28.tlf.novell.com>

[-- Attachment #1: Type: text/plain, Size: 2738 bytes --]

On 07.09.2012 17:52, Jan Beulich wrote:
>>>> On 07.09.12 at 17:47, Stefan Bader <stefan.bader@canonical.com> wrote:
>> On 07.09.2012 17:44, Jan Beulich wrote:
>>> All of this still doesn't provide evidence that a plain upstream
>>> kernel is actually having any problems in the first place. Further,
>>> if you say EC2 has a crippled hypervisor patch - is that patch
>>> available for looking at somewhere?
>>
>> It was not a hypervisor patch. It was one for the guest. This was the hack:
> 
> So then why do you want to patch the upstream kernel? It won't
> make that hack go away, nor will it help any existing kernels.
> 
> Jan
> 

It would not make it go away automatically, but whoever uses it could drop it.
It was unpatched upstream kernels that would have the problem. However, while
reading again through all the changelogs I noticed

commit 61f4237d5b005767a76f4f3694e68e6f78f392d9
Author: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Date:   Sat Sep 18 22:25:30 2010 -0700

    xen: just completely disable XSAVE

    Some (old) versions of Xen just kill the domain if it tries to set any
    unknown bits in CR4, so we can't reliably probe for OSXSAVE in
    CR4.

    Since Xen doesn't support XSAVE for guests at the moment, and no such
    support is being worked on, there's no downside in just unconditionally
    masking XSAVE support.

    Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

So until then the write to CR4 was deliberately done to probe the feature. This
was changed by

commit 947ccf9c3c30307b774af3666ee74fcd9f47f646
Author: Shan Haitao <haitao.shan@intel.com>
Date:   Tue Nov 9 11:43:36 2010 -0800

    xen: Allow PV-OPS kernel to detect whether XSAVE is supported

    Xen fails to mask XSAVE from the cpuid feature, despite not historically
    supporting guest use of XSAVE.  However, now that XSAVE support has been
    added to Xen, we need to reliably detect its presence.

    The most reliable way to do this is to look at the OSXSAVE feature in
    cpuid which is set iff the OS (Xen, in this case), has set
    CR4.OSXSAVE.

    [ Cleaned up conditional a bit. - Jeremy ]

    Signed-off-by: Shan Haitao <haitao.shan@intel.com>
    Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

This would make it save again _if_ the HV failing to handle the writes to CR4
(which iirc the kernel code still does when the cpuid bit is set) does have at
least the patch to mask off the cpuid bits (the one Ian mentioned)

Probably a lot of hand wavy iffs... :/


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]

  parent reply	other threads:[~2012-09-07 16:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07 11:40 [PATCH/RFC] Fix xsave bug on older Xen hypervisors Stefan Bader
2012-09-07 12:33 ` [Xen-devel] " Jan Beulich
2012-09-07 13:21   ` Stefan Bader
2012-09-07 14:02     ` Jan Beulich
2012-09-07 14:22       ` Justin M. Forbes
2012-09-07 14:54         ` Konrad Rzeszutek Wilk
2012-09-08 10:18           ` Paolo Bonzini
2012-09-10 22:36           ` Matt Wilson
2012-09-07 15:44         ` Jan Beulich
2012-09-07 15:47           ` Stefan Bader
2012-09-07 15:52             ` Jan Beulich
2012-09-07 15:48               ` Konrad Rzeszutek Wilk
2012-09-07 16:13               ` Stefan Bader [this message]
2012-09-08 10:28                 ` Paolo Bonzini
2012-09-07 15:54             ` Ian Campbell
2012-09-08 10:20             ` Paolo Bonzini
2012-09-07 16:00           ` Justin M. Forbes
2012-09-11  2:40             ` Matt Wilson
2012-09-11 11:37               ` Konrad Rzeszutek Wilk
2012-09-11 13:06                 ` Josh Boyer
2012-09-07 13:47 ` Konrad Rzeszutek Wilk
2012-09-11  1:17   ` Matt Wilson

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=504A1D43.2050909@canonical.com \
    --to=stefan.bader@canonical.com \
    --cc=JBeulich@suse.com \
    --cc=jmforbes@linuxtx.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msw@amazon.com \
    --cc=xen-devel@lists.xen.org \
    /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).