mbox series

[WIP,00/14] AMD Nested Virt Preparation

Message ID 20240626133853.4150731-1-george.dunlap@cloud.com (mailing list archive)
Headers show
Series AMD Nested Virt Preparation | expand

Message

George Dunlap June 26, 2024, 1:38 p.m. UTC
This is my work-in-progress series for getting nested virt working
again on AMD.

The first patch is an early draft to integrate the SVM bits into the
CPUID framework.  It will be partially superseded by a series Andrew
has posted but which has not yet been checked in.

The second patch is a workaround which hides the PCID bit from the L1
when nested HVM is enabled.  Long-term, nested support for PCID will
be necessary for performance.

Most of the rest of the patches involve improving tracing: Either
fixing what's bitrotted in xenalyze, what's bitrotted specifically on
the SVM side, or what could be improved in the upstream tracing.

The last patch is a placeholder for future work, commenting a place
where behavior is wrong and another where more work needs to be done
to assure safety.

George Dunlap (14):
  x86/cpuid-policy: Add AMD SVM CPUID leaf to featureset
  x86/cpu-policy: HACK Disable PCID when nested virt is enabled
  xenalyze: Basic nested virt processing
  xenalyze: Track generic event information when not in summary mode
  xenalyze: Ignore vmexits where an HVM_HANDLER traces would be
    redundant
  xen/svm: Remove redundant HVM_HANDLER trace for EXCEPTION_AC
  xen/hvm: Don't skip MSR_READ trace record
  svm: Do NPF trace before calling hvm_hap_nested_page_fault
  x86/emulate: Don't trace cr reads during emulation
  xenalyze: Quiet warnings about VMEXIT_IOIO
  x86/trace: Add trace to xsetbv svm/vmx handler path
  xenalyze: Basic processing for XSETBV exits and handlers
  x86/svm: Add a trace for VMEXIT_VMRUN
  x86/nestedsvm: Note some places for improvement

 tools/libs/light/libxl_cpuid.c              |   1 +
 tools/misc/xen-cpuid.c                      |   1 +
 tools/xentrace/xenalyze.c                   | 133 +++++++++++++++-----
 xen/arch/x86/cpu-policy.c                   |  24 ++--
 xen/arch/x86/cpu/common.c                   |   2 +
 xen/arch/x86/hvm/emulate.c                  |   1 -
 xen/arch/x86/hvm/hvm.c                      |   4 +-
 xen/arch/x86/hvm/svm/nestedsvm.c            |  13 ++
 xen/arch/x86/hvm/svm/svm.c                  |   7 +-
 xen/include/public/arch-x86/cpufeatureset.h |  16 +++
 xen/include/public/trace.h                  |   1 +
 xen/include/xen/lib/x86/cpu-policy.h        |  10 +-
 xen/lib/x86/cpuid.c                         |   4 +-
 13 files changed, 167 insertions(+), 50 deletions(-)

Comments

George Dunlap June 26, 2024, 2:01 p.m. UTC | #1
On Wed, Jun 26, 2024 at 2:57 PM George Dunlap <george.dunlap@cloud.com> wrote:
>
> This is my work-in-progress series for getting nested virt working
> again on AMD.

Forgot to add, this can be found at this branch:

https://gitlab.com/xen-project/people/gdunlap/xen/-/commits/working/amd-nested-virt

 -George