Commit c3489155 authored by Dominik Dingel's avatar Dominik Dingel Committed by Christian Borntraeger

KVM: s390: only reset CMMA state if it was enabled before

There is no point in resetting the CMMA state if it was never enabled.
Signed-off-by: default avatarDominik Dingel <dingel@linux.vnet.ibm.com>
Reviewed-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent e6db1d61
...@@ -344,6 +344,10 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att ...@@ -344,6 +344,10 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att
mutex_unlock(&kvm->lock); mutex_unlock(&kvm->lock);
break; break;
case KVM_S390_VM_MEM_CLR_CMMA: case KVM_S390_VM_MEM_CLR_CMMA:
ret = -EINVAL;
if (!kvm->arch.use_cmma)
break;
mutex_lock(&kvm->lock); mutex_lock(&kvm->lock);
idx = srcu_read_lock(&kvm->srcu); idx = srcu_read_lock(&kvm->srcu);
s390_reset_cmma(kvm->arch.gmap->mm); s390_reset_cmma(kvm->arch.gmap->mm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment