aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorSean Christopherson <[email protected]>2024-08-02 20:21:21 +0000
committerSean Christopherson <[email protected]>2024-10-30 21:27:51 +0000
commit7e513617da71b1c0b6497cda1ddfc86a7c4d1765 (patch)
treee52f78c58760062416e86145b86e2852afca1c69 /rust/helpers/helpers.c
parentMerge branch 'kvm-no-struct-page' into HEAD (diff)
downloadkernel-7e513617da71b1c0b6497cda1ddfc86a7c4d1765.tar.gz
kernel-7e513617da71b1c0b6497cda1ddfc86a7c4d1765.zip
KVM: Rework core loop of kvm_vcpu_on_spin() to use a single for-loop
Rework kvm_vcpu_on_spin() to use a single for-loop instead of making "two" passes over all vCPUs. Given N=kvm->last_boosted_vcpu, the logic is to iterate from vCPU[N+1]..vcpu[N-1], i.e. using two loops is just a kludgy way of handling the wrap from the last vCPU to vCPU0 when a boostable vCPU isn't found in vcpu[N+1]..vcpu[MAX]. Open code the xa_load() instead of using kvm_get_vcpu() to avoid reading online_vcpus in every loop, as well as the accompanying smp_rmb(), i.e. make it a custom kvm_for_each_vcpu(), for all intents and purposes. Oppurtunistically clean up the comment explaining the logic. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions