提交 7055fb11 编写于 作者: S Sean Christopherson 提交者: Paolo Bonzini

KVM: x86: Treat pending TRIPLE_FAULT requests as pending exceptions

Treat pending TRIPLE_FAULTS as pending exceptions.  A triple fault is an
exception for all intents and purposes, it's just not tracked as such
because there's no vector associated the exception.  E.g. if userspace
were to set vcpu->request_interrupt_window while running L2 and L2 hit a
triple fault, a triple fault nested VM-Exit should be synthesized to L1
before exiting to userspace with KVM_EXIT_IRQ_WINDOW_OPEN.

Link: https://lore.kernel.org/all/YoVHAIGcFgJit1qp@google.comSigned-off-by: NSean Christopherson <seanjc@google.com>
Reviewed-by: NMaxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20220830231614.3580124-23-seanjc@google.comSigned-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 7709aba8
...@@ -12760,9 +12760,6 @@ static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu) ...@@ -12760,9 +12760,6 @@ static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu)
if (kvm_xen_has_pending_events(vcpu)) if (kvm_xen_has_pending_events(vcpu))
return true; return true;
if (kvm_test_request(KVM_REQ_TRIPLE_FAULT, vcpu))
return true;
return false; return false;
} }
......
...@@ -85,7 +85,8 @@ int kvm_check_nested_events(struct kvm_vcpu *vcpu); ...@@ -85,7 +85,8 @@ int kvm_check_nested_events(struct kvm_vcpu *vcpu);
static inline bool kvm_is_exception_pending(struct kvm_vcpu *vcpu) static inline bool kvm_is_exception_pending(struct kvm_vcpu *vcpu)
{ {
return vcpu->arch.exception.pending || return vcpu->arch.exception.pending ||
vcpu->arch.exception_vmexit.pending; vcpu->arch.exception_vmexit.pending ||
kvm_test_request(KVM_REQ_TRIPLE_FAULT, vcpu);
} }
static inline void kvm_clear_exception_queue(struct kvm_vcpu *vcpu) static inline void kvm_clear_exception_queue(struct kvm_vcpu *vcpu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册