From patchwork Tue Apr 8 16:53:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 14043458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB8D3C369A2 for ; Tue, 8 Apr 2025 17:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XPvMGbLhos2V2r74nd1APsYEb/OQ0T8Z8Q67ZKZwVMc=; b=alo8HIqEbIQ5TpkR2eACbWqRX+ l5VU927ZBn/9OLM4SkI66wPAJrnUeDsW5keeTcvq0U1k4KjxU1XsetXzg3P7YJ+HPXodaiN0p/zEV iuDyib3VagdpjZyTSWhI975ykl+ROjgt3D+Fa+ord2KYGpKB0epXLfQLRuXLlX0o8iZnrDskNd9j8 KcwXp3Dn109cn6+4QD+DrmjrXYkHFNq2wEMqy0yJDsVAexPMeHeUbEdaZWloJHXAB8ZLldybmgD78 VJw10+oPt7mRuLPJH8cjOhUjNpGzpzaHGK0ByWuyZAe6OTkpKJBpzlhcBAMy6s4reJ76F5riutFdK BkPcJJ5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2Cde-00000004xWm-0TFK; Tue, 08 Apr 2025 17:21:30 +0000 Received: from mail-bn7nam10on2062c.outbound.protection.outlook.com ([2a01:111:f403:2009::62c] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2CDa-00000004sBS-39Ds; Tue, 08 Apr 2025 16:54:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IHfbaOd8Mpg8N898PwacH4TIA2Gqv+mTPweO/fpdAE7Fu6wnKCTQoY2dSaIQ7E/LrHGqGE+prctrOlZ9/Ph7yN6U3iZt9PCsp4DogyAbxioX5cTbl9LYnRTMyW78IZnZ7+lD1OSFVW+3fJc+NyPNN2j+rsROL8zg2XGFkh+9pLqxNuz8/DiCibRkNEkehUtCe1yM419f+FtMfRWCMF1xq0Ex2ksmqv8p0qoIEg9YkY32surv0mbeHNTpXSCbRbxC2WJR+//zu0q5IT9CiLJkp7RHLBAE1ppEdHZeMzO2HHnZIioJHnXxJX1kgRog4+zsllRG8X3RRJkKzQKk/mfIPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XPvMGbLhos2V2r74nd1APsYEb/OQ0T8Z8Q67ZKZwVMc=; b=yalrW8O9ZOOt6t9RTc0tSbZSAHRrgTdFzmMb7eRZ1UkCTV623jSjq3dTNS76oBrslXT7rG/aNcA7wAYXoL3CU+aGLGQi2ePcvttB0xtj6LGS5O8BSepHEfw4sIQ+XUH9bJD2oc6/CZWR883j5JKzmpNQvIICIfpytT1ZIj0bXMycp5WkSBUpHuEb9yZR2tfqIeiQN7cwQgVO5TBz0jTW3B9PyUu7VIgH47V7emsfLq8DqMdlt2/poNZkbuvj9AdIhi4Pd0Y1OlJSf5DyoSUjIRzxup09zV65sFWMVVYWcnKbgIInzeppQf5t0Xu+dUfRe7ZVfvTPVvtFxqR3pYPDGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XPvMGbLhos2V2r74nd1APsYEb/OQ0T8Z8Q67ZKZwVMc=; b=ixthdzOnQt+umnAklFBCenYrgrEcmJZTbEt9b3nEPBC/yqVFTcwkPd8YEpFs+6l/hEf26UOFDsL82/A9BDcjHH3ISOvSpmtuG9SH/B+JSNKg3b6sZOP/gmNagMxievSGtHtvFV8FDmfItECNF/k/5cCNzfvpM5W8EL3Tb1sVyfR6DdrwyQnWdhCRrJXFes4ExdNuUgdwHTpNf4pvUqLoBQ9kdCWNHOtDH+svu2jqxg7JjW8q/iCtNrrVvDvcyb/afhFUYQFV9bSjbxH7aXNPcmince/7K4fpUi5ryqW+N1tjAHfqGSACVa1L7otlvw1wCCbVgg9bnupy04n4iyIhrQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) by BL1PR12MB5971.namprd12.prod.outlook.com (2603:10b6:208:39a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.34; Tue, 8 Apr 2025 16:54:21 +0000 Received: from CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732]) by CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732%4]) with mapi id 15.20.8606.028; Tue, 8 Apr 2025 16:54:21 +0000 From: Jason Gunthorpe To: Alexandre Ghiti , Alim Akhtar , Alyssa Rosenzweig , Albert Ou , asahi@lists.linux.dev, David Woodhouse , Heiko Stuebner , iommu@lists.linux.dev, Janne Grunau , Jernej Skrabec , Jonathan Hunter , Joerg Roedel , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, Marek Szyprowski , Neal Gompa , Palmer Dabbelt , Paul Walmsley , Robin Murphy , Samuel Holland , Suravee Suthikulpanit , Sven Peter , Thierry Reding , Tomasz Jeznach , Krishna Reddy , Chen-Yu Tsai , Will Deacon Cc: Alejandro Jimenez , Bagas Sanjaya , Lu Baolu , Joerg Roedel , Nicolin Chen , Pasha Tatashin , patches@lists.linux.dev, David Rientjes , Mostafa Saleh , Matthew Wilcox Subject: [PATCH v4 11/23] iommu: Change iommu_iotlb_gather to use iommu_page_list Date: Tue, 8 Apr 2025 13:53:59 -0300 Message-ID: <11-v4-c8663abbb606+3f7-iommu_pages_jgg@nvidia.com> In-Reply-To: <0-v4-c8663abbb606+3f7-iommu_pages_jgg@nvidia.com> References: X-ClientProxiedBy: BN8PR12CA0025.namprd12.prod.outlook.com (2603:10b6:408:60::38) To CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8659:EE_|BL1PR12MB5971:EE_ X-MS-Office365-Filtering-Correlation-Id: b307dce0-46e2-48d0-da97-08dd76bdff11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016|921020; X-Microsoft-Antispam-Message-Info: IaRNqSrJt/rOaRJXirK2AHvez46gio9Aq/cKKybiDIJf4frzx3mq/GAJ+FVAeLFXS10e0Zbi+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+54NpLSLDyANuDLx+qz7rtQR4Ytqr4CTB24i9EuwTtyzBFeG8qAUAzakoORDTYOGFZLVq3eweVfqp3vhnmKZPhSZJmUxuZjTJxZesTVUHrojrbHlZQeuABZ56cT+6bBFogBFhksYMUlj0/ka+wXm7k4W5QKnnp0Xm8792nH3DewifjLQlD9rHYSKnKMlv3P1SsvIDgt55YULySVMlZf2kDuMaPIIQ1KcoKm2IbNhezSZDdDH8UH4JsJiKQtrliZ7+QcpVrd8BC+6APW8q/c/kDbAfeMDglxLC6U0irx6l1z7dWBYu/0Q39ajq+QuF0aLQ0RZyBlD6ajqOw05FANnMhgqVBw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR12MB8659.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(366016)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gZs2h3+cMb78H8R8RdKt2k+NaFMvMtDQ3Z34VKKiK0pnrEQfCl9F1mgCK8DaogQTu228B8c3xTvF2B+ipBCRc78p2jbusW3krf6ycNjztS1GFj2xcEHSeDRZDkcnIpvNYNZ4n16zIfINJvlJf5w+++DGYg1fr5VdRX0jl28W9afVaLcfjaFT57GFq1QsqskWw6BuYE2n9S51NAi9aSO8dGeev3gHFQJRKWKxcI6YwL5k6A3FZe0QHPYJ0docnfb6KbhQRilO8/nWOdcK9KOGK015t7a24jjWB1igJavpfVBqf1uF79I3XlKBa1KGihjKSeftuIQsOeu6qSq7Dsjztb962MB4eKk1hkKSktvNR3pv2eD6auQoeXebZq+9h2KPV8oQS1od47tJ0buFu0f3sjrsLzrllm+kRkT1DGMPNErnCqwz51jyztW17rdNxogn6/X1uyj9sDac2M6qz8X95dOHhfKTM2o9eSSSGa4uVTAwuw2FQ23BcTYzrS02LAHR8z1Vtia2MCfqhITgg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X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b307dce0-46e2-48d0-da97-08dd76bdff11 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8659.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2025 16:54:16.2156 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: O0nz+WtMnI88mejhOtClfgS55Drwg90juIUI7jwmsUmmA816olGEtTRn5TdbrQas X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5971 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250408_095434_830123_0886928F X-CRM114-Status: GOOD ( 17.06 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This converts the remaining places using list of pages to the new API. The Intel free path was shared with its gather path, so it is converted at the same time. Reviewed-by: Lu Baolu Tested-by: Nicolin Chen Tested-by: Alejandro Jimenez Signed-off-by: Jason Gunthorpe --- drivers/iommu/dma-iommu.c | 9 +++++---- drivers/iommu/intel/iommu.c | 24 ++++++++++++------------ include/linux/iommu.h | 4 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index cb7e29dcac15ac..6bfa9ab3987c4b 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -105,7 +105,7 @@ early_param("iommu.forcedac", iommu_dma_forcedac_setup); struct iova_fq_entry { unsigned long iova_pfn; unsigned long pages; - struct list_head freelist; + struct iommu_pages_list freelist; u64 counter; /* Flush counter when this entry was added */ }; @@ -192,7 +192,7 @@ static void fq_flush_timeout(struct timer_list *t) static void queue_iova(struct iommu_dma_cookie *cookie, unsigned long pfn, unsigned long pages, - struct list_head *freelist) + struct iommu_pages_list *freelist) { struct iova_fq *fq; unsigned long flags; @@ -231,7 +231,7 @@ static void queue_iova(struct iommu_dma_cookie *cookie, fq->entries[idx].iova_pfn = pfn; fq->entries[idx].pages = pages; fq->entries[idx].counter = atomic64_read(&cookie->fq_flush_start_cnt); - list_splice(freelist, &fq->entries[idx].freelist); + iommu_pages_list_splice(freelist, &fq->entries[idx].freelist); spin_unlock_irqrestore(&fq->lock, flags); @@ -289,7 +289,8 @@ static void iommu_dma_init_one_fq(struct iova_fq *fq, size_t fq_size) spin_lock_init(&fq->lock); for (i = 0; i < fq_size; i++) - INIT_LIST_HEAD(&fq->entries[i].freelist); + fq->entries[i].freelist = + IOMMU_PAGES_LIST_INIT(fq->entries[i].freelist); } static int iommu_dma_init_fq_single(struct iommu_dma_cookie *cookie) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 0877bc6d8094e7..4ca74a2b1a1109 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -894,18 +894,16 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain, The 'pte' argument is the *parent* PTE, pointing to the page that is to be freed. */ static void dma_pte_list_pagetables(struct dmar_domain *domain, - int level, struct dma_pte *pte, - struct list_head *freelist) + int level, struct dma_pte *parent_pte, + struct iommu_pages_list *freelist) { - struct page *pg; + struct dma_pte *pte = phys_to_virt(dma_pte_addr(parent_pte)); - pg = pfn_to_page(dma_pte_addr(pte) >> PAGE_SHIFT); - list_add_tail(&pg->lru, freelist); + iommu_pages_list_add(freelist, pte); if (level == 1) return; - pte = page_address(pg); do { if (dma_pte_present(pte) && !dma_pte_superpage(pte)) dma_pte_list_pagetables(domain, level - 1, pte, freelist); @@ -916,7 +914,7 @@ static void dma_pte_list_pagetables(struct dmar_domain *domain, static void dma_pte_clear_level(struct dmar_domain *domain, int level, struct dma_pte *pte, unsigned long pfn, unsigned long start_pfn, unsigned long last_pfn, - struct list_head *freelist) + struct iommu_pages_list *freelist) { struct dma_pte *first_pte = NULL, *last_pte = NULL; @@ -961,7 +959,8 @@ static void dma_pte_clear_level(struct dmar_domain *domain, int level, the page tables, and may have cached the intermediate levels. The pages can only be freed after the IOTLB flush has been done. */ static void domain_unmap(struct dmar_domain *domain, unsigned long start_pfn, - unsigned long last_pfn, struct list_head *freelist) + unsigned long last_pfn, + struct iommu_pages_list *freelist) { if (WARN_ON(!domain_pfn_supported(domain, last_pfn)) || WARN_ON(start_pfn > last_pfn)) @@ -973,8 +972,7 @@ static void domain_unmap(struct dmar_domain *domain, unsigned long start_pfn, /* free pgd */ if (start_pfn == 0 && last_pfn == DOMAIN_MAX_PFN(domain->gaw)) { - struct page *pgd_page = virt_to_page(domain->pgd); - list_add_tail(&pgd_page->lru, freelist); + iommu_pages_list_add(freelist, domain->pgd); domain->pgd = NULL; } } @@ -1449,7 +1447,8 @@ void domain_detach_iommu(struct dmar_domain *domain, struct intel_iommu *iommu) static void domain_exit(struct dmar_domain *domain) { if (domain->pgd) { - LIST_HEAD(freelist); + struct iommu_pages_list freelist = + IOMMU_PAGES_LIST_INIT(freelist); domain_unmap(domain, 0, DOMAIN_MAX_PFN(domain->gaw), &freelist); iommu_put_pages_list(&freelist); @@ -3603,7 +3602,8 @@ static void intel_iommu_tlb_sync(struct iommu_domain *domain, struct iommu_iotlb_gather *gather) { cache_tag_flush_range(to_dmar_domain(domain), gather->start, - gather->end, list_empty(&gather->freelist)); + gather->end, + iommu_pages_list_empty(&gather->freelist)); iommu_put_pages_list(&gather->freelist); } diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 6dd3a221c5bc66..3fb62165db1992 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -375,7 +375,7 @@ struct iommu_iotlb_gather { unsigned long start; unsigned long end; size_t pgsize; - struct list_head freelist; + struct iommu_pages_list freelist; bool queued; }; @@ -864,7 +864,7 @@ static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather) { *gather = (struct iommu_iotlb_gather) { .start = ULONG_MAX, - .freelist = LIST_HEAD_INIT(gather->freelist), + .freelist = IOMMU_PAGES_LIST_INIT(gather->freelist), }; }