public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: x86: Emulate L2 triple fault without killing L1
@ 2021-03-02 17:45 Sean Christopherson
  2021-03-02 17:45 ` [PATCH 1/2] KVM: x86: Handle triple fault in L2 " Sean Christopherson
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sean Christopherson @ 2021-03-02 17:45 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson,
	Joerg Roedel, kvm, linux-kernel, Boris Ostrovsky

If KVM (L0) intercepts #GP, but L1 does not, then L2 can kill L1 by
triggering triple fault.  On both VMX and SVM, if the CPU hits a fault
while vectoring an injected #DF (or I supposed any #DF), any intercept
from the hypervisor takes priority over triple fault.  #PF is unlikely to
be intercepted by L0 but not L1.  The bigger problem is #GP, which is
intercepted on both VMX and SVM if enable_vmware_backdoor=1, and is also
now intercepted for the lovely VMRUN/VMLOAD/VMSAVE errata.

Based on kvm/queue, commit fe5f0041c026 ("KVM/SVM: Move vmenter.S exception
fixups out of line").  x86.c and svm/nested.c conflict with kvm/master.
They are minor and straighforward, but let me know if you want me to post
a version based on kvm/master for easier inclusion into 5.12.

Sean Christopherson (2):
  KVM: x86: Handle triple fault in L2 without killing L1
  KVM: nSVM: Add helper to synthesize nested VM-Exit without collateral

 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/lapic.c            |  2 +-
 arch/x86/kvm/svm/nested.c       | 57 ++++++++-------------------------
 arch/x86/kvm/svm/svm.c          |  6 +---
 arch/x86/kvm/svm/svm.h          |  9 ++++++
 arch/x86/kvm/vmx/nested.c       |  9 ++++++
 arch/x86/kvm/x86.c              | 29 +++++++++++++----
 arch/x86/kvm/x86.h              |  2 ++
 8 files changed, 60 insertions(+), 55 deletions(-)

-- 
2.30.1.766.gb4fecdf3b7-goog


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

end of thread, other threads:[~2021-03-03  7:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-02 17:45 [PATCH 0/2] KVM: x86: Emulate L2 triple fault without killing L1 Sean Christopherson
2021-03-02 17:45 ` [PATCH 1/2] KVM: x86: Handle triple fault in L2 " Sean Christopherson
2021-03-02 17:45 ` [PATCH 2/2] KVM: nSVM: Add helper to synthesize nested VM-Exit without collateral Sean Christopherson
2021-03-02 17:49 ` [PATCH 0/2] KVM: x86: Emulate L2 triple fault without killing L1 Paolo Bonzini
2021-03-02 18:17   ` Sean Christopherson
2021-03-02 19:42 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox