Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1468258ybl; Sat, 10 Aug 2019 04:16:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvIKPuPpPXrjAwz/go+oBtbuzPO+R/89NL587JQnr2ywfBTTvEoxaKOUfu54BBoeyLlJcD X-Received: by 2002:a63:a346:: with SMTP id v6mr21639378pgn.57.1565435763126; Sat, 10 Aug 2019 04:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565435763; cv=none; d=google.com; s=arc-20160816; b=mNU5IxmdDhsGBwI3lIT7jkrn3GRPmdxWcNSScwsEf+SK2h3pEIqw0yHNFBYh3uxwtc FhOiej8ka5NQgbXRhIeC1wvcLPZGhTrCpZxe05Bv+JNlE0UpEv276gJqiVKk78tze6JP Cx6HU6Yr4LBP+qWmVdYd7hb/pYlXveON55iChkQpeSH43hh57/R7K7Kb9iko/sjBSm14 6uYvZBh+1EPtsL+KNElQRMsTUMwqBZF/f0MwMkiFljrCUfZytAcWy9DbdTwTkmYqZR/a yRlctQgXpWAl4Y1298Hmyfvj5eLw2GOXbJmGEFtXfzctMehznknMw7J8+xQzh6CLJIRE HF3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9PgkYtV/DVfBRc6+ic8I0RA2JUBuXEG/Xsv/SYYN+qM=; b=jkr0pDnV/h4rbnBR/iegf6Qv9/Hx2yOOKvZj3FxIpZ3oZavIEk93vWTHhpWXH15LFZ MIWkOgn/e/Xbq2UV2J/rqzEHuAY/8spFkrhs5TRP6/8WRVU/teolSOdTpPaVkAY/r5NK vVTEkAV6OP9b7P44AO/0zsxfQy5pkmasPtMcKc+q7EmhmakiOI2UE/9+2M8ZYHqTZteT 4/MwH8MWfg6HiL+rw13zZwtiV+T0x/g5WJpa4Mfb59MdeeflZYvtgeSe8TMcSp+IeevH DOYk+VUvbbm1lNK6lVqBDKrQXmOS5fs0EZLnQfmNQbbOPXYY1x8oGcijdA7wusWH2lL0 BKcQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si22739594pgc.503.2019.08.10.04.15.47; Sat, 10 Aug 2019 04:16:03 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726223AbfHJLNN (ORCPT + 99 others); Sat, 10 Aug 2019 07:13:13 -0400 Received: from verein.lst.de ([213.95.11.211]:33898 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbfHJLNM (ORCPT ); Sat, 10 Aug 2019 07:13:12 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 2801368BFE; Sat, 10 Aug 2019 13:13:09 +0200 (CEST) Date: Sat, 10 Aug 2019 13:13:08 +0200 From: Christoph Hellwig To: Ralph Campbell Cc: Christoph Hellwig , linux-mm@kvack.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, Jason Gunthorpe , =?iso-8859-1?B?Suly9G1l?= Glisse , Ben Skeggs Subject: Re: [PATCH] nouveau/hmm: map pages after migration Message-ID: <20190810111308.GB26349@lst.de> References: <20190807150214.3629-1-rcampbell@nvidia.com> <20190808070701.GC29382@lst.de> <0b96a8d8-86b5-3ce0-db95-669963c1f8a7@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b96a8d8-86b5-3ce0-db95-669963c1f8a7@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 08, 2019 at 02:29:34PM -0700, Ralph Campbell wrote: >>> { >>> struct nouveau_fence *fence; >>> unsigned long addr = args->start, nr_dma = 0, i; >>> for (i = 0; addr < args->end; i++) { >>> args->dst[i] = nouveau_dmem_migrate_copy_one(drm, args->vma, >>> - addr, args->src[i], &dma_addrs[nr_dma]); >>> + args->src[i], &dma_addrs[nr_dma], &pfns[i]); >> >> Nit: I find the &pfns[i] way to pass the argument a little weird to read. >> Why not "pfns + i"? > > OK, will do in v2. > Should I convert to "dma_addrs + nr_dma" too? I'll fix it up for v3 of the migrate_vma series. This is a leftover from passing an args structure. On something vaguely related to this patch: You use the NVIF_VMM_PFNMAP_V0_V* defines from nvif/if000c.h, which are a little odd as we only ever set these bits, but they also don't seem to appear to be in values that are directly fed to the hardware. On the other hand mmu/vmm.h defines a set of NVIF_VMM_PFNMAP_V0_* constants with similar names and identical values, and those are used in mmu/vmmgp100.c and what appears to finally do the low-level dma mapping and talking to the hardware. Are these two sets of constants supposed to be the same? Are the actual hardware values or just a driver internal interface?