Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp715751yba; Thu, 16 May 2019 07:51:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXdEyob7rivHupvy0C0GCb8qypoyb8aq7FeHEMJgmxzTrBesWjbRYktvSZWNj/i4dku0/K X-Received: by 2002:a65:5c82:: with SMTP id a2mr51272371pgt.378.1558018292154; Thu, 16 May 2019 07:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558018292; cv=none; d=google.com; s=arc-20160816; b=Qj0Xx5ZUqTUsThi/vEG+U0sTAIJnRPBwHFx1n26D7vvvmcN1XHfV1X4txKBkrMsx1U 225xlLBmNklp0p866LhqH7SRLFpZjiAvT32y9U0/x17MzxooMz6kxxjcgfXw5bK6ec7z yWt1JlKoedvxqG9/VdG5OsJG1P+qlz9mA2vCKzKM69dTiWWJa0YaIZ66uEcuWlcAAq2G DUt8z2Y7hWyVgIKt1m8RLzhK6CZx3/TAooYgge8aDKUDLmUAynIuOL5TlpeB/ySHcmtQ JAxfcMpACt6xMoieP2hSUXykP3wEf3eSOou7DT5/oJJFvlWceQtpMiYjMdcWEmupV+Ph TyoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Lny9v23GhKP6Dw+u+TsF+kOtilvDz1IvwG9VAkfj7Kw=; b=TmI/1rjM1sm5jgqDpSLgn9zwxZGI6jr443HappG0xK8UsYQU3LqiUU/D4bAY1L/VN3 /FB2JOzgApbAhHxQunppIBoZolHjNlxV0PrdDtofX29YaD2LoJQxuYraktaxX1GaWUR6 w4Rh791HkpAUnfaFoSzwJZn6NJJ/X9PrWdWhi0TbeB7zWb9jR9EAwC2Z355PjfJaO/fn Zs05FEEcMeJio0W65TB0gNEAufr7vdLEL1OdxL/iHaX4+lpBQOszwUL4KA+orzyiiCaI DJj611eFCPBFAf/CpIHHgVZ0sSjiDX9pWzd3Z/GpS94mTr9t8PJpkBv6KWigQfujBKxx qXRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e34si5269377pge.252.2019.05.16.07.51.16; Thu, 16 May 2019 07:51:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727229AbfEPOsl convert rfc822-to-8bit (ORCPT + 99 others); Thu, 16 May 2019 10:48:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43402 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbfEPOsl (ORCPT ); Thu, 16 May 2019 10:48:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 626148F039; Thu, 16 May 2019 14:48:36 +0000 (UTC) Received: from x1.home (ovpn-117-92.phx2.redhat.com [10.3.117.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75BBD5D6A9; Thu, 16 May 2019 14:48:34 +0000 (UTC) Date: Thu, 16 May 2019 08:48:33 -0600 From: Alex Williamson To: "richard.peng@oppo.com" Cc: linux-kernel , Alexey Kardashevskiy , "kvm@vger.kernel.org" Subject: Re: [PATCH] vfio: vfio_pci_nvlink2: use a vma helper function Message-ID: <20190516084833.757140bc@x1.home> In-Reply-To: <2019051620382477288130@oppo.com> References: <2019051620382477288130@oppo.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 16 May 2019 14:48:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Cc Alexey + kvm] On Thu, 16 May 2019 20:38:26 +0800 "richard.peng@oppo.com" wrote: > Use a vma helper function to simply code. > > Signed-off-by: Peng Hao > --- >  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