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

Re: [PATCH 0/3] Add CpuidUserDis support


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 8 May 2023 11:06:31 +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=3iR+3mk6Pn9vKssQCx3/HtfIvIl3z3pMrxq7NHaT7Tg=; b=cUHjSiuZCFpHw+3pn+wn3yQuJOitk/gdbnXMuT7S3AGyeLneqsCA0YST/j+y3pFTVOIV9uuRJwn6/WCB99f5VfbeyOL4cwzg166LHZH2sGgDP9XXEqbleEIGpQTlUPa/pmm77Wq05FRf+mYB48/go6O4wUOE4lDReMUkbwPhtJNXWjmEMi/8E+kzEjkHmocWQ/klKMS2JyBhTdT+rD18LxHm+n2BzNjS8ISeBP9YidDWd6Fn8RxoQsU1FaweQKjiMrMIuomYg3BZY0U7DN8mNAMHGgmDzxQ3SBI6/J4xjbIrWRgK8VnnCbnh5i6GACvRrZR8SUzka5D3gGEBWQa1eA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d3E2U2j9hj7ITOMupBLBdqJoAIfMfLXyZ1GdXZ1I6PfIEMj4QrqUwRiYj5P+C/CNOgZqi+n+GDuZJvyJqukYLTm594mx2BtcIdLstMVV4bwB8VQOBwL5sP/f60zE7sxaX61bY5AD+SFTvlGa15tivsSK0nDtI8reSUoAGVjjpB/gZWm5r2JdvG78lXMkFwFHZ6t1sK6yjQL7RsIpQUpgTl0gr72wV0NxsQOBp1pn/W/u/Y/2zqyO0h/jcju507/YtoQreWC5+vO21Kz11XQ8yGymlX/Bkn4qqTc+4t7b0+ATsY5kAeqYE/9Dr406d56g6P+2OCNdmjs6FqCPmQindQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 08 May 2023 09:06:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.05.2023 19:57, Alejandro Vallejo wrote:
> Nowadays AMD supports trapping the CPUID instruction from ring3 to ring0,

Since it's relevant for PV32: Their doc talks about CPL > 0, i.e. not just
ring 3. Therefore I wonder whether ...

> (CpuidUserDis)

... we shouldn't deviate from the PM and avoid the misleading use of "user"
in our internal naming.

Jan

> akin to Intel's "CPUID faulting". There is a difference in
> that the toggle bit is in a different MSR and the support bit is in CPUID
> itself rather than yet another MSR. This patch enables AMD hosts to use it
> when supported in order to provide correct CPUID contents to PV guests. Also
> allows HVM guests to use CpuidUserDis via emulated "CPUID faulting".
> 
> Patch 1 merely adds definitions to various places in CPUID and MSR
> 
> Patch 2 adds support for CpuidUserDis, hooking it in the probing path and
> the context switching path.
> 
> Patch 3 enables HVM guests to use CpuidUserDis as if it was CPUID faulting,
> saving an avoidable roundtrip through the hypervisor at fault handling.
> 
> Alejandro Vallejo (3):
>   x86: Add AMD's CpuidUserDis bit definitions
>   x86: Add support for CpuidUserDis
>   x86: Use CpuidUserDis if an AMD HVM guest toggles CPUID faulting
> 
>  tools/libs/light/libxl_cpuid.c              |  1 +
>  tools/misc/xen-cpuid.c                      |  2 +
>  xen/arch/x86/cpu/amd.c                      | 29 +++++++++++-
>  xen/arch/x86/cpu/common.c                   | 51 +++++++++++----------
>  xen/arch/x86/cpu/intel.c                    | 11 ++++-
>  xen/arch/x86/include/asm/amd.h              |  1 +
>  xen/arch/x86/include/asm/msr-index.h        |  1 +
>  xen/arch/x86/msr.c                          |  9 +++-
>  xen/include/public/arch-x86/cpufeatureset.h |  1 +
>  9 files changed, 79 insertions(+), 27 deletions(-)
> 




 


Rackspace

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