RE: [PATCH v8 3/6] vfio iommu: Add support for mediated devices

Tian, Kevin
2016-10-14T12:29:37Z

> From: Kirti Wankhede [mailto:kwankhede@nvidia.com]
> Sent: Friday, October 14, 2016 7:36 PM
>
>
> On 10/12/2016 4:01 PM, Tian, Kevin wrote:
> >> From: Kirti Wankhede [mailto:kwankhede@nvidia.com]
> >> Sent: Tuesday, October 11, 2016 4:29 AM
> >>
> > [...]
> >> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> >> index 2ba19424e4a1..ce6d6dcbd9a8 100644
> >> --- a/drivers/vfio/vfio_iommu_type1.c
> >> +++ b/drivers/vfio/vfio_iommu_type1.c
> >> @@ -55,18 +55,26 @@ MODULE_PARM_DESC(disable_hugepages,
> >>
> >> struct vfio_iommu {
> >> struct list_head domain_list;
> >> + struct vfio_domain *local_domain;
> >
> > Hi, Kirti, can you help explain the meaning of 'local" here? I have a hard time
> > to understand its intention... In your later change of vaddr_get_pfn, it's
> > even more confusing where get_user_pages_remote is used on a 'local_mm':
> >
>
> 'local' in local_domain is to describe that the domain for local page
> tracking. 'local_mm' in vaddr_get_pfn() is local variable in
> vaddr_get_pfn() function.
> struct mm_struct *local_mm = (mm ? mm : current->mm);
>

'local page tracking' means track logic local to VFIO? Then when we say
'remote page tracking', who is remote? I would appreciate some code
comment to describe this definition, otherwise it's easily confusing when
'local' sometimes means who does page tracking, while other times
it just means a local variable. At least when I read this patch, the
immediate impression is that local_mm belongs to local_domain. :-)

Thanks
Kevin