]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Yield to IPI target vCPU only if it is busy
authorLi RongQing <lirongqing@baidu.com>
Wed, 9 Feb 2022 04:16:41 +0000 (12:16 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Feb 2022 15:09:35 +0000 (10:09 -0500)
commit91f7112b28460e614e9b736430257e83c9fc85a4
tree2a4774cb8baa1220cfa5fb9859105abdce1a930e
parent8d6c599d462c4da5d971be70ee5377fe68879b2b
KVM: x86: Yield to IPI target vCPU only if it is busy

When sending a call-function IPI-many to vCPUs, yield to the
IPI target vCPU which is marked as preempted.

but when emulating HLT, an idling vCPU will be voluntarily
scheduled out and mark as preempted from the guest kernel
perspective. yielding to idle vCPU is pointless and increase
unnecessary vmexit, maybe miss the true preempted vCPU

so yield to IPI target vCPU only if vCPU is busy and preempted

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Message-Id: <1644380201-29423-1-git-send-email-lirongqing@baidu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvm.c