Skip to content

VM: Fix a benign race in kicking vCPUs

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: Clean up benign vcpu->cpu data races when kicking vCPUsvirt/kvm/kvm_main.c+28 -81 reply
2/2KVM: Guard cpusmask NULL check with CONFIG_CPUMASK_OFFSTACKvirt/kvm/kvm_main.c+10 -24 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchVitaly Kuznetsov
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] VM: Fix a benign race in kicking vCPUs

Fix benign races when kicking vCPUs where the task doing the kicking can consume a stale vcpu->cpu. The races are benign because of the impliciations of task migration with respect to interrupts and being in guest mode, but IMO they're worth fixing if only as an excuse to document the flows.

Patch 2 is a tangentially related cleanup to prevent future me from trying to get rid of the NULL check on the cpumask parameters, which _looks_ like it can't ever be NULL, but has a subtle edge case due to the way CONFIG_CPUMASK_OFFSTACK=y handles cpumasks.

Sean Christopherson (2):
KVM: Clean up benign vcpu->cpu data races when kicking vCPUs
KVM: Guard cpusmask NULL check with CONFIG_CPUMASK_OFFSTACK

 virt/kvm/kvm_main.c | 46 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 9 deletions(-)
Signature · 1 line
2.33.0.rc2.250.ged5fa647cd-goog