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

[Xen-devel] [PATCH v3 0/9] 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 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 an arbitrary number of vCPUs per guest).

v2 --> v3:
- "VMCX" is replaced with "VMCx" in comments and commit messages
- current pointer is now calculated only once in nvmx_eptp_update()
  and np2m_schedule()
- moved p2m_unlock() out of nestedhap_fix_p2m() for balanced lock/unlock
- Updated commit message in patch #2
- Replaced "shadow p2m" with "np2m" for consistency in commit message
  of patch #6

v1 --> v2 (by George):
- Fixed a race with stale_np2m and vmwrite
- Squashed 14 patches down to 9
- Updated commit messages

RFC --> v1:
- Some commit messages are updated based on George's comments
- Replaced VMX's terminology in common code with HVM's one
- Patch "x86/vvmx: add stale_eptp flag" is split into
  "x86/np2m: add stale_np2m flag" and
  "x86/vvmx: restart nested vmentry in case of stale_np2m"
- Added "x86/np2m: refactor p2m_get_nestedp2m_locked()" patch
- I've done some light nested SVM testing and fixed 1 regression
  (see patch #4)

Sergey Dyasli (9):
  x86/np2m: refactor p2m_get_nestedp2m()
  x86/np2m: flush all np2m objects on nested INVEPT
  x86/np2m: remove np2m_base from p2m_get_nestedp2m()
  x86/np2m: simplify nestedhvm_hap_nested_page_fault()
  x86/vvmx: make updating shadow EPTP value more efficient
  x86/np2m: send flush IPIs only when a vcpu is actively using an np2m
  x86/np2m: implement sharing of np2m between vCPUs
  x86/np2m: refactor p2m_get_nestedp2m_locked()
  x86/np2m: add break to np2m_flush_eptp()

 xen/arch/x86/domain.c            |   2 +
 xen/arch/x86/hvm/nestedhvm.c     |   3 +
 xen/arch/x86/hvm/svm/nestedsvm.c |   6 +-
 xen/arch/x86/hvm/vmx/entry.S     |   6 ++
 xen/arch/x86/hvm/vmx/vmx.c       |  14 ++--
 xen/arch/x86/hvm/vmx/vvmx.c      |  36 ++++++--
 xen/arch/x86/mm/hap/nested_hap.c |  34 ++++----
 xen/arch/x86/mm/p2m.c            | 175 ++++++++++++++++++++++++++++++++-------
 xen/include/asm-x86/hvm/vcpu.h   |   2 +
 xen/include/asm-x86/p2m.h        |  17 +++-
 10 files changed, 223 insertions(+), 72 deletions(-)

-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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