mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
KVM: x86: fix sending PV IPI
commitc15e0ae42c
upstream. 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:aaffcfd1e8
("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
43637ee170
commit
63961ac135
1 changed files with 1 additions and 1 deletions
|
@ -510,7 +510,7 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector)
|
||||||
} else if (apic_id < min && max - apic_id < KVM_IPI_CLUSTER_SIZE) {
|
} else if (apic_id < min && max - apic_id < KVM_IPI_CLUSTER_SIZE) {
|
||||||
ipi_bitmap <<= min - apic_id;
|
ipi_bitmap <<= min - apic_id;
|
||||||
min = apic_id;
|
min = apic_id;
|
||||||
} else if (apic_id < min + KVM_IPI_CLUSTER_SIZE) {
|
} else if (apic_id > min && apic_id < min + KVM_IPI_CLUSTER_SIZE) {
|
||||||
max = apic_id < max ? max : apic_id;
|
max = apic_id < max ? max : apic_id;
|
||||||
} else {
|
} else {
|
||||||
ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
|
ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
|
||||||
|
|
Loading…
Reference in a new issue