Skip to content

Commit

Permalink
KVM: VMX: Don't unblock vCPU w/ Posted IRQ if IRQs are disabled in guest
Browse files Browse the repository at this point in the history
[ Upstream commit 1831fa4 ]

Don't configure the wakeup handler when a vCPU is blocking with IRQs
disabled, in which case any IRQ, posted or otherwise, should not be
recognized and thus should not wake the vCPU.

Fixes: bf9f6ac ("KVM: Update Posted-Interrupts Descriptor when vCPU is blocked")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009021236.4122790-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
bonzini authored and gregkh committed Mar 8, 2022
1 parent f303196 commit b63190d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/vmx/posted_intr.c
Expand Up @@ -147,7 +147,8 @@ int pi_pre_block(struct kvm_vcpu *vcpu)
struct pi_desc old, new;
struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu);

if (!vmx_can_use_vtd_pi(vcpu->kvm))
if (!vmx_can_use_vtd_pi(vcpu->kvm) ||
vmx_interrupt_blocked(vcpu))
return 0;

WARN_ON(irqs_disabled());
Expand Down

0 comments on commit b63190d

Please sign in to comment.