[PATCH V1 0/8] x86/nestedvmx: Fix nested VMX bugs

chunjie.zhu@citrix.com posted 8 patches 4 weeks ago
There is a newer version of this series
xen/arch/x86/hvm/hvm.c                  |   6 ++
xen/arch/x86/hvm/vmx/vmx.c              |   5 +-
xen/arch/x86/hvm/vmx/vvmx.c             | 110 ++++++++++++++++++++++--
xen/arch/x86/include/asm/hvm/vmx/vvmx.h |  11 ++-
xen/arch/x86/mm/hap/nested_ept.c        |  19 ++--
xen/arch/x86/mm/hap/nested_hap.c        |  52 ++++++++++-
xen/arch/x86/mm/p2m.c                   |  17 +++-
7 files changed, 200 insertions(+), 20 deletions(-)
[PATCH V1 0/8] x86/nestedvmx: Fix nested VMX bugs
Posted by chunjie.zhu@citrix.com 4 weeks ago
From: Chunjie Zhu <chunjie.zhu@citrix.com>

This series fixes several bugs found while running nested VMX guests
(L1 Xen running an L2 guest) on top of Xen:

 - Patch 1: stop leaking L0's widened access bits into the EPT violation
   exit qualification reflected to L1.
 - Patch 2: implement the missing nhvm_hap_walk_L1_p2m2 hook on VMX; the
   NULL hook causes a #UD and host panic when L0 emulates an L2 access.
 - Patch 3: emulate L2 accesses that hit the APIC-access dummy page
   against L1's vLAPIC instead of mapping the page directly.
 - Patch 4: reflect EPT holes hit during L2 emulation to L1 as EPT
   violations rather than injecting a bogus #PF into L2.
 - Patch 5: load L2's EFER on VM entry and restore L1's on VM exit, so
   L2 neither sees L0's LME nor fails VM entry with invalid guest state.
 - Patch 6: invalidate EPT caches after flushing a nested p2m, to avoid
   L2 walking stale paging-structure caches into freed pages.
 - Patch 7: retry a nested page fault if the np2m changes while L1/L0
   p2m are being walked without the np2m lock held.
 - Patch 8: fix several nested VPID problems.

Chunjie Zhu (8):
  x86/nestedvmx: Preserve hardware access bits in reflected EPT
    violations
  x86/nestedvmx: Implement nhvm_hap_walk_L1_p2m2
  x86/nestedvmx: Emulate L2 accesses to L1's LAPIC page
  x86/nestedvmx: Reflect EPT holes hit during L2 emulation to L1
  x86/nestedvmx: Load L2's EFER on VM entry and restore L1's on VM exit
  x86/p2m: invalidate EPT caches after flushing a nested p2m
  x86/nestedhap: Retry nested page fault if the np2m changes during walk
  x86/vmx: Fix nested VPID handling

 xen/arch/x86/hvm/hvm.c                  |   6 ++
 xen/arch/x86/hvm/vmx/vmx.c              |   5 +-
 xen/arch/x86/hvm/vmx/vvmx.c             | 110 ++++++++++++++++++++++--
 xen/arch/x86/include/asm/hvm/vmx/vvmx.h |  11 ++-
 xen/arch/x86/mm/hap/nested_ept.c        |  19 ++--
 xen/arch/x86/mm/hap/nested_hap.c        |  52 ++++++++++-
 xen/arch/x86/mm/p2m.c                   |  17 +++-
 7 files changed, 200 insertions(+), 20 deletions(-)

-- 
2.34.1