From 89bbc449623026b957a67d2037c74d0fabc054fc Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Thu, 30 Sep 2021 11:47:21 -0700 Subject: [PATCH] hv: inject external interrupts only if LAPIC is not passthru Tracked-On: #6289 Signed-off-by: Zide Chen Acked-by: Eddie Dong --- hypervisor/arch/x86/guest/virq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/guest/virq.c b/hypervisor/arch/x86/guest/virq.c index 9b51e4579..2b8388729 100644 --- a/hypervisor/arch/x86/guest/virq.c +++ b/hypervisor/arch/x86/guest/virq.c @@ -444,7 +444,7 @@ int32_t acrn_handle_pending_request(struct acrn_vcpu *vcpu) * Defer injection of interrupt to be after MTF VM exit, * when emulating the split-lock. */ - if (!vcpu->arch.emulating_lock) { + if (!is_lapic_pt_enabled(vcpu) && !vcpu->arch.emulating_lock) { acrn_inject_pending_intr(vcpu, pending_req_bits, injected); } @@ -461,7 +461,7 @@ int32_t acrn_handle_pending_request(struct acrn_vcpu *vcpu) * an ExtInt or there is lapic interrupt and virtual interrupt * deliver is disabled. */ - if (!arch->irq_window_enabled) { + if (!is_lapic_pt_enabled(vcpu) && !arch->irq_window_enabled) { /* * TODO: Currently, NMI exiting and virtual NMIs are not enabled, * so use interrupt window to inject NMI.