diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-06-23 14:05:14 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 01:33:02 -0400 |
commit | 894a9c5543abf6f88d36dc1b9f5d90f35db09cb3 (patch) | |
tree | 3fff94c380904dfef66ec7182c4dae59d7c85763 /virt | |
parent | ec04b2604c3707a46db1d26d98f82b11d0844669 (diff) |
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, | |||
2274 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | 2274 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE |
2275 | case KVM_SET_BOOT_CPU_ID: | 2275 | case KVM_SET_BOOT_CPU_ID: |
2276 | r = 0; | 2276 | r = 0; |
2277 | mutex_lock(&kvm->lock); | ||
2277 | if (atomic_read(&kvm->online_vcpus) != 0) | 2278 | if (atomic_read(&kvm->online_vcpus) != 0) |
2278 | r = -EBUSY; | 2279 | r = -EBUSY; |
2279 | else | 2280 | else |
2280 | kvm->bsp_vcpu_id = arg; | 2281 | kvm->bsp_vcpu_id = arg; |
2282 | mutex_unlock(&kvm->lock); | ||
2281 | break; | 2283 | break; |
2282 | #endif | 2284 | #endif |
2283 | default: | 2285 | default: |