]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: fix sending PV IPI
authorLi RongQing <lirongqing@baidu.com>
Wed, 9 Mar 2022 08:35:44 +0000 (16:35 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 2 Apr 2022 09:37:27 +0000 (05:37 -0400)
commit5d556552114b0b8820e5a20d95819db3998d4934
tree01f20370844c03faa0d6d7e5b5975ed11e453143
parent82d73de7ff8d8eb0010eb024774d5b11f6a06f5c
KVM: x86: fix sending PV IPI

If apic_id is less than min, and (max - apic_id) is greater than
KVM_IPI_CLUSTER_SIZE, then the third check condition is satisfied but
the new apic_id does not fit the bitmask.  In this case __send_ipi_mask
should send the IPI.

This is mostly theoretical, but it can happen if the apic_ids on three
iterations of the loop are for example 1, KVM_IPI_CLUSTER_SIZE, 0.

Fixes: 189dfa9f93d ("KVM: X86: Implement PV IPIs in linux guest")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Message-Id: <1646814944-51801-1-git-send-email-lirongqing@baidu.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvm.c