File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2487,8 +2487,8 @@ long kvm_arch_vm_ioctl(struct file *filp,
2487
2487
case KVM_S390_PV_COMMAND : {
2488
2488
struct kvm_pv_cmd args ;
2489
2489
2490
- /* protvirt means user sigp */
2491
- kvm -> arch . user_cpu_state_ctrl = 1 ;
2490
+ /* protvirt means user cpu state */
2491
+ kvm_s390_set_user_cpu_state_ctrl ( kvm ) ;
2492
2492
r = 0 ;
2493
2493
if (!is_prot_virt_host ()) {
2494
2494
r = - EINVAL ;
@@ -3802,7 +3802,7 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
3802
3802
vcpu_load (vcpu );
3803
3803
3804
3804
/* user space knows about this interface - let it control the state */
3805
- vcpu -> kvm -> arch . user_cpu_state_ctrl = 1 ;
3805
+ kvm_s390_set_user_cpu_state_ctrl ( vcpu -> kvm ) ;
3806
3806
3807
3807
switch (mp_state -> mp_state ) {
3808
3808
case KVM_MP_STATE_STOPPED :
Original file line number Diff line number Diff line change @@ -208,6 +208,15 @@ static inline int kvm_s390_user_cpu_state_ctrl(struct kvm *kvm)
208
208
return kvm -> arch .user_cpu_state_ctrl != 0 ;
209
209
}
210
210
211
+ static inline void kvm_s390_set_user_cpu_state_ctrl (struct kvm * kvm )
212
+ {
213
+ if (kvm -> arch .user_cpu_state_ctrl )
214
+ return ;
215
+
216
+ VM_EVENT (kvm , 3 , "%s" , "ENABLE: Userspace CPU state control" );
217
+ kvm -> arch .user_cpu_state_ctrl = 1 ;
218
+ }
219
+
211
220
/* implemented in pv.c */
212
221
int kvm_s390_pv_destroy_cpu (struct kvm_vcpu * vcpu , u16 * rc , u16 * rrc );
213
222
int kvm_s390_pv_create_cpu (struct kvm_vcpu * vcpu , u16 * rc , u16 * rrc );
You can’t perform that action at this time.
0 commit comments