Skip to contentSkip to conversation

KVM: x86: Don't sending posted interrupt if not config CONFIG_SMP

PATCH New Yang Zhang 1 participant 1 message Apr 18, 2013

Subsystems (4)
lore
Share & tools
lore

Yang Zhang

author
#0 lore raw

PATCH 1/1 KVM: x86: Don't sending posted interrupt if not config CONFIG_SMP

From: Yang Zhang <[email protected]>

If not config smp, posted interrupt logic will not work. So we should not send posted interrupt and let vcpu to pick the pending interrupt before vmentry.

Without this patch, the build fails when CONFIG_SMP is disabled. Thanks Randy to report this issue.

---
 arch/x86/kvm/vmx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kvm/vmx.c +2 -0
index 52b21da..d5c6b95 100644
@@ -3946,10 +3946,12 @@ static void vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
 
 	r = pi_test_and_set_on(&vmx->pi_desc);
 	kvm_make_request(KVM_REQ_EVENT, vcpu);
+#ifdef CONFIG_SMP
 	if (!r && (vcpu->mode == IN_GUEST_MODE))
 		apic->send_IPI_mask(get_cpu_mask(vcpu->cpu),
 				POSTED_INTR_VECTOR);
 	else
+#endif
 		kvm_vcpu_kick(vcpu);
 }
 
Signature · 1 line
1.7.1