diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-06-23 15:05:14 -0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 08:33:02 +0300 |
commit | 894a9c5543abf6f88d36dc1b9f5d90f35db09cb3 (patch) | |
tree | 3fff94c380904dfef66ec7182c4dae59d7c85763 /virt | |
parent | ec04b2604c3707a46db1d26d98f82b11d0844669 (diff) | |
download | lwn-894a9c5543abf6f88d36dc1b9f5d90f35db09cb3.tar.gz lwn-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: |