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.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,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 91131C433ED for ; Tue, 6 Apr 2021 01:58:54 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 32A7A613C9 for ; Tue, 6 Apr 2021 01:58:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32A7A613C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id F3A5B40285; Tue, 6 Apr 2021 01:58:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PfCv0NXK1hxx; Tue, 6 Apr 2021 01:58:53 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTP id DC40140468; Tue, 6 Apr 2021 01:58:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BBE17C000C; Tue, 6 Apr 2021 01:58:52 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id D2FC3C000A for ; Tue, 6 Apr 2021 01:58:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CF12C848D1 for ; Tue, 6 Apr 2021 01:58:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ry5Atzd82B3f for ; Tue, 6 Apr 2021 01:58:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3B033848CB for ; Tue, 6 Apr 2021 01:58:50 +0000 (UTC) IronPort-SDR: QgvIt0/iYAH3RYmjGgy684lizDKE+mfCwouK9kX7ywHPwjgABd/iwBf7Bm5orr7eQwUkxrNeCe qoFfWpbDaagQ== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="173036602" X-IronPort-AV: E=Sophos;i="5.81,308,1610438400"; d="scan'208";a="173036602" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2021 18:58:49 -0700 IronPort-SDR: oeHHwjqaRE4ijc8v3/NGtbZ+kGMCPTJWIwtdM6chvFOhB4FVs0CXGp2Obv85gDW9K8VSyOCGga 4LPvtVtU69vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,308,1610438400"; d="scan'208";a="440728272" Received: from allen-box.sh.intel.com (HELO [10.239.159.128]) ([10.239.159.128]) by fmsmga004.fm.intel.com with ESMTP; 05 Apr 2021 18:58:48 -0700 Subject: Re: [RFC PATCH v3 04/12] iommu: Add a map_pages() op for IOMMU drivers To: "Isaac J. Manjarres" , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org References: <20210405191112.28192-1-isaacm@codeaurora.org> <20210405191112.28192-5-isaacm@codeaurora.org> From: Lu Baolu Message-ID: Date: Tue, 6 Apr 2021 09:49:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210405191112.28192-5-isaacm@codeaurora.org> Content-Language: en-US Cc: robin.murphy@arm.com, will@kernel.org, pratikp@codeaurora.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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 4/6/21 3:11 AM, 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); > size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, > size_t size, struct iommu_iotlb_gather *iotlb_gather); > size_t (*unmap_pages)(struct iommu_domain *domain, unsigned long iova, > This looks good to me. Acked-by: Lu Baolu Best regards, baolu _______________________________________________ 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.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 E14E4C433B4 for ; Tue, 6 Apr 2021 02:00:35 +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 795856113E for ; Tue, 6 Apr 2021 02:00:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 795856113E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Cc:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lkhDIIhfEMUidHQpsBtnvh9719wn/aOI5LcdgQa6LFE=; b=DhCquZORCnwK+frB+zO6g5+MO Q4g27vDzcpf9xQkbMTExWxrs64fxbt5fOQYnTHSMswGG1ELyj38wtQq0463swlkJvP5fHJV4qj+zN /fOvL6I1ycpfv96NauXPH+HTShSvZ0fXqyCp3IBLeGnuQByO6XcC/yp5MPZu5KrnmwTtBQD13uhWp FGkFa5cuXoKK0g/5VxKJlxWmcXlHRaPDn4BCc2mpjkIubiKoGV7m7geDB1MsDXa3Npo4Xg21MJncV AVbym+cxYN5H/JbeeL9CoBZFd0XtXlmvsJfR8mFlpN93vOzEZXO4d7tg6F407JU6X+UhBnZyQQI3l YCiUW8xQQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lTazc-001DYp-Bp; Tue, 06 Apr 2021 01:59:00 +0000 Received: from mga11.intel.com ([192.55.52.93]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lTazT-001DY8-Fw for linux-arm-kernel@lists.infradead.org; Tue, 06 Apr 2021 01:58:53 +0000 IronPort-SDR: mWgH71m5HaA3qaOB1ax+rL//GL7wc4RpIZFWnUMptfnvexRiKr8+4owYg0AtkeCB4QSOXHQRSQ D8MaYIhcsAlA== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="189746026" X-IronPort-AV: E=Sophos;i="5.81,308,1610438400"; d="scan'208";a="189746026" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2021 18:58:49 -0700 IronPort-SDR: oeHHwjqaRE4ijc8v3/NGtbZ+kGMCPTJWIwtdM6chvFOhB4FVs0CXGp2Obv85gDW9K8VSyOCGga 4LPvtVtU69vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,308,1610438400"; d="scan'208";a="440728272" Received: from allen-box.sh.intel.com (HELO [10.239.159.128]) ([10.239.159.128]) by fmsmga004.fm.intel.com with ESMTP; 05 Apr 2021 18:58:48 -0700 Cc: baolu.lu@linux.intel.com, will@kernel.org, robin.murphy@arm.com, pratikp@codeaurora.org Subject: Re: [RFC PATCH v3 04/12] iommu: Add a map_pages() op for IOMMU drivers To: "Isaac J. Manjarres" , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org References: <20210405191112.28192-1-isaacm@codeaurora.org> <20210405191112.28192-5-isaacm@codeaurora.org> From: Lu Baolu Message-ID: Date: Tue, 6 Apr 2021 09:49:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210405191112.28192-5-isaacm@codeaurora.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210406_025851_906823_61F6470C X-CRM114-Status: GOOD ( 23.61 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 4/6/21 3:11 AM, 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); > size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, > size_t size, struct iommu_iotlb_gather *iotlb_gather); > size_t (*unmap_pages)(struct iommu_domain *domain, unsigned long iova, > This looks good to me. Acked-by: Lu Baolu Best regards, baolu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel