[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/CPUID: surface suitable value in EBX of XSTATE subleaf 1


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 24 Aug 2022 08:00:50 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zt91lwIbbsksV0yTwfyBb2I1zskDDO/eRi+yZNFT4Y8=; b=XvyD5GIj2ECHKc107/fnFKy/vgBLW6T/BZWL4WaM0PkrZeRo0Jrwrk+LWpGI2thnRg5Jae3t3EpW6Ml8kgfFQU0yHQ47v7LrjkfSQnbQm7RyAkLf3N7HsVoNDF7T6q6n9+y10kLLWGUNkRxudXpKgnOprtiN+JqyWxg0GB5YyMrcCm6ADZ/GwzG1Nepdiy3zqARgdcMcPkXEKjvvYn4SIUZPPwuN/TWLpelrwpTtbgobv2mWRQo2jie/C46IaJ5r/y6RXgbC1quFFeBWQPOQMkgPCpaFdZwMVVeUe+NQYh8gOmRuR0d0Zft3WBKJqWYlvqS+5Xpg918J0q6ixz+yDg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FYDYdLS4esVpk36A1vxt8X9oXPBcmALBUd+l35UhbsKPlsK/+iOFUq0kQe6MDS/ZnhvdjzCVOcETexgwaFgicmFDOWqhK78+5B8za8BOcdIF63UKtt7mqGGoUlUPCITVQUBx0kA3i7EV5svH5Naf1I2bjeOIzxmkSAXg44n+1kp40QZUOL2N/5e34aJJWozSSK9+N65O4OjenSepNa+QOBZcsbsaG9DfH3cAATFXm66jV1073yjByh3uI7sKAHCZ5tYY4KbN6tfR8nTZ1DUUNPI4aM8Reg41CNZWnFHIOfZruxG5hC3bAZMutg7mQPU7awbXWKwQmsyvx3qmmD+16g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Aug 2022 06:01:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.