diff options
author | Sean Christopherson <seanjc@google.com> | 2024-10-09 18:04:52 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-12-17 01:37:30 +0300 |
commit | 6e2b2358b3ef870d24109083d2e314d04fc72de4 (patch) | |
tree | 98c689e4e3c33fbc70e36db603e23c487dd63408 /tools/perf/scripts/python/parallel-perf.py | |
parent | 0664dc74e9d004c36b4400081811df795169809a (diff) | |
download | linux-6e2b2358b3ef870d24109083d2e314d04fc72de4.tar.xz |
KVM: Grab vcpu->mutex across installing the vCPU's fd and bumping online_vcpus
During vCPU creation, acquire vcpu->mutex prior to exposing the vCPU to
userspace, and hold the mutex until online_vcpus is bumped, i.e. until the
vCPU is fully online from KVM's perspective.
To ensure asynchronous vCPU ioctls also wait for the vCPU to come online,
explicitly check online_vcpus at the start of kvm_vcpu_ioctl(), and take
the vCPU's mutex to wait if necessary (having to wait for any ioctl should
be exceedingly rare, i.e. not worth optimizing).
Reported-by: Will Deacon <will@kernel.org>
Reported-by: Michal Luczaj <mhal@rbox.co>
Link: https://lore.kernel.org/all/20240730155646.1687-1-will@kernel.org
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20241009150455.1057573-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions