Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6772995ybi; Wed, 29 May 2019 12:56:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwx8PfDsLK44ueGaOdd1Asr1qyA7S1GmJWPLXKbeiN9BYoXUHH/WG+iznAVdiwpxtnx//yc X-Received: by 2002:a63:fc61:: with SMTP id r33mr33532669pgk.294.1559159785861; Wed, 29 May 2019 12:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559159785; cv=none; d=google.com; s=arc-20160816; b=KTKyoOrBvCZZN8ZboMQmZtGXT+vYU7M0tr6Sdhkg+xRST6kFwmd4/F52SzfLArIuup GciHCVWZgZhm0DcCae9fQL0VVcBXkK9jyLowjhs0PdnccV3/EnPYkIgBKO2gXsqBXhRM vGy3VbX5sjzKbsj6+1ZLpR98sfA3PNF5cudZTx8pASwm7rYHC1wwuHROPa5UNClDRzCO xBZHwMKir6f48H+jvkh/Wcie2OY4ocNjvQSh8SKB7f8HXVF/cDIcg4XwLvP7GQvVERIM JaNn27zsWjuokoh1ctNt3cbcBWXkKdf/SjNdFWaNkLO/mkg9yDSJn32dP2QUiXyhZyQL d8kA== 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=SMhOaQVJGdjzbHlDX3zKMYl/One5piXToPhlIlkHJFE=; b=ubazDJoy1v7YEl7Cs1Nf+nsSVMRzGkDlgqd0DY9bUHIkm1FnQcmn2waQLkvGUhJdZI cm7DpdQtCH7PP/yMoqezU42wvGLaIR8UyuMDsKiIr7oxAhVUvjrET5NA/gzIgWtfyxTO u5N8CtwnhpMyOu6x5fKqvuqiSEPOYCo8Np1iWulA5efMjX7OYLJXAPZwSyOX677c4bIA tJ3tAg8/PBiWanFUF0LS9A7Aq2s3yFCx2jaRZsJxlSshipXSS3RMPbliNn4ZIHfefRgo G8k20XLYbHi/+lKCHqgvGGR4zp1HtHO/JNOQXzKahQAifcTEpyhNOKa0pvSjJNhotZME epBQ== 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 u42si849341pjb.31.2019.05.29.12.56.09; Wed, 29 May 2019 12:56:25 -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 S1726225AbfE2Ty7 (ORCPT + 99 others); Wed, 29 May 2019 15:54:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfE2Ty7 (ORCPT ); Wed, 29 May 2019 15:54:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E228DC004BEE; Wed, 29 May 2019 19:54:58 +0000 (UTC) Received: from x1.home (ovpn-116-22.phx2.redhat.com [10.3.116.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id A27E05C5DF; Wed, 29 May 2019 19:54:57 +0000 (UTC) Date: Wed, 29 May 2019 13:54:56 -0600 From: Alex Williamson To: "Thomas Meyer" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: Message-ID: <20190529135456.5a2e3973@x1.home> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 29 May 2019 19:54:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 26 May 2019 13:44:04 +0200 "Thomas Meyer" wrote: > From thomas@m3y3r.de Sun May 26 00:13:26 2019 > Subject: [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit > computation > To: alex.williamson@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org > Content-Type: text/plain; charset="UTF-8" > Mime-Version: 1.0 > Content-Transfer-Encoding: 8bit > X-Patch: Cocci > X-Mailer: DiffSplit > Message-ID: <1558822461341-1674464153-1-diffsplit-thomas@m3y3r.de> > References: <1558822461331-726613767-0-diffsplit-thomas@m3y3r.de> > In-Reply-To: <1558822461331-726613767-0-diffsplit-thomas@m3y3r.de> > X-Serial-No: 1 > > Use vma_pages function on vma object instead of explicit computation. > > Signed-off-by: Thomas Meyer > --- > > diff -u -p a/drivers/vfio/pci/vfio_pci_nvlink2.c b/drivers/vfio/pci/vfio_pci_nvlink2.c > --- a/drivers/vfio/pci/vfio_pci_nvlink2.c > +++ b/drivers/vfio/pci/vfio_pci_nvlink2.c > @@ -161,7 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vf > > atomic_inc(&data->mm->mm_count); > ret = (int) mm_iommu_newdev(data->mm, data->useraddr, > - (vma->vm_end - vma->vm_start) >> PAGE_SHIFT, > + vma_pages(vma), > data->gpu_hpa, &data->mem); > > trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr, Besides the formatting of this patch, there's already a pending patch with this same change: https://lkml.org/lkml/2019/5/16/658 I think the original must have bounced from lkml due the encoding, but I'll use that one since it came first, is slightly cleaner in wrapping the line following the change, and already has Alexey's R-b. Thanks, Alex