[GIT PULL] KVM: Generic changes for 6.13

From: Sean Christopherson
Date: Tue Nov 12 2024 - 15:55:21 EST


Please pull two changes that coincidentally happen to be related to vcpu->pid.

The following changes since commit 5cb1659f412041e4780f2e8ee49b2e03728a2ba6:

Merge branch 'kvm-no-struct-page' into HEAD (2024-10-25 13:38:16 -0400)

are available in the Git repository at:

https://github.com/kvm-x86/linux.git tags/kvm-x86-generic-6.13

for you to fetch changes up to 3e7f43188ee227bcf0f07f60a00f1fd1aca10e6a:

KVM: Protect vCPU's "last run PID" with rwlock, not RCU (2024-10-30 14:41:22 -0700)

----------------------------------------------------------------
KVM generic changes for 6.13

- Rework kvm_vcpu_on_spin() to use a single for-loop instead of making two
partial poasses over "all" vCPUs. Opportunistically expand the comment
to better explain the motivation and logic.

- Protect vcpu->pid accesses outside of vcpu->mutex with a rwlock instead
of RCU, so that running a vCPU on a different task doesn't encounter
long stalls due to having to wait for all CPUs become quiescent.

----------------------------------------------------------------
Sean Christopherson (3):
KVM: Rework core loop of kvm_vcpu_on_spin() to use a single for-loop
KVM: Return '0' directly when there's no task to yield to
KVM: Protect vCPU's "last run PID" with rwlock, not RCU

arch/arm64/include/asm/kvm_host.h | 2 +-
include/linux/kvm_host.h | 3 +-
virt/kvm/kvm_main.c | 143 ++++++++++++++++++++++----------------
3 files changed, 86 insertions(+), 62 deletions(-)