]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: fix sending PV IPI
authorLi RongQing <lirongqing@baidu.com>
Wed, 9 Mar 2022 08:35:44 +0000 (16:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:47 +0000 (14:06 +0200)
commitde3af9b26d34c6dfb3affca80f4e8a927cac5411
tree33199d947282a1a285c35a041ff0c1dd7c04d3a9
parent2ec90e21f1c0cd2b71014c96474e003b029c457f
KVM: x86: fix sending PV IPI

commit c15e0ae42c8e5a61e9aca8aac920517cf7b3e94e 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: aaffcfd1e82 ("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>
arch/x86/kernel/kvm.c