Re: [PATCH v7 12/12] KVM: s390: Add huge page enablement control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  /*
>   * For now we handle at most 16 double words as this is what the s390 base
> @@ -475,6 +479,11 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>  	case KVM_CAP_S390_AIS_MIGRATION:
>  		r = 1;
>  		break;
> +	case KVM_CAP_S390_HPAGE_1M:
> +		r = 0;
> +		if (hpage)
> +			r = 1;

I guess checking for EDAT1 does not make any sense as there will not be
hugetlbfs available for user space.

[...]
> +		mutex_unlock(&kvm->lock);
> +		VM_EVENT(kvm, 3, "ENABLE: CAP_S390_HPAGE %s",
> +			 r ? "(not available)" : "(success)");
> +		break;
>  	case KVM_CAP_S390_USER_STSI:
>  		VM_EVENT(kvm, 3, "%s", "ENABLE: CAP_S390_USER_STSI");
>  		kvm->arch.user_stsi = 1;
> @@ -728,7 +758,11 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att
>  		ret = -EBUSY;

-> this ret initialization is now stale

>  		VM_EVENT(kvm, 3, "%s", "ENABLE: CMMA support");
>  		mutex_lock(&kvm->lock);
> -		if (!kvm->created_vcpus) {
> +		if (kvm->created_vcpus)
> +			ret = -EBUSY;
> +		else if (kvm->mm->context.allow_gmap_hpage_1m)
> +			ret = -EINVAL;

I think you should also update the documentation of

KVM_S390_VM_MEM_ENABLE_CMMA

> +		else {
>  			kvm->arch.use_cmma = 1;
>  			/* Not compatible with cmma. */
>  			kvm->arch.use_pfmfi = 0;
> @@ -4093,6 +4127,11 @@ static int __init kvm_s390_init(void)
>  		return -ENODEV;
>  	}
>  
> +	if (nested && hpage) {
> +		pr_info("nested (vSIE) and hpage (huge page backing) can currently not be activated concurrently");
> +		return -EINVAL;
> +	}
> +

Apart from that, looks good to me

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

-- 

Thanks,

David / dhildenb



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux