diff options
author | 2024-10-09 08:04:52 -0700 | |
---|---|---|
committer | 2024-12-16 14:37:30 -0800 | |
commit | 6e2b2358b3ef870d24109083d2e314d04fc72de4 (patch) | |
tree | 98c689e4e3c33fbc70e36db603e23c487dd63408 /scripts/gdb/linux/utils.py | |
parent | KVM: Verify there's at least one online vCPU when iterating over all vCPUs (diff) | |
download | wireguard-linux-6e2b2358b3ef870d24109083d2e314d04fc72de4.tar.xz wireguard-linux-6e2b2358b3ef870d24109083d2e314d04fc72de4.zip |
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 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions