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, 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=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 5D56FC433C1 for ; Wed, 31 Mar 2021 04:56:43 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 D160E6187E for ; Wed, 31 Mar 2021 04:56:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D160E6187E 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 smtp4.osuosl.org (Postfix) with ESMTP id 8964C405E9; Wed, 31 Mar 2021 04:56:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.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 LaNqVt3sVbvP; Wed, 31 Mar 2021 04:56:41 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTP id 45D88405ED; Wed, 31 Mar 2021 04:56:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2D68EC000B; Wed, 31 Mar 2021 04:56:41 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id D6268C000A for ; Wed, 31 Mar 2021 04:56:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BD06B608A3 for ; Wed, 31 Mar 2021 04:56:39 +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 YB-ZK7qM4o-H for ; Wed, 31 Mar 2021 04:56:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0084060899 for ; Wed, 31 Mar 2021 04:56:38 +0000 (UTC) IronPort-SDR: GTji9C2tt0JXGYMamzdoo3qpkbw3G4iAOYkhmGLcyvJOZ4k10mxRDVVqu3nNXk1PlQ3Z7eyNdt NAnPh3IprH3g== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="192019732" X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="192019732" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 21:56:37 -0700 IronPort-SDR: uLcKWl+OPmimChUHu2iDn9E6spXPUzdArHCR11+AXenDQM1J0zi4SS4Z00CB2ZoGfnjh0bEYvQ Hwn3fIaK712A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="438607873" Received: from allen-box.sh.intel.com (HELO [10.239.159.128]) ([10.239.159.128]) by fmsmga004.fm.intel.com with ESMTP; 30 Mar 2021 21:56:35 -0700 Subject: Re: [RFC PATCH 2/5] iommu: Add an unmap_pages() op for IOMMU drivers To: "Isaac J. Manjarres" , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org References: <20210331030042.13348-1-isaacm@codeaurora.org> <20210331030042.13348-3-isaacm@codeaurora.org> From: Lu Baolu Message-ID: Date: Wed, 31 Mar 2021 12:47:15 +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: <20210331030042.13348-3-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 3/31/21 11:00 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 unmap a virtually contiguous > range of pages of the same size. > > For IOMMU drivers that do not specify an unmap_pages() callback, > the existing logic of unmapping memory one page block at a time > will be used. > > Signed-off-by: Isaac J. Manjarres > Suggested-by: Will Deacon > --- > include/linux/iommu.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 5e7fe519430a..9cf81242581a 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -193,6 +193,7 @@ struct iommu_iotlb_gather { > * @detach_dev: detach device from an iommu domain > * @map: map a physically contiguous memory region 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 > * @iotlb_sync_map: Sync mappings created recently using @map to the hardware > * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush > @@ -245,6 +246,9 @@ struct iommu_ops { > phys_addr_t paddr, size_t size, int prot, gfp_t gfp); > 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, > + size_t pgsize, size_t pgcount, > + struct iommu_iotlb_gather *iotlb_gather); Is it possible to add an equivalent map_pages() callback? > void (*flush_iotlb_all)(struct iommu_domain *domain); > void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova, > size_t size); > 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 563AEC433C1 for ; Wed, 31 Mar 2021 04:58:50 +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 E79BF61969 for ; Wed, 31 Mar 2021 04:58:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E79BF61969 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=xaoDuLvNJx5NcwlSswn2RAv6BVi5eYmzYORdXuXqaJM=; b=lkUlYoghaKeYUjp5YhKGv2q4Z BcD2VIVXjHYN/+EkkA0xdENRWXTVuWjiBLR+Qh2sOiDHO/DnHU9fDA0kAp/Mty9+2Pl48K027Ju+T t5uDY94BoXFNzQVIjK31Xc1LglMKWI7A83n99JHZ2GFo5OM9ufywtzAkhA+AmbraTscG1679PyL/v 8DpNY+vTWuNaFX8PGDh8ije1mJ6FoA4f2IpMtbzQ/db5o7X/nNklmwICKWxKcNzrmN/aBiQRU0GsZ g0Ei71DrbGMYe0BBw+uQxC4/PlolBY/R9XOhUegzZ1sVpQvVYQ13ptkxhTyIz1skxjt76AYUlEoAj NXn4hEtDQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRSuN-005VCD-Tk; Wed, 31 Mar 2021 04:56:48 +0000 Received: from mga02.intel.com ([134.134.136.20]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRSuI-005VBe-P0 for linux-arm-kernel@lists.infradead.org; Wed, 31 Mar 2021 04:56:44 +0000 IronPort-SDR: zYRVBapDxMhlwg+MbVbGvV8q5KDW3+IQ79jNjt6GJyml6EjsvijPotRRxlbDm7eJIcNpklzBZ9 FxBPmBczJGHA== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="179046876" X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="179046876" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 21:56:37 -0700 IronPort-SDR: uLcKWl+OPmimChUHu2iDn9E6spXPUzdArHCR11+AXenDQM1J0zi4SS4Z00CB2ZoGfnjh0bEYvQ Hwn3fIaK712A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="438607873" Received: from allen-box.sh.intel.com (HELO [10.239.159.128]) ([10.239.159.128]) by fmsmga004.fm.intel.com with ESMTP; 30 Mar 2021 21:56:35 -0700 Cc: baolu.lu@linux.intel.com, will@kernel.org, robin.murphy@arm.com, pratikp@codeaurora.org Subject: Re: [RFC PATCH 2/5] iommu: Add an unmap_pages() op for IOMMU drivers To: "Isaac J. Manjarres" , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org References: <20210331030042.13348-1-isaacm@codeaurora.org> <20210331030042.13348-3-isaacm@codeaurora.org> From: Lu Baolu Message-ID: Date: Wed, 31 Mar 2021 12:47:15 +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: <20210331030042.13348-3-isaacm@codeaurora.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210331_055643_178881_66F21649 X-CRM114-Status: GOOD ( 24.51 ) 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 3/31/21 11:00 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 unmap a virtually contiguous > range of pages of the same size. > > For IOMMU drivers that do not specify an unmap_pages() callback, > the existing logic of unmapping memory one page block at a time > will be used. > > Signed-off-by: Isaac J. Manjarres > Suggested-by: Will Deacon > --- > include/linux/iommu.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 5e7fe519430a..9cf81242581a 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -193,6 +193,7 @@ struct iommu_iotlb_gather { > * @detach_dev: detach device from an iommu domain > * @map: map a physically contiguous memory region 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 > * @iotlb_sync_map: Sync mappings created recently using @map to the hardware > * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush > @@ -245,6 +246,9 @@ struct iommu_ops { > phys_addr_t paddr, size_t size, int prot, gfp_t gfp); > 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, > + size_t pgsize, size_t pgcount, > + struct iommu_iotlb_gather *iotlb_gather); Is it possible to add an equivalent map_pages() callback? > void (*flush_iotlb_all)(struct iommu_domain *domain); > void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova, > size_t size); > Best regards, baolu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel