nEPT: Nested EPT support for Nested VMX
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 38 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | nEPT: Module optionarch/ | +12 | 5 replies | |
| 2/10 | nEPT: MMU context for nested EPTarch/ | +60 | 20 replies | |
| 3/10 | nEPT: Fix cr3 handling in nested exit and entryarch/ | +30 | 0 replies | |
| 4/10 | nEPT: Fix page table format in nested EPTarch/ arch/ arch/ +1 more | +17 | 5 replies | |
| 5/10 | nEPT: Fix wrong test in kvm_set_cr3arch/ | +0 | 0 replies | |
| 6/10 | nEPT: Some additional commentsarch/ | +19 | 0 replies | |
| 7/10 | nEPT: Advertise EPT to L1arch/ | +13 | 0 replies | |
| 8/10 | nEPT: Nested INVEPTarch/ arch/ | +114 | 3 replies | |
| 9/10 | nEPT: DocumentationDocumentation/ | +2 | 0 replies | |
| 10/10 | nEPT: Miscelleneous cleanupsarch/ | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/10] nEPT: Nested EPT support for Nested VMX
The following patches add nested EPT support to Nested VMX.
Nested EPT means emulating EPT for an L1 guest, allowing it use EPT when running a nested guest L2. When L1 uses EPT, it allows the L2 guest to set its own cr3 and take its own page faults without either of L0 or L1 getting involved. In many workloads this significanlty improves L2's performance over the previous two alternatives (shadow page tables over ept, and shadow page tables over shadow page tables). Our paper [1] described these three options, and the advantages of nested EPT ("multidimensional paging").
Nested EPT is enabled by default (if the hardware supports EPT), so users do not have to do anything special to enjoy the performance improvement that this patch gives to L2 guests.
Just as a non-scientific, non-representative indication of the kind of dramatic performance improvement you may see in workloads that have a lot of context switches and page faults, here is a measurement of the time an example single-threaded "make" took in L2 (kvm over kvm):
shadow over shadow: 105 seconds
("ept=0" forces this)
shadow over EPT: 87 seconds
(the previous default; Can be forced now with "nested_ept=0")
EPT over EPT: 29 seconds
(the default after this patch)
Note that the same test on L1 (with EPT) took 25 seconds, so for this example workload, performance of nested virtualization is now very close to that of single-level virtualization.
[1] "The Turtles Project: Design and Implementation of Nested Virtualization",
http://www.usenix.org/events/osdi10/tech/full_papers/Ben-Yehuda.pdf
Patch statistics:
-----------------
Documentation/virtual/kvm/nested-vmx.txt | 4 arch/x86/include/asm/kvm_host.h | 1 arch/x86/include/asm/vmx.h | 2 arch/x86/kvm/mmu.c | 16 - arch/x86/kvm/paging_tmpl.h | 6 arch/x86/kvm/vmx.c | 259 ++++++++++++++++++++- arch/x86/kvm/x86.c | 11 7 files changed, 269 insertions(+), 30 deletions(-)
--
Nadav Har'El
IBM Haifa Research Lab