From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>
Cc: "Wei Liu" <wl@xen.org>, "Roger Pau Monne" <roger.pau@citrix.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/CPUID: surface suitable value in EBX of XSTATE subleaf 1
Date: Wed, 24 Aug 2022 14:36:01 +0200 [thread overview]
Message-ID: <945542c5-539c-c3fa-6be7-efa1af5cd2ae@suse.com> (raw)
In-Reply-To: <fa15c1a4-8f28-d2f6-6582-e49af6ebf74e@citrix.com>
On 24.08.2022 14:19, Andrew Cooper wrote:
> On 24/08/2022 07:00, Jan Beulich wrote:
>> On 23.08.2022 12:48, Andrew Cooper wrote:
>>> On 23/08/2022 10:27, Jan Beulich wrote:
>>>> On 23.08.2022 10:59, Andrew Cooper wrote:
>>>>> But this is going to further complicate my several-year-old series
>>>>> trying to get Xen's XSTATE handling into a position where we can start
>>>>> to offer supervisor states.
>>>> Where do you see further complication? The necessary fiddling with XSS
>>>> here would of course be dependent upon p->xstate.xsaves alone (or,
>>>> maybe better, on the set of enabled features in XSS being non-empty),
>>>> but that's simply another (inner) if().
>>>>
>>>> As an aside, I actually wonder what use the supplied size is to user
>>>> mode code when any XSS-controlled feature is enabled: They'd allocate
>>>> a needlessly large block of memory, as they would only be able to use
>>>> XSAVEC.
>>> This field is an already known kernel=>user infoleak. There are threads
>>> about it on LKML.
>>>
>>> But it does highlight another problem. This change does not fix Linux
>>> on AMD Zen3 hardware, where the kernel will find the CPUID value larger
>>> than it can calculate the size to be, because Xen's use of CET-SS will
>>> show up in the CPUID value.
>> Why would that be? We don't even have CET related defines for XCR0, so
>> we don't enable the states in XSS. And I don't see why we would. Even
>> for other XSTATE-managed but not XSTATE-enabled features we could
>> clear the respective bits around the CPUID invocation (just like we
>> may need to set some in XSS). We'd be in trouble only for any XSTATE-
>> enabled feature that we make use of ourselves.
>
> It's not Xen's CPUID invocation which is relevant. It's the guest
> kernels, which goes straight to hardware because AMD still doesn't have
> CPUID faulting.
>
> And yes, right now none of Xen's CET state shows up in XSTATE, but that
> needs to change in order to support CET in HVM guests if we don't want
> an enormous extra overhead in the general context switch path.
Right. HVM guests, though, aren't affected by the CPUID limitation you
name for AMD. And PV guests could continue to be run with the bits off
in XSS (we need to context switch XSS and XCR0 anyway).
Jan
prev parent reply other threads:[~2022-08-24 12:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 6:42 [PATCH] x86/CPUID: surface suitable value in EBX of XSTATE subleaf 1 Jan Beulich
2022-08-23 8:59 ` Andrew Cooper
2022-08-23 9:27 ` Jan Beulich
2022-08-23 10:48 ` Andrew Cooper
2022-08-23 12:01 ` Jan Beulich
2022-08-24 12:02 ` Andrew Cooper
2022-08-24 12:11 ` Andrew Cooper
2022-08-24 6:00 ` Jan Beulich
2022-08-24 12:19 ` Andrew Cooper
2022-08-24 12:36 ` Jan Beulich [this message]
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=945542c5-539c-c3fa-6be7-efa1af5cd2ae@suse.com \
--to=jbeulich@suse.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=marmarek@invisiblethingslab.com \
--cc=roger.pau@citrix.com \
--cc=tglx@linutronix.de \
--cc=wl@xen.org \
--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.