File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -7670,6 +7670,7 @@ branch to guests' 0x200 interrupt vector.
7670
7670
:Architectures: x86
7671
7671
:Parameters: args[0] defines which exits are disabled
7672
7672
:Returns: 0 on success, -EINVAL when args[0] contains invalid exits
7673
+ or if any vCPUs have already been created
7673
7674
7674
7675
Valid bits in args[0] are::
7675
7676
Original file line number Diff line number Diff line change @@ -6531,6 +6531,10 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
6531
6531
if (cap -> args [0 ] & ~KVM_X86_DISABLE_VALID_EXITS )
6532
6532
break ;
6533
6533
6534
+ mutex_lock (& kvm -> lock );
6535
+ if (kvm -> created_vcpus )
6536
+ goto disable_exits_unlock ;
6537
+
6534
6538
if (cap -> args [0 ] & KVM_X86_DISABLE_EXITS_PAUSE )
6535
6539
kvm -> arch .pause_in_guest = true;
6536
6540
@@ -6552,6 +6556,8 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
6552
6556
}
6553
6557
6554
6558
r = 0 ;
6559
+ disable_exits_unlock :
6560
+ mutex_unlock (& kvm -> lock );
6555
6561
break ;
6556
6562
case KVM_CAP_MSR_PLATFORM_INFO :
6557
6563
kvm -> arch .guest_can_read_msr_platform_info = cap -> args [0 ];
You can’t perform that action at this time.
0 commit comments