diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-06-23 20:05:14 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 07:33:02 +0200 |
commit | 894a9c5543abf6f88d36dc1b9f5d90f35db09cb3 (patch) | |
tree | 3fff94c380904dfef66ec7182c4dae59d7c85763 /virt | |
parent | KVM: Prepare memslot data structures for multiple hugepage sizes (diff) | |
download | linux-894a9c5543abf6f88d36dc1b9f5d90f35db09cb3.tar.xz linux-894a9c5543abf6f88d36dc1b9f5d90f35db09cb3.zip |
KVM: x86: missing locking in PIT/IRQCHIP/SET_BSP_CPU ioctl paths
Correct missing locking in a few places in x86's vm_ioctl handling path.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8361662e7e0a..f1e2e8c373c6 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2274,10 +2274,12 @@ static long kvm_vm_ioctl(struct file *filp, #ifdef CONFIG_KVM_APIC_ARCHITECTURE case KVM_SET_BOOT_CPU_ID: r = 0; + mutex_lock(&kvm->lock); if (atomic_read(&kvm->online_vcpus) != 0) r = -EBUSY; else kvm->bsp_vcpu_id = arg; + mutex_unlock(&kvm->lock); break; #endif default: |