xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 00/12] Nested p2m: allow sharing between vCPUs
@ 2017-07-18 10:34 Sergey Dyasli
  2017-07-18 10:34 ` [PATCH RFC 01/12] x86/np2m: refactor p2m_get_nestedp2m() Sergey Dyasli
                   ` (12 more replies)
  0 siblings, 13 replies; 23+ messages in thread
From: Sergey Dyasli @ 2017-07-18 10:34 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 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(-)

-- 
2.11.0


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

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

end of thread, other threads:[~2017-08-29 13:39 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 10:34 [PATCH RFC 00/12] Nested p2m: allow sharing between vCPUs Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 01/12] x86/np2m: refactor p2m_get_nestedp2m() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 02/12] x86/np2m: add np2m_flush_eptp() Sergey Dyasli
2017-08-01  7:55   ` Egger, Christoph
2017-08-03 14:18     ` Sergey Dyasli
2017-08-03 14:40       ` Jan Beulich
2017-08-28 16:08   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 03/12] x86/vvmx: use np2m_flush_eptp() for INVEPT_SINGLE_CONTEXT Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 04/12] x86/np2m: remove np2m_base from p2m_get_nestedp2m() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 05/12] x86/np2m: add np2m_generation Sergey Dyasli
2017-08-28 16:18   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 06/12] x86/vvmx: add stale_eptp flag Sergey Dyasli
2017-08-28 16:31   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 07/12] x86/np2m: add np2m_schedule_in/out() Sergey Dyasli
2017-08-28 16:42   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 08/12] x86/np2m: add p2m_get_nestedp2m_locked() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 09/12] x86/np2m: improve nestedhvm_hap_nested_page_fault() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 10/12] x86/np2m: implement sharing of np2m between vCPUs Sergey Dyasli
2017-08-28 16:59   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 11/12] x86/np2m: add break to np2m_flush_eptp() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 12/12] x86/vvmx: remove EPTP write from ept_handle_violation() Sergey Dyasli
2017-08-28 17:03 ` [PATCH RFC 00/12] Nested p2m: allow sharing between vCPUs George Dunlap
2017-08-29 13:39   ` Sergey Dyasli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).