All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 00/14] Nested p2m: allow sharing between vCPUs
@ 2017-09-04  8:14 Sergey Dyasli
  2017-09-04  8:14 ` [PATCH v1 01/14] x86/np2m: refactor p2m_get_nestedp2m() Sergey Dyasli
                   ` (14 more replies)
  0 siblings, 15 replies; 22+ messages in thread
From: Sergey Dyasli @ 2017-09-04  8:14 UTC (permalink / raw)
  To: xen-devel
  Cc: Sergey Dyasli, Kevin Tian, Jun Nakajima, George Dunlap,
	Andrew Cooper, Tim Deegan, Jan Beulich, Boris Ostrovsky,
	Suravee Suthikulpanit

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 arbitrary number of vCPUs per guest).

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 (14):
  x86/np2m: refactor p2m_get_nestedp2m()
  x86/np2m: add np2m_flush_base()
  x86/vvmx: use np2m_flush_base() for INVEPT_SINGLE_CONTEXT
  x86/np2m: remove np2m_base from p2m_get_nestedp2m()
  x86/np2m: add np2m_generation
  x86/np2m: add stale_np2m flag
  x86/vvmx: restart nested vmentry in case of stale_np2m
  x86/np2m: add np2m_schedule()
  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: refactor p2m_get_nestedp2m_locked()
  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     |   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      |  28 +++++--
 xen/arch/x86/mm/hap/nested_hap.c |  29 +++----
 xen/arch/x86/mm/p2m.c            | 174 ++++++++++++++++++++++++++++++++-------
 xen/include/asm-x86/hvm/vcpu.h   |   2 +
 xen/include/asm-x86/p2m.h        |  17 +++-
 10 files changed, 211 insertions(+), 70 deletions(-)

-- 
2.11.0


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

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

end of thread, other threads:[~2017-09-29 15:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-04  8:14 [PATCH v1 00/14] Nested p2m: allow sharing between vCPUs Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 01/14] x86/np2m: refactor p2m_get_nestedp2m() Sergey Dyasli
2017-09-28 14:00   ` George Dunlap
2017-09-04  8:14 ` [PATCH v1 02/14] x86/np2m: add np2m_flush_base() Sergey Dyasli
2017-09-28 14:01   ` George Dunlap
2017-09-04  8:14 ` [PATCH v1 03/14] x86/vvmx: use np2m_flush_base() for INVEPT_SINGLE_CONTEXT Sergey Dyasli
2017-09-26 16:05   ` George Dunlap
2017-09-04  8:14 ` [PATCH v1 04/14] x86/np2m: remove np2m_base from p2m_get_nestedp2m() Sergey Dyasli
2017-09-26 16:06   ` George Dunlap
2017-09-04  8:14 ` [PATCH v1 05/14] x86/np2m: add np2m_generation Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 06/14] x86/np2m: add stale_np2m flag Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 07/14] x86/vvmx: restart nested vmentry in case of stale_np2m Sergey Dyasli
2017-09-29 10:53   ` George Dunlap
2017-09-29 13:39     ` Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 08/14] x86/np2m: add np2m_schedule() Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 09/14] x86/np2m: add p2m_get_nestedp2m_locked() Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 10/14] x86/np2m: improve nestedhvm_hap_nested_page_fault() Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 11/14] x86/np2m: implement sharing of np2m between vCPUs Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 12/14] x86/np2m: refactor p2m_get_nestedp2m_locked() Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 13/14] x86/np2m: add break to np2m_flush_eptp() Sergey Dyasli
2017-09-04  8:14 ` [PATCH v1 14/14] x86/vvmx: remove EPTP write from ept_handle_violation() Sergey Dyasli
2017-09-29 15:01 ` [PATCH v1 00/14] Nested p2m: allow sharing between vCPUs George Dunlap

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.