From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] x86/PV: don't wrongly hide/expose CPUID.OSXSAVE from/to user mode
Date: Tue, 23 Aug 2016 10:48:36 +0100 [thread overview]
Message-ID: <014a7f99-d7b3-c089-e02b-bdfeea39cf08@citrix.com> (raw)
In-Reply-To: <57BC365802000078001083C9@prv-mh.provo.novell.com>
On 23/08/16 10:41, Jan Beulich wrote:
>>>> On 23.08.16 at 11:24, <andrew.cooper3@citrix.com> wrote:
>> On 23/08/16 10:00, Jan Beulich wrote:
>>>>>> On 22.08.16 at 19:30, <andrew.cooper3@citrix.com> wrote:
>>>> On 19/08/16 19:07, Andrew Cooper wrote:
>>>>> On 19/08/16 18:09, Andrew Cooper wrote:
>>>>>> On 19/08/16 13:53, Jan Beulich wrote:
>>>>>>> User mode code generally cannot be expected to invoke the PV-enabled
>>>>>>> CPUID Xen supports, and prior to the CPUID levelling changes for 4.7
>>>>>>> (as well as even nowadays on levelling incapable hardware) such CPUID
>>>>>>> invocations actually saw the host CR4.OSXSAVE value, whereas prior to
>>>>>>> this patch
>>>>>>> - on Intel guest user mode always saw the flag clear,
>>>>>>> - on AMD guest user mode saw the flag set even when the guest kernel
>>>>>>> didn't enable use of XSAVE/XRSTOR.
>>>>>>> Fold in the guest view of CR4.OSXSAVE when setting the levelling MSRs,
>>>>>>> just like we do in other CPUID handling.
>>>>>>>
>>>>>>> To make guest CR4 changes immediately visible via CPUID, also invoke
>>>>>>> ctxt_switch_levelling() from the CR4 write path.
>>>> I was just putting together a patch series to make these changes in a
>>>> more consistent manor, and have found a spanner in the works.
>>>>
>>>> Hiding Xen's view of OSXSAVE from a guests native cpuid will break
>>>> Linux, because of the pile of hacks making up the current PV XSAVE support.
>>> No, because PV Linux doesn't use native CPUID. We clearly should
>>> not hide OSXSAVE in the PV variant (and your earlier series did take
>>> great care to avoid that).
>> Where? There is no distinction for OSXSAVE.
>>
>> The only place in pv_cpuid() which distinguishes native vs emulated
>> cpuid is the X86_FEATURE_MONITOR handling.
>>
>> We distinguish kernel and userspace quite a lot, so the compatibility
>> breakages are only visible to the kernel.
> That's actually the part I meant.
I am sorry, but I now have no idea what you are referring to. We can't
reasonably do a kernel/userspace split with masking, because would
become substantially higher overhead, and Xen isn't necessarily involved
in the context switch back to userspace.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-23 9:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 12:53 [PATCH v2] x86/PV: don't wrongly hide/expose CPUID.OSXSAVE from/to user mode Jan Beulich
2016-08-19 17:09 ` Andrew Cooper
2016-08-19 18:07 ` Andrew Cooper
2016-08-22 17:30 ` Andrew Cooper
2016-08-23 9:00 ` Jan Beulich
2016-08-23 9:24 ` Andrew Cooper
2016-08-23 9:41 ` Jan Beulich
2016-08-23 9:48 ` Andrew Cooper [this message]
2016-08-23 9:56 ` Jan Beulich
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=014a7f99-d7b3-c089-e02b-bdfeea39cf08@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xenproject.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 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.