* Re: [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function
[not found] <2019051620382477288130@oppo.com>
@ 2019-05-16 14:48 ` Alex Williamson
2019-05-20 4:48 ` Alexey Kardashevskiy
2019-07-02 18:00 ` Alex Williamson
1 sibling, 1 reply; 3+ messages in thread
From: Alex Williamson @ 2019-05-16 14:48 UTC (permalink / raw)
To: richard.peng; +Cc: linux-kernel, Alexey Kardashevskiy, kvm
[Cc Alexey + kvm]
On Thu, 16 May 2019 20:38:26 +0800
"richard.peng@oppo.com" <richard.peng@oppo.com> wrote:
> Use a vma helper function to simply code.
>
> Signed-off-by: Peng Hao <richard.peng@oppo.com>
> ---
> drivers/vfio/pci/vfio_pci_nvlink2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci_nvlink2.c b/drivers/vfio/pci/vfio_pci_nvlink2.c
> index 32f695ffe128..dc42aa0e47f6 100644
> --- a/drivers/vfio/pci/vfio_pci_nvlink2.c
> +++ b/drivers/vfio/pci/vfio_pci_nvlink2.c
> @@ -161,8 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vfio_pci_device *vdev,
>
> atomic_inc(&data->mm->mm_count);
> ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
> - (vma->vm_end - vma->vm_start) >> PAGE_SHIFT,
> - data->gpu_hpa, &data->mem);
> + vma_pages(vma), data->gpu_hpa, &data->mem);
>
> trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr,
> vma->vm_end - vma->vm_start, ret);
> --
> 2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function
2019-05-16 14:48 ` [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function Alex Williamson
@ 2019-05-20 4:48 ` Alexey Kardashevskiy
0 siblings, 0 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2019-05-20 4:48 UTC (permalink / raw)
To: Alex Williamson, richard.peng; +Cc: linux-kernel, kvm
On 17/05/2019 00:48, Alex Williamson wrote:
> [Cc Alexey + kvm]
>
> On Thu, 16 May 2019 20:38:26 +0800
> "richard.peng@oppo.com" <richard.peng@oppo.com> wrote:
>
>> Use a vma helper function to simply code.
>>
>> Signed-off-by: Peng Hao <richard.peng@oppo.com>
>> ---
>> drivers/vfio/pci/vfio_pci_nvlink2.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/vfio/pci/vfio_pci_nvlink2.c b/drivers/vfio/pci/vfio_pci_nvlink2.c
>> index 32f695ffe128..dc42aa0e47f6 100644
>> --- a/drivers/vfio/pci/vfio_pci_nvlink2.c
>> +++ b/drivers/vfio/pci/vfio_pci_nvlink2.c
>> @@ -161,8 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vfio_pci_device *vdev,
>>
>> atomic_inc(&data->mm->mm_count);
>> ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
>> - (vma->vm_end - vma->vm_start) >> PAGE_SHIFT,
>> - data->gpu_hpa, &data->mem);
>> + vma_pages(vma), data->gpu_hpa, &data->mem);
I did not realize we have been having this mighty helper since 2005 :)
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>
>> trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr,
>> vma->vm_end - vma->vm_start, ret);
>> --
>> 2.20.1
--
Alexey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function
[not found] <2019051620382477288130@oppo.com>
2019-05-16 14:48 ` [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function Alex Williamson
@ 2019-07-02 18:00 ` Alex Williamson
1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2019-07-02 18:00 UTC (permalink / raw)
To: richard.peng; +Cc: linux-kernel
On Thu, 16 May 2019 20:38:26 +0800
"richard.peng@oppo.com" <richard.peng@oppo.com> wrote:
> Use a vma helper function to simply code.
>
> Signed-off-by: Peng Hao <richard.peng@oppo.com>
> ---
> drivers/vfio/pci/vfio_pci_nvlink2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci_nvlink2.c b/drivers/vfio/pci/vfio_pci_nvlink2.c
> index 32f695ffe128..dc42aa0e47f6 100644
> --- a/drivers/vfio/pci/vfio_pci_nvlink2.c
> +++ b/drivers/vfio/pci/vfio_pci_nvlink2.c
> @@ -161,8 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vfio_pci_device *vdev,
>
> atomic_inc(&data->mm->mm_count);
> ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
> - (vma->vm_end - vma->vm_start) >> PAGE_SHIFT,
> - data->gpu_hpa, &data->mem);
> + vma_pages(vma), data->gpu_hpa, &data->mem);
>
> trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr,
> vma->vm_end - vma->vm_start, ret);
> --
> 2.20.1
Applied to vfio next branch for 5.3 with Alexey's R-b. Thanks!
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-02 18:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <2019051620382477288130@oppo.com>
2019-05-16 14:48 ` [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function Alex Williamson
2019-05-20 4:48 ` Alexey Kardashevskiy
2019-07-02 18:00 ` Alex Williamson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.