From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B90EC433B4 for ; Tue, 27 Apr 2021 19:43:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E00A861026 for ; Tue, 27 Apr 2021 19:43:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E00A861026 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 686CC6B0036; Tue, 27 Apr 2021 15:43:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 637B36B006E; Tue, 27 Apr 2021 15:43:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B1126B0070; Tue, 27 Apr 2021 15:43:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 28B316B0036 for ; Tue, 27 Apr 2021 15:43:41 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3AA055923C0A for ; Tue, 27 Apr 2021 19:43:40 +0000 (UTC) X-FDA: 78079171800.35.E330BBE Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by imf17.hostedemail.com (Postfix) with ESMTP id 1152F40002C1 for ; Tue, 27 Apr 2021 19:43:35 +0000 (UTC) Received: by mail-qv1-f47.google.com with SMTP id d1so18045173qvy.11 for ; Tue, 27 Apr 2021 12:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pMOFBLR9bPrFoZFV8TQo6qdI8xIDUT5QowoTJPAfwoI=; b=M20T+1aMae4u0P7fbin4a8R02TMD5t96H2aiOMf8qw2rTRAo2RugFe0ku6l9VPeevP xZtgBQRLaSsu9aYFKNdNDSiFe3aolwh10xjABQqThOUIndi0+s4d+Eo1XLPCXC3nfxUm lD1alvOMjEL0+ef6cYE7iSz2VLoq5w2e7VmYnhskgoJag9ZejVAXw548Sw3tJzTwQ1LK Hq28R0ucjVcFeEwJijDgtLouLoL1kPblKx+vhiQSapRdIiXAHGIAof9xt+quTVbA5Swo WJ9Cx6H5u7fywz1Osz6ow6XWlpeS1lNkpzj+0hZhr2dKqs99inl2pJxQ1Z2SVZi0WDJl pNzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pMOFBLR9bPrFoZFV8TQo6qdI8xIDUT5QowoTJPAfwoI=; b=XAPDsfcAjLAbeNjLstj382Qb67f229nmdBw9PIspA7fmiII9D0dYZmkfekk1tJ3Stm WU5jw20V13khOHgLrNBY2Uxbub1uJB9r0LSapSFDaO8BIXzg3FVEECunmp352NCJq4IY s6ysAqnK79ZMwbTQJRV0gCREnWecHImPGYK3qP4587iZSxbqtStAA0CbmEazUimOllN9 pSUqouzCO/9bojroRAKF7P6YXd6Z+E6UGbJE0tpgeE3MY7hvQH3EDU1E1YetkdNy8knJ E2dEwUA3gR+G/IE6R9m3J3PWKr9vvNj8LjVonaQqo+fouV+pNKWQQpIJWACM7yMiEXmL 2hEA== X-Gm-Message-State: AOAM5305xqwDdoxWoUzNmt5qKeFV8KR8hUidaAZtgfEiZl0Ig9cfYa3l 0f0oyi26e38qahcCVUfW9VtOug== X-Google-Smtp-Source: ABdhPJzaHrq9X7iYnbBeG48woUZiUTHE+b/d9aEc9zMuai3hrX463cNK4Akxfstc2Wbz1Cy4s9UnAQ== X-Received: by 2002:a0c:e8c4:: with SMTP id m4mr2551153qvo.21.1619552619024; Tue, 27 Apr 2021 12:43:39 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id y26sm688104qtf.66.2021.04.27.12.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 12:43:38 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lbTcP-00Dh5j-HM; Tue, 27 Apr 2021 16:43:37 -0300 Date: Tue, 27 Apr 2021 16:43:37 -0300 From: Jason Gunthorpe To: Logan 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 , Christian =?utf-8?B?S8O2bmln?= , 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 Subject: Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA pages in dma-iommu map_sg Message-ID: <20210427194337.GT2047089@ziepe.ca> References: <20210408170123.8788-1-logang@deltatee.com> <20210408170123.8788-12-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210408170123.8788-12-logang@deltatee.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1152F40002C1 X-Stat-Signature: 58kaosbzthtzdnhhbbsu9znp9bq5fbih Received-SPF: none (ziepe.ca>: No applicable sender policy available) receiver=imf17; identity=mailfrom; envelope-from=""; helo=mail-qv1-f47.google.com; client-ip=209.85.219.47 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619552615-616950 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Is it OK like this because the other logic prohibits all PCI cases that would lean on the IOMMU, like ATS, hairpinning through the root port, or transiting the root complex? If yes, the code deserves a big comment explaining this is incomplete, and I'd want to know we can finish this to include ATS at least based on this series. Jason