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

[Xen-devel] [PATCH RFC 00/12] Nested p2m: allow sharing between vCPUs

Nested p2m (shadow EPT) is an object that stores memory address
translations from L2 GPA directly to L0 HPA. This is achieved by
combining together L1 EPT tables with L0 EPT during L2 EPT violations.

In the usual case, L1 uses the same EPTP value in VMCS12 for all vCPUs
of a L2 guest. But unfortunately, in current Xen's implementation, each
vCPU has its own n2pm object which cannot be shared with other vCPUs.
This leads to the following issues if a nested guest has SMP:

    1. There will be multiple np2m objects (1 per nested vCPU) with
       the same np2m_base (L1 EPTP value in VMCS12).

    2. Same EPT violations will be processed independently by each vCPU.

    3. Since MAX_NESTEDP2M is defined as 10, if a domain has more than
       10 nested vCPUs, performance will be extremely degraded due to
       constant np2m LRU list thrashing and np2m flushing.

This patch series makes it possible to share one np2m object between
different vCPUs that have the same np2m_base. Sharing of np2m objects
improves scalability of a domain from 10 nested vCPUs to 10 nested
guests (with arbitrary number of vCPUs per guest).

Known issues in current implementation:

    * AMD's nested SVM is likely broken. Unfortunately, I don't have any
      H/W currently to perform a proper testing.

Sergey Dyasli (12):
  x86/np2m: refactor p2m_get_nestedp2m()
  x86/np2m: add np2m_flush_eptp()
  x86/vvmx: use np2m_flush_eptp() for INVEPT_SINGLE_CONTEXT
  x86/np2m: remove np2m_base from p2m_get_nestedp2m()
  x86/np2m: add np2m_generation
  x86/vvmx: add stale_eptp flag
  x86/np2m: add np2m_schedule_in/out()
  x86/np2m: add p2m_get_nestedp2m_locked()
  x86/np2m: improve nestedhvm_hap_nested_page_fault()
  x86/np2m: implement sharing of np2m between vCPUs
  x86/np2m: add break to np2m_flush_eptp()
  x86/vvmx: remove EPTP write from ept_handle_violation()

 xen/arch/x86/domain.c              |   2 +
 xen/arch/x86/hvm/nestedhvm.c       |   2 +
 xen/arch/x86/hvm/svm/nestedsvm.c   |   2 +-
 xen/arch/x86/hvm/vmx/entry.S       |   6 ++
 xen/arch/x86/hvm/vmx/vmx.c         |  14 +--
 xen/arch/x86/hvm/vmx/vvmx.c        |  29 ++++--
 xen/arch/x86/mm/hap/nested_hap.c   |  29 +++---
 xen/arch/x86/mm/p2m.c              | 180 +++++++++++++++++++++++++++++++------
 xen/include/asm-x86/hvm/vcpu.h     |   1 +
 xen/include/asm-x86/hvm/vmx/vvmx.h |   2 +
 xen/include/asm-x86/p2m.h          |  15 +++-
 11 files changed, 218 insertions(+), 64 deletions(-)


Xen-devel mailing list



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