mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
This commit is contained in:
parent
ec04b2604c
commit
894a9c5543
3 changed files with 14 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue