All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add CpuidUserDis support
@ 2023-05-05 17:57 Alejandro Vallejo
  2023-05-05 17:57 ` [PATCH 1/3] x86: Add AMD's CpuidUserDis bit definitions Alejandro Vallejo
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Alejandro Vallejo @ 2023-05-05 17:57 UTC (permalink / raw)
  To: Xen-devel
  Cc: Alejandro Vallejo, Wei Liu, Anthony PERARD, Juergen Gross,
	Jan Beulich, Andrew Cooper, Roger Pau Monné

Nowadays AMD supports trapping the CPUID instruction from ring3 to ring0,
(CpuidUserDis) 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(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-10 13:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05 17:57 [PATCH 0/3] Add CpuidUserDis support Alejandro Vallejo
2023-05-05 17:57 ` [PATCH 1/3] x86: Add AMD's CpuidUserDis bit definitions Alejandro Vallejo
2023-05-05 17:57 ` [PATCH 2/3] x86: Add support for CpuidUserDis Alejandro Vallejo
2023-05-08  9:17   ` Jan Beulich
2023-05-05 17:57 ` [PATCH 3/3] x86: Use CpuidUserDis if an AMD HVM guest toggles CPUID faulting Alejandro Vallejo
2023-05-08 13:18   ` Jan Beulich
2023-05-09 10:05     ` Andrew Cooper
2023-05-09 14:41       ` Jan Beulich
2023-05-09 14:57         ` Alejandro Vallejo
2023-05-10  8:15       ` Jan Beulich
2023-05-10 10:52         ` Alejandro Vallejo
2023-05-10 13:17           ` Jan Beulich
2023-05-08  9:06 ` [PATCH 0/3] Add CpuidUserDis support Jan Beulich
2023-05-10 11:28   ` Alejandro Vallejo

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.