Skip to content

Commit dc91f2e

Browse files
Haozhong Zhangrkrcmar
authored andcommitted
KVM: VMX: do not change SN bit in vmx_update_pi_irte()
In kvm_vcpu_trigger_posted_interrupt() and pi_pre_block(), KVM assumes that PI notification events should not be suppressed when the target vCPU is not blocked. vmx_update_pi_irte() sets the SN field before changing an interrupt from posting to remapping, but it does not check the vCPU mode. Therefore, the change of SN field may break above the assumption. Besides, I don't see reasons to suppress notification events here, so remove the changes of SN field to avoid race condition. Signed-off-by: Haozhong Zhang <[email protected]> Reported-by: "Ramamurthy, Venkatesh" <[email protected]> Reported-by: Dan Williams <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Fixes: 28b835d ("KVM: Update Posted-Interrupts Descriptor when vCPU is preempted") Signed-off-by: Radim Krčmář <[email protected]>
1 parent d650014 commit dc91f2e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

arch/x86/kvm/vmx.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11911,12 +11911,8 @@ static int vmx_update_pi_irte(struct kvm *kvm, unsigned int host_irq,
1191111911

1191211912
if (set)
1191311913
ret = irq_set_vcpu_affinity(host_irq, &vcpu_info);
11914-
else {
11915-
/* suppress notification event before unposting */
11916-
pi_set_sn(vcpu_to_pi_desc(vcpu));
11914+
else
1191711915
ret = irq_set_vcpu_affinity(host_irq, NULL);
11918-
pi_clear_sn(vcpu_to_pi_desc(vcpu));
11919-
}
1192011916

1192111917
if (ret < 0) {
1192211918
printk(KERN_INFO "%s: failed to update PI IRTE\n",

0 commit comments

Comments
 (0)