Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4919120pxy; Tue, 27 Apr 2021 16:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXue+4cbByL+OuKRqGlzFw+2bzbO5Y/+yBtcwLhJ+EtuWC7IEll/vZHL0shdsodSWlYlh0 X-Received: by 2002:a50:ee88:: with SMTP id f8mr7018881edr.176.1619564486203; Tue, 27 Apr 2021 16:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619564486; cv=none; d=google.com; s=arc-20160816; b=TwpfcYsG4Y6oigMR86nWJp8vHjOJ7UdEvnPE82ZFk6WrV+IKsAls1FCKgMFFYq2sgz 6GO7zh1skpGXqPfuypVPICz/bFaN6dCeG9ojQHBqIemV+8VXsjsfHbBQLtCWwpofjAT+ ReuWtDRvHvONSblffKNsc8JIfsYZBZywnn0blvNrTHUvc36VWm4L5wDeuLNmksseLj5J cVRIj2OlYKOjwxjBFpWVWTt8B6cufkQSDLB5yS0yJT5KAh18cejiJHz+0PxzUNZKg60d wTEkYrePNx5DUNJhJLbju3ifPqzoNUbNGXqFNr2DgpDhQfvg74J1MWHXcPnZmtQBGXWz IuLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=yfDJcXRXLcFqUpWKFnDEug6ObcuKDigbRQxLqk4fhDY=; b=viLv0ma7auWzqzGZKgl5zZbDtcEig3Hn/902zTW9vwSz38XnyGWLlcEhPyVgrcRUXT v1CStWcJWyBZ17TQW7X32Uu/dF0L/NW1Pv3T+EaGNXHe8KEnfoHFUsqmcs6p8Jq+a/7Q lAYCt69F79uttMrLmp16sBBE+Ejt7Us3S0zzLbpPxlL4lHBND+m0n+MZs+QSm2xw181r oRVCxAGyna9WZbvdn4zeC635SDZVvPl/TM4Btj4h+Cu3wNnO1vsq3LJWBRI8f9srP+0e 0stFFntk/PjaXS8f8fiQT+/i9dtX4BK0qjA3yNLsBGOupvHmk/eJI8Qs4NJKVYnn+GKH DZVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=sbQMyumP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si3794032edi.582.2021.04.27.16.01.02; Tue, 27 Apr 2021 16:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=sbQMyumP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239138AbhD0XAd (ORCPT + 99 others); Tue, 27 Apr 2021 19:00:33 -0400 Received: from ale.deltatee.com ([204.191.154.188]:42800 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235382AbhD0XAd (ORCPT ); Tue, 27 Apr 2021 19:00:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:content-disposition; bh=yfDJcXRXLcFqUpWKFnDEug6ObcuKDigbRQxLqk4fhDY=; b=sbQMyumPhi9BO3PW7BbH7jx3Mv vyQd71v56wBfsn24nwtkY+oIQgX3d3l1Ef2xR/D7FmPPejRkZzxHW3lZYylXqntM3wayVT8xUbSON pRu0g92wUrYkY4mSSqIOYl5nF3ZdzT0niosmL6qBWRsJuD7/K/AvnuHQmjnHK7oloxX99WCDjqOI0 cg5+SNiz8HchO6MM165oba4v51OTzr/KDIokovNCY/DFWZ7sMQFW03g7hYFCoWTz3ocn/dosmVMEZ sGBSFJDc2fGekrXGh7GNV2q3EeYZREtOFpzZ4vfUtHADST8VMXbeGXWLL0y5KZxGTJ2ejJzeaB2up 1+e2wlfw==; Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.92) (envelope-from ) id 1lbWg7-0002nw-DI; Tue, 27 Apr 2021 16:59:40 -0600 To: Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Christoph Hellwig , Dan Williams , =?UTF-8?Q?Christian_K=c3=b6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Jakowski Andrzej , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy References: <20210408170123.8788-1-logang@deltatee.com> <20210408170123.8788-12-logang@deltatee.com> <20210427194337.GT2047089@ziepe.ca> From: Logan Gunthorpe Message-ID: <4e2537b1-21f3-f726-07bb-91d086e6d124@deltatee.com> Date: Tue, 27 Apr 2021 16:59:38 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210427194337.GT2047089@ziepe.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: robin.murphy@arm.com, ira.weiny@intel.com, helgaas@kernel.org, jianxin.xiong@intel.com, dave.hansen@linux.intel.com, jason@jlekstrand.net, dave.b.minturn@intel.com, andrzej.jakowski@intel.com, daniel.vetter@ffwll.ch, willy@infradead.org, ddutile@redhat.com, jhubbard@nvidia.com, christian.koenig@amd.com, dan.j.williams@intel.com, hch@lst.de, sbates@raithlin.com, iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, jgg@ziepe.ca X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA pages in dma-iommu map_sg X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-04-27 1:43 p.m., Jason Gunthorpe wrote: > On Thu, Apr 08, 2021 at 11:01:18AM -0600, Logan Gunthorpe wrote: >> When a PCI P2PDMA page is seen, set the IOVA length of the segment >> to zero so that it is not mapped into the IOVA. Then, in finalise_sg(), >> apply the appropriate bus address to the segment. The IOVA is not >> created if the scatterlist only consists of P2PDMA pages. > > I expect P2P to work with systems that use ATS, so we'd want to see > those systems have the IOMMU programmed with the bus address. Oh, the paragraph you quote isn't quite as clear as it could be. The bus address is only used in specific circumstances depending on how the P2PDMA core code figures the addresses should be mapped (see the documentation for (upstream_bridge_distance()). The P2PDMA code currently doesn't have any provisions for ATS (I haven't had access to any such hardware) but I'm sure it wouldn't be too hard to add. Logan