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=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_RED,USER_AGENT_SANE_1 autolearn=ham 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 0CD6AC433ED for ; Tue, 6 Apr 2021 11:58:17 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6C07611AF for ; Tue, 6 Apr 2021 11:58:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6C07611AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8B78160664; Tue, 6 Apr 2021 11:58:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cw2mBHJc7biQ; Tue, 6 Apr 2021 11:58:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id 7CEA46062E; Tue, 6 Apr 2021 11:58:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5BD03C000B; Tue, 6 Apr 2021 11:58:15 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2187AC000A for ; Tue, 6 Apr 2021 11:58:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 0E980402D7 for ; Tue, 6 Apr 2021 11:58:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kUlvyz0rV068 for ; Tue, 6 Apr 2021 11:58:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp4.osuosl.org (Postfix) with ESMTPS id 47C80401D0 for ; Tue, 6 Apr 2021 11:58:13 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id A1D6061019; Tue, 6 Apr 2021 11:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617710292; bh=x1kNZt9arPO+gkS4yLBAeurwV80dRJyxHFz/hfkha+8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Np72cHPqUv7pxv4nJ1w/sPDpMm1G+4QBjDmqYktQkhWFO/FcxBCyNFHkZOIebQA7G +KUn2/gaYlO+1Ksaz/wPXYFrtgd592O72g/+JKKlkSkIsYId8yTdP9KG1NLNsEd1c0 dWw4egO5XPcFjh0am0w2sac/45vW8a+qqAB9DwbryBkKD5FwRMskiR7exZlXGLlDO7 cr2nY7rFjuqSBCSctE5fqD7HMHkYi+hsossA3UisY6p/kU8OxUPgr7EMIBHkfMAgJQ 1WI559QyLq8rdbn+2+ZkHoBnJJYF/RWKPn03q1hi/9qB48CYRl1Wii28MaJ2hBK36s rkTWXIisQEK9g== Date: Tue, 6 Apr 2021 12:58:08 +0100 From: Will Deacon To: "Isaac J. Manjarres" Subject: Re: [RFC PATCH v3 04/12] iommu: Add a map_pages() op for IOMMU drivers Message-ID: <20210406115808.GE13747@willie-the-truck> References: <20210405191112.28192-1-isaacm@codeaurora.org> <20210405191112.28192-5-isaacm@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210405191112.28192-5-isaacm@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: pratikp@codeaurora.org, iommu@lists.linux-foundation.org, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, Apr 05, 2021 at 12:11:04PM -0700, Isaac J. Manjarres wrote: > Add a callback for IOMMU drivers to provide a path for the > IOMMU framework to call into an IOMMU driver, which can > call into the io-pgtable code, to map a physically contiguous > rnage of pages of the same size. > > For IOMMU drivers that do not specify a map_pages() callback, > the existing logic of mapping memory one page block at a time > will be used. > > Signed-off-by: Isaac J. Manjarres > Suggested-by: Will Deacon > --- > include/linux/iommu.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 9cf81242581a..528d6a58479e 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -192,6 +192,8 @@ struct iommu_iotlb_gather { > * @attach_dev: attach device to an iommu domain > * @detach_dev: detach device from an iommu domain > * @map: map a physically contiguous memory region to an iommu domain > + * @map_pages: map a physically contiguous set of pages of the same size to > + * an iommu domain. > * @unmap: unmap a physically contiguous memory region from an iommu domain > * @unmap_pages: unmap a number of pages of the same size from an iommu domain > * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain > @@ -244,6 +246,9 @@ struct iommu_ops { > void (*detach_dev)(struct iommu_domain *domain, struct device *dev); > int (*map)(struct iommu_domain *domain, unsigned long iova, > phys_addr_t paddr, size_t size, int prot, gfp_t gfp); > + int (*map_pages)(struct iommu_domain *domain, unsigned long iova, > + phys_addr_t paddr, size_t pgsize, size_t pgcount, > + int prot, gfp_t gfp, size_t *mapped); (same comment as for the io-pgtable callback). Will _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 B29D6C433ED for ; Tue, 6 Apr 2021 12:00:28 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F256461019 for ; Tue, 6 Apr 2021 12:00:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F256461019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1XA2Q22nybiXlulD1EZImLyTmRtTVnGix2CLP/YZEGY=; b=HKW4eDaYWayla9rZRnXSpRzQv dnGlKgu7bMT2v6SpkuvH6+UDPAByJBqQj04XKEFTLAifAO6QW8rsuVWGK8f3fW6sIJZEpovF2gfXq WWp9xxdUbazemgyJR5zNOIkTSAyVZQ6IITX3IjIzF0H3fWKmy972VhRu+/o17dRn/mwEWRQSSe3Zz lrovI/oeu4isSZdJxPtDSs/oSuV+AKHxIurOv3PwfxoFFGdSk8HIgKYIACA9UzoA6dXIXFVBtdh3V S9CP80D4AZDxE+RbNNxDJgw/OLRioH1EpYjpeOJGMnV16hx5OiTqeoJCXTsKgtPL73YPYy+e2MpS7 sAXEwaP0A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lTkLz-002TZz-0o; Tue, 06 Apr 2021 11:58:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lTkLW-002TT8-J6 for linux-arm-kernel@lists.infradead.org; Tue, 06 Apr 2021 11:58:32 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A1D6061019; Tue, 6 Apr 2021 11:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617710292; bh=x1kNZt9arPO+gkS4yLBAeurwV80dRJyxHFz/hfkha+8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Np72cHPqUv7pxv4nJ1w/sPDpMm1G+4QBjDmqYktQkhWFO/FcxBCyNFHkZOIebQA7G +KUn2/gaYlO+1Ksaz/wPXYFrtgd592O72g/+JKKlkSkIsYId8yTdP9KG1NLNsEd1c0 dWw4egO5XPcFjh0am0w2sac/45vW8a+qqAB9DwbryBkKD5FwRMskiR7exZlXGLlDO7 cr2nY7rFjuqSBCSctE5fqD7HMHkYi+hsossA3UisY6p/kU8OxUPgr7EMIBHkfMAgJQ 1WI559QyLq8rdbn+2+ZkHoBnJJYF/RWKPn03q1hi/9qB48CYRl1Wii28MaJ2hBK36s rkTWXIisQEK9g== Date: Tue, 6 Apr 2021 12:58:08 +0100 From: Will Deacon To: "Isaac J. Manjarres" Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, robin.murphy@arm.com, pratikp@codeaurora.org, baolu.lu@linux.intel.com Subject: Re: [RFC PATCH v3 04/12] iommu: Add a map_pages() op for IOMMU drivers Message-ID: <20210406115808.GE13747@willie-the-truck> References: <20210405191112.28192-1-isaacm@codeaurora.org> <20210405191112.28192-5-isaacm@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210405191112.28192-5-isaacm@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210406_125815_531709_44D859D0 X-CRM114-Status: GOOD ( 18.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 05, 2021 at 12:11:04PM -0700, Isaac J. Manjarres wrote: > Add a callback for IOMMU drivers to provide a path for the > IOMMU framework to call into an IOMMU driver, which can > call into the io-pgtable code, to map a physically contiguous > rnage of pages of the same size. > > For IOMMU drivers that do not specify a map_pages() callback, > the existing logic of mapping memory one page block at a time > will be used. > > Signed-off-by: Isaac J. Manjarres > Suggested-by: Will Deacon > --- > include/linux/iommu.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 9cf81242581a..528d6a58479e 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -192,6 +192,8 @@ struct iommu_iotlb_gather { > * @attach_dev: attach device to an iommu domain > * @detach_dev: detach device from an iommu domain > * @map: map a physically contiguous memory region to an iommu domain > + * @map_pages: map a physically contiguous set of pages of the same size to > + * an iommu domain. > * @unmap: unmap a physically contiguous memory region from an iommu domain > * @unmap_pages: unmap a number of pages of the same size from an iommu domain > * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain > @@ -244,6 +246,9 @@ struct iommu_ops { > void (*detach_dev)(struct iommu_domain *domain, struct device *dev); > int (*map)(struct iommu_domain *domain, unsigned long iova, > phys_addr_t paddr, size_t size, int prot, gfp_t gfp); > + int (*map_pages)(struct iommu_domain *domain, unsigned long iova, > + phys_addr_t paddr, size_t pgsize, size_t pgcount, > + int prot, gfp_t gfp, size_t *mapped); (same comment as for the io-pgtable callback). Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel