Skip to content

Fix EFER.NX=0 with EPT

Avi Kivity kvm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v15 patches 5 repliesApplied

Changes in v2 from the cover letter

Fix transition from long mode to legacy mode

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: Let vcpu structure alignment be determined at runtimearch/ia64/kvm/vmm.c arch/powerpc/kvm/44x.c arch/powerpc/kvm/book3s.c +6 more+14 -110 replies
2/5KVM: VMX: Add definition for msr autoload entryarch/x86/include/asm/vmx.h+7 -10 replies
3/5KVM: VMX: Add definitions for guest and host EFER autoswitch vmcs entriesarch/x86/include/asm/vmx.h+4 -00 replies
4/5KVM: VMX: Add facility to atomically switch MSRs on guest entry/exitarch/x86/kvm/vmx.c+49 -00 replies
5/5KVM: VMX: Atomically switch efer if EPT && !EFER.NXarch/x86/kvm/vmx.c+12 -00 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMarcelo Tosatti
SeriesR-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] Fix EFER.NX=0 with EPT

Currently we run with EFER.NX=1 on the guest even if the guest value is 0. This is fine with shadow, since we check bit 63 when instantiating a page table, and fault if bit 63 is set while EFER.NX is clear.

This doesn't work with EPT, since we no longer get the change to check guest ptes. So we need to run with EFER.NX=0.

This is complicated by the fact that if we switch EFER.NX on the host, we'll trap immediately, since some host pages are mapped with the NX bit set. As a result, we need to switch the MSR atomically during guest entry and exit.

This patchset implements the complications described above.

v2:
Fix transition from long mode to legacy mode

Avi Kivity (5):
KVM: Let vcpu structure alignment be determined at runtime
KVM: VMX: Add definition for msr autoload entry
KVM: VMX: Add definitions for guest and host EFER autoswitch vmcs
entries
KVM: VMX: Add facility to atomically switch MSRs on guest entry/exit
KVM: VMX: Atomically switch efer if EPT && !EFER.NX

 arch/ia64/kvm/vmm.c        |    2 +-
 arch/powerpc/kvm/44x.c     |    2 +-
 arch/powerpc/kvm/book3s.c  |    3 +-
 arch/powerpc/kvm/e500.c    |    2 +-
 arch/s390/kvm/kvm-s390.c   |    2 +-
 arch/x86/include/asm/vmx.h |   12 +++++++-
 arch/x86/kvm/svm.c         |    2 +-
 arch/x86/kvm/vmx.c         |   64 +++++++++++++++++++++++++++++++++++++++++++-
 include/linux/kvm_host.h   |    2 +-
 virt/kvm/kvm_main.c        |    7 +++--
 10 files changed, 86 insertions(+), 12 deletions(-)