Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1524083

Re: [PATCH v14 10/22] vfio iommu type1: Add support for mediated devices

From Kirti Wankhede <kwankhede@nvidia.com>
Newsgroups linux.kernel
Subject Re: [PATCH v14 10/22] vfio iommu type1: Add support for mediated devices
Date 2016-11-17 05:50 +0100
Message-ID <sEmO5-4fO-1@gated-at.bofh.it> (permalink)
References <sEfjz-7Ip-3@gated-at.bofh.it> <sEfjz-7Ip-13@gated-at.bofh.it> <sEihw-1a8-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 11/17/2016 5:27 AM, Alex Williamson wrote:
> On Thu, 17 Nov 2016 02:16:22 +0530
> Kirti Wankhede <kwankhede@nvidia.com> wrote:
>> @@ -931,6 +1344,24 @@ static void vfio_iommu_type1_detach_group(void *iommu_data,
>>  
>>  	mutex_lock(&iommu->lock);
>>  
>> +	if (iommu->external_domain) {
>> +		group = find_iommu_group(iommu->external_domain, iommu_group);
>> +		if (group) {
>> +			list_del(&group->next);
>> +			kfree(group);
>> +
>> +			if (list_empty(&iommu->external_domain->group_list)) {
>> +				vfio_sanity_check_pfn_list(iommu);
>> +
>> +				if (!IS_IOMMU_CAP_DOMAIN_IN_CONTAINER(iommu))
>> +					vfio_iommu_unmap_unpin_all(iommu);
>> +
>> +				kfree(iommu->external_domain);
> 
> I advised in one place that I didn't understand why  we were checking
> iommu->external_domain before walking the pfn_list, but we do have
> several checks still in place for if(iommu->external_domain), so I
> think we better be setting to NULL after we free it.
> 
> I haven't finished my review yet, but if this ends up being the only
> comment and you agree, I can add:
> 
> iommu->external_domain = NULL;
> 
> here on commit.  Thanks,
> 

Thanks Alex.

I'm updating this patch and 11/22 as per your comment here and  on 11/22.

Thanks,
Kirti

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v14 10/22] vfio iommu type1: Add support for mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-11-16 21:50 +0100
  Re: [PATCH v14 10/22] vfio iommu type1: Add support for mediated  devices Alex Williamson <alex.williamson@redhat.com> - 2016-11-17 01:00 +0100
    Re: [PATCH v14 10/22] vfio iommu type1: Add support for mediated  devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-11-17 05:50 +0100
  Re: [PATCH v14 10/22] vfio iommu type1: Add support for mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-11-17 06:00 +0100

csiph-web