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 3E123C433ED for ; Tue, 6 Apr 2021 02:00:18 +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 C7F226113E for ; Tue, 6 Apr 2021 02:00:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7F226113E 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=2udlLVzrvesO6HHENLXjVGCXvIsLr9gLM1oROxloEtc=; b=L8+rplrciLzc01ZqZ9iCucZl9 1B9ZqHaqRY3LmzWEcEiCYSDXJhy5pCaeput2T2dZh1G1FMZP4ajz8YxfxzbUxwHMnsKCdPUhJQTOr xh+42YM81G06KoZEjgAW7xCyKEZIua67TK3eeLmXkWOLJ+g8cXtLW0RxiS3j/iHyMLGIOzR0UWOKW PKgAjQX1vWpC+SL/dP9diV6/E29X5hgelFEDKK0EzIC4zZR/geITagOG4sjtNj0HKDrm12JWr5py4 rslyez2+h6yXFg4H//p7LGBWbvKjSE5354ipepEbi2SJK71kYF1xLUBmcD3IaSeqyZ7x3/OSHaS9i 1pCT/82nA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lTayx-001DW9-8m; Tue, 06 Apr 2021 01:58:19 +0000 Received: from mga03.intel.com ([134.134.136.65]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lTayp-001DUi-Qk for linux-arm-kernel@lists.infradead.org; Tue, 06 Apr 2021 01:58:14 +0000 IronPort-SDR: GOCQWuZjdzan1cQm/bXw6oQ4VqCpBztaNNzCbqpkBg9q4xpo9z4tO9N20cp/5j/esPizjTU/ZQ e/raSxvUV4zg== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="193000071" X-IronPort-AV: E=Sophos;i="5.81,308,1610438400"; d="scan'208";a="193000071" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2021 18:58:08 -0700 IronPort-SDR: jk6rVjoF3eUvldst3p+gEJzCJ+jiSWscioDBkj7I7eezRuqn7HN3NlbByL3KKakeNtSBPyef3L iZgfos8XgVRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,308,1610438400"; d="scan'208";a="440728151" 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:06 -0700 Cc: baolu.lu@linux.intel.com, will@kernel.org, robin.murphy@arm.com, pratikp@codeaurora.org Subject: Re: [RFC PATCH v3 02/12] 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: <20210405191112.28192-1-isaacm@codeaurora.org> <20210405191112.28192-3-isaacm@codeaurora.org> From: Lu Baolu Message-ID: Date: Tue, 6 Apr 2021 09:48:39 +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-3-isaacm@codeaurora.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210406_025812_584709_70C4073C X-CRM114-Status: GOOD ( 22.93 ) 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 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 > Signed-off-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); > void (*flush_iotlb_all)(struct iommu_domain *domain); > void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova, > size_t size); > 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