public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Alex Williamson <alex.williamson@redhat.com>,
	"richard.peng@oppo.com" <richard.peng@oppo.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function
Date: Mon, 20 May 2019 14:48:56 +1000	[thread overview]
Message-ID: <b0ccc2f8-4d6a-bfa4-509d-e5d919efb3cd@ozlabs.ru> (raw)
In-Reply-To: <20190516084833.757140bc@x1.home>



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

      reply	other threads:[~2019-05-20  4:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0ccc2f8-4d6a-bfa4-509d-e5d919efb3cd@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.peng@oppo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox