提交 33b42e98 编写于 作者: P Paolo Bonzini 提交者: Zheng Zengkai

KVM: nVMX: promptly process interrupts delivered while in guest mode

stable inclusion
from stable-5.10.76
commit 8f042315fcc46b7fc048ba7d7a3e136927e384d4
bugzilla: 182988 https://gitee.com/openeuler/kernel/issues/I4IAHF

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8f042315fcc46b7fc048ba7d7a3e136927e384d4

--------------------------------

commit 3a25dfa6 upstream.

Since commit c300ab9f ("KVM: x86: Replace late check_nested_events() hack with
more precise fix") there is no longer the certainty that check_nested_events()
tries to inject an external interrupt vmexit to L1 on every call to vcpu_enter_guest.
Therefore, even in that case we need to set KVM_REQ_EVENT.  This ensures
that inject_pending_event() is called, and from there kvm_check_nested_events().

Fixes: c300ab9f ("KVM: x86: Replace late check_nested_events() hack with more precise fix")
Cc: stable@vger.kernel.org
Reviewed-by: NSean Christopherson <seanjc@google.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 67b0f6ca
...@@ -6327,18 +6327,13 @@ static int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu) ...@@ -6327,18 +6327,13 @@ static int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu)
/* /*
* If we are running L2 and L1 has a new pending interrupt * If we are running L2 and L1 has a new pending interrupt
* which can be injected, we should re-evaluate * which can be injected, this may cause a vmexit or it may
* what should be done with this new L1 interrupt. * be injected into L2. Either way, this interrupt will be
* If L1 intercepts external-interrupts, we should * processed via KVM_REQ_EVENT, not RVI, because we do not use
* exit from L2 to L1. Otherwise, interrupt should be * virtual interrupt delivery to inject L1 interrupts into L2.
* delivered directly to L2.
*/ */
if (is_guest_mode(vcpu) && max_irr_updated) { if (is_guest_mode(vcpu) && max_irr_updated)
if (nested_exit_on_intr(vcpu)) kvm_make_request(KVM_REQ_EVENT, vcpu);
kvm_vcpu_exiting_guest_mode(vcpu);
else
kvm_make_request(KVM_REQ_EVENT, vcpu);
}
} else { } else {
max_irr = kvm_lapic_find_highest_irr(vcpu); max_irr = kvm_lapic_find_highest_irr(vcpu);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册