[03/16] iommu/io-pgtable-arm: use page allocation function provided by iommu-pages.h
Message ID | 20231128204938.1453583-4-pasha.tatashin@soleen.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp4217517vqx; Tue, 28 Nov 2023 12:50:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1TzReN9s+AQjQ0oYJB9eZIGPVDRs2YanQrWvLTCEuxFRJvW3VC3FolP3+pDl0eK+UkTBg X-Received: by 2002:a17:902:f68e:b0:1cf:a0b7:c68b with SMTP id l14-20020a170902f68e00b001cfa0b7c68bmr23878023plg.8.1701204611258; Tue, 28 Nov 2023 12:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701204611; cv=none; d=google.com; s=arc-20160816; b=rHzdA7hyIUD9nMIuPwSEJlvXObMCXZggh8J7WkWKhJrxg/E++DyWv7iVsP7AJ+k9Yr SngMk9rQVG1W8N3Q9X2ytmqT/MZoAXBec9FSrYP/aGnYcjKNkee+6A7FZLeBHFliKtGe k80nIvQiZrvZKJ6qGsy3BSaQFBKxQrV5L5vuKfQRjI3RXBl+emUGdC8DGJrncNde8lR9 k4jLqsSDTiDcw+QvuKmZCHiLL5eMkbYM0Dzrmg46okZ5FiS6/3tRFsn5NCnWZsL0Ubvx nMkgb7Pp67/EPgbjfTnnrZXsTvsdg34glrCno/H/QFTUOXSrFktGM4SRD+STWe/EX7zM 94GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=agdpEgslqhHdhrn0hnWdDpIJa9Hen54IbPQiTYhpn3E=; fh=z7CihAYYs+frw4g3uL4utEDJXxOOJDcFFsLsywo+fzs=; b=FlYmBwgVli88EWI7EW9ECY/348anhjbxLad/Q3qFVNVUvKVHDmn9B084P5AXMiFFao O2tzWfxSauOVhzSIaRXmKZgacubJ9l3rcRte28eZJ7CUl5V/TmbjY/IIWueQqG+ty1Mg tg53h+rxmNOdU0ylIbrpD+GSE6dfLZ4ZqG2oabU5FOkTpetSqKi6Dbsb55GMHRm1k0Wd KJiR9+2wQnl6Cz2lB8cBBhuO2qH3o36ux+vbI5f/aSjZnTqW9MdDJPSe/EAZPuk/X5vc 0uatpgBuNb5ZX8VbLWiRpUKPxVyMiKeGfPAEF5aJibMk8Mp2cuc6WOpyY8WfyV0SQX5A kGFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=Xfs24UuL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j2-20020a170902da8200b001cf579f758asi13463888plx.437.2023.11.28.12.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 12:50:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=Xfs24UuL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 64F2E80732A3; Tue, 28 Nov 2023 12:50:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346151AbjK1Utr (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 28 Nov 2023 15:49:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345683AbjK1Uto (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Nov 2023 15:49:44 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29EBE1BC3 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 12:49:45 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-67a095fbe27so1638706d6.1 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 12:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701204584; x=1701809384; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=agdpEgslqhHdhrn0hnWdDpIJa9Hen54IbPQiTYhpn3E=; b=Xfs24UuL16GbfUYKHftGUGEopYClHnDNCUlHM4fRVjS5JT9hJIK4RRCWRZONkAzHvD dlxs0Oh+2kJ3U/TqI40pCheDRRG2hhbHkEHeU3m3Vqn9LcvUFEhAlozx8nkGOlK5i71q GJPX8bWdbHet5KYTsVO02S6BE6oyESKT3wtx3nE0f7bPPqJCRxpn3ePJgT8MSL/uX64D HTNgreL+q5I01i6oMC2xsqJEbEtMBo8ocvacXtOIYNFSZhlTmVoaNfvxZq7bihc+3mnN sx4DOMCp0XBj+ER3hHJOYTzH2UKtNsg4wBjOHMDyo2dLiNo4azjByjAJpXb+fRVZVQIN 98+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701204584; x=1701809384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=agdpEgslqhHdhrn0hnWdDpIJa9Hen54IbPQiTYhpn3E=; b=OKSgDOEnDhzqPILC/Z+WkAp5d+gLNepLLXstRgb5XrfBsK3JlfpLYIZNXPm9xTkuut 7VbMi9mG5Mpy7kJolRePH1EiI76bm2lXJGadqbeA0edicGjOkrqNjqDWoWML2pLJPNoq 72mEQOGlA/Ym5PkICSzDFEAjvm3S4RefbS7ZT03Zswt0LyzIidPlNGfYxpd51GQ1M6wv Hwp8+4pBHW4u8tbciZx/yQC//fFrc7DHc6v8m0XEZnaET9VdNxJ/lLrveHVrnGnRykZU zEPnnoScbEOL5X6TLcMBpv0Xgg8kJxGOkFSJ3Xr5FnGyNmrSj4/Dv0y2Vh21uLbVA8c5 e0Cg== X-Gm-Message-State: AOJu0Yx/wgtIJwfFYA5JWdplyN27MGhTFmX1RA/ge2EixfIQ29tc5tL7 bFTFjvOdni8hxDsNnGQsv/wXkw== X-Received: by 2002:a05:6214:2249:b0:67a:52eb:7a00 with SMTP id c9-20020a056214224900b0067a52eb7a00mr10312900qvc.7.1701204584210; Tue, 28 Nov 2023 12:49:44 -0800 (PST) Received: from soleen.c.googlers.com.com (55.87.194.35.bc.googleusercontent.com. [35.194.87.55]) by smtp.gmail.com with ESMTPSA id d11-20020a0cfe8b000000b0067a56b6adfesm1056863qvs.71.2023.11.28.12.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 12:49:43 -0800 (PST) From: Pasha Tatashin <pasha.tatashin@soleen.com> To: akpm@linux-foundation.org, alex.williamson@redhat.com, alim.akhtar@samsung.com, alyssa@rosenzweig.io, asahi@lists.linux.dev, baolu.lu@linux.intel.com, bhelgaas@google.com, cgroups@vger.kernel.org, corbet@lwn.net, david@redhat.com, dwmw2@infradead.org, hannes@cmpxchg.org, heiko@sntech.de, iommu@lists.linux.dev, jasowang@redhat.com, jernej.skrabec@gmail.com, jgg@ziepe.ca, jonathanh@nvidia.com, joro@8bytes.org, kevin.tian@intel.com, krzysztof.kozlowski@linaro.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, lizefan.x@bytedance.com, marcan@marcan.st, mhiramat@kernel.org, mst@redhat.com, m.szyprowski@samsung.com, netdev@vger.kernel.org, pasha.tatashin@soleen.com, paulmck@kernel.org, rdunlap@infradead.org, robin.murphy@arm.com, samuel@sholland.org, suravee.suthikulpanit@amd.com, sven@svenpeter.dev, thierry.reding@gmail.com, tj@kernel.org, tomas.mudrunka@gmail.com, vdumpa@nvidia.com, virtualization@lists.linux.dev, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com Subject: [PATCH 03/16] iommu/io-pgtable-arm: use page allocation function provided by iommu-pages.h Date: Tue, 28 Nov 2023 20:49:25 +0000 Message-ID: <20231128204938.1453583-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231128204938.1453583-1-pasha.tatashin@soleen.com> References: <20231128204938.1453583-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 12:50:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783842326622486881 X-GMAIL-MSGID: 1783842326622486881 |
Series |
IOMMU memory observability
|
|
Commit Message
Pasha Tatashin
Nov. 28, 2023, 8:49 p.m. UTC
Convert iommu/io-pgtable-arm.c to use the new page allocation functions
provided in iommu-pages.h.
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
drivers/iommu/io-pgtable-arm.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 72dcdd468cf3..21d315151ad6 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -21,6 +21,7 @@ #include <asm/barrier.h> #include "io-pgtable-arm.h" +#include "iommu-pages.h" #define ARM_LPAE_MAX_ADDR_BITS 52 #define ARM_LPAE_S2_MAX_CONCAT_PAGES 16 @@ -197,7 +198,7 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp, void *pages; VM_BUG_ON((gfp & __GFP_HIGHMEM)); - p = alloc_pages_node(dev_to_node(dev), gfp | __GFP_ZERO, order); + p = __iommu_alloc_pages_node(dev_to_node(dev), gfp, order); if (!p) return NULL; @@ -221,7 +222,7 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp, dev_err(dev, "Cannot accommodate DMA translation for IOMMU page tables\n"); dma_unmap_single(dev, dma, size, DMA_TO_DEVICE); out_free: - __free_pages(p, order); + __iommu_free_pages(p, order); return NULL; } @@ -231,7 +232,7 @@ static void __arm_lpae_free_pages(void *pages, size_t size, if (!cfg->coherent_walk) dma_unmap_single(cfg->iommu_dev, __arm_lpae_dma_addr(pages), size, DMA_TO_DEVICE); - free_pages((unsigned long)pages, get_order(size)); + iommu_free_pages(pages, get_order(size)); } static void __arm_lpae_sync_pte(arm_lpae_iopte *ptep, int num_entries,