Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -344,6 +344,10 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att
		mutex_unlock(&kvm->lock);
		break;
	case KVM_S390_VM_MEM_CLR_CMMA:
		ret = -EINVAL;
		if (!kvm->arch.use_cmma)
			break;

		mutex_lock(&kvm->lock);
		idx = srcu_read_lock(&kvm->srcu);
		s390_reset_cmma(kvm->arch.gmap->mm);