From patchwork Tue Dec 26 20:01:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13505029 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BF8CC47073 for ; Tue, 26 Dec 2023 20:02:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 245216B0075; Tue, 26 Dec 2023 15:02:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CF116B007B; Tue, 26 Dec 2023 15:02:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F13EC6B007D; Tue, 26 Dec 2023 15:02:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DFF686B0075 for ; Tue, 26 Dec 2023 15:02:13 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B8D8240657 for ; Tue, 26 Dec 2023 20:02:13 +0000 (UTC) X-FDA: 81610040946.05.BFF6FAB Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by imf12.hostedemail.com (Postfix) with ESMTP id F2DF94001B for ; Tue, 26 Dec 2023 20:02:11 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=G0uiQc06; dmarc=none; spf=pass (imf12.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.219.46 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703620932; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ypS1Neib8HIDm9UmxS/HJDs2d4K6sNmK80zg2UdXDks=; b=MJV7Pe5GmiEC9vr4DYxk0eopEasvPBpp83BCN2yZ3oZnP1lz9mBVa00z0eL8keLj0KdLs4 GuVusXcOfWqeLUncnj31glTmVXEhJKKn6sG3jOYI2U185VO/3JR6W+E3Fz3bS4sNgUuFy+ /7ECb1TXleRa7G290jlhqhV/rkOpmUs= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=G0uiQc06; dmarc=none; spf=pass (imf12.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.219.46 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703620932; a=rsa-sha256; cv=none; b=ztyEhG4usPyCqsGnGJVa0xVdaHJNdkzgy/x/sxNVjeavxTnRvdfPH6hiFqDH4mNybZEoml zW8gEXIoRcAI1XH1Sh85pZMt++rddukIuQxyl/fJ1aeo0KpWU4jQ3a/IUE+plymHGZ5sdD ovSeSFAKCPVF6XZiH2VB2nSJ83EOUzc= Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-67fe0210665so16405106d6.1 for ; Tue, 26 Dec 2023 12:02:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1703620931; x=1704225731; darn=kvack.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=ypS1Neib8HIDm9UmxS/HJDs2d4K6sNmK80zg2UdXDks=; b=G0uiQc061HmbHnGIBQVJLj4Y0rONTaZlPpM5pFiSEVHjzthS36WXcYyIEgaKM+HJer x84KoVE/6kb4KRUnKeSQ2P0FaBL0qcT5ZEdMWZ7n/drzM1OjAyINcH+zZfII+R832Qrl vD/Nkt4OyxTI1UPqwwW8h8JtN9qeuXNCfUyuimyzVc2tOH553pSzkiMbbfe+U1kkARFG shBffxYU53ln3F4ruLi0OzDaecg9hpgKT5kOwJQ9V2jD9SRz5mgq1OZAruoIBnaXICrF WeG03kEj4dAZ4l33mclA2pD54xSHkFnVcyNb67aCjamQcopttMOy2zDGPsBTDZdUPgld bEQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703620931; x=1704225731; 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=ypS1Neib8HIDm9UmxS/HJDs2d4K6sNmK80zg2UdXDks=; b=DCSBHEhGwfR5Cvgj26vixjypz3N0b+Nrw9IHC7OBaYYGwV4WrCxIPNc9LXtrest6JW mrzhoXUMVfYzDcnIuRAOvjsgnNo2KWWGCizr4wOhRhJrmbM0yvvaqdbyS4Ni6XLs1rgW JuTe6QU2yi8nSnodASb9PZ9O3hyrE45AuA38SNzu83PPuQ3HE/IoGuE1tsYR3+H7qHaU v8hSgHbsikIMvsBlZXIRP0hfLnPDoKIt7EMeDqOSTlT5dJAJSD1S0zcdVgHsF3xeFfmu gkJyP+0ghDp44Ru78AMTo3KMfBMrrNXBpIRMAPQ3jLrThIWrCLNx7iWd5gNGG2FmJ4hr yxFw== X-Gm-Message-State: AOJu0YwX0N37Kh2B15Kv6Xdb4nUkZV1Gh2C+rLqEUkv4seB/hqg9nYvE 7iHRxKhTVDrgkplugbKc0sEoKlzTFEVW/w== X-Google-Smtp-Source: AGHT+IHSQM+LgRuNVnF3iWBSyAs/u7g89umL2iScajvlGIrSq1uiM5Mc659FcM2VTca3M8kj7d2P0g== X-Received: by 2002:ad4:5ae7:0:b0:67f:7c5c:3449 with SMTP id c7-20020ad45ae7000000b0067f7c5c3449mr13308631qvh.14.1703620931126; Tue, 26 Dec 2023 12:02:11 -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 t5-20020a0cf985000000b0067f696f412esm4894539qvn.112.2023.12.26.12.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 12:02:10 -0800 (PST) From: Pasha Tatashin To: akpm@linux-foundation.org, 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, jernej.skrabec@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, krzysztof.kozlowski@linaro.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, m.szyprowski@samsung.com, 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, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com, rientjes@google.com Subject: [PATCH v3 03/10] iommu/io-pgtable-arm: use page allocation function provided by iommu-pages.h Date: Tue, 26 Dec 2023 20:01:58 +0000 Message-ID: <20231226200205.562565-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231226200205.562565-1-pasha.tatashin@soleen.com> References: <20231226200205.562565-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: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 8rpzMVnD dTTAwcabKABneCqGEYGGuOWgxmQDiSl9EMoy/ToiFgBH0VooRqtIeiRAAyjR1rxD6BINdOelbcPfD3n+Zi0YP3bgREnD5IWCyn9A7/QpPx70rQBPm87zwmp5wojnIgPlP1I/+kcBwEcHA5rUNCG+KzAPw/K+Nj4JDUKxYWmFC9Iy4gcJLyAH2gJJhYtAIxtUEl0q5pz9zDkpqAs0fAZyX+80hiUzNo1DuAgo5UbwTog09UNXBh3owLMHhnTliz0wDsob91vYa7JOr/xW7SWF8Ib3/CfwvH9347EpG+gnefVKqc0h8ZIA+sMtMqaGNCT1cTsYw4bbiVifGmz8mSrPOlWwZzzoCIQVvSTgZggmZzZ3BrX7hRhWf4WBa+uVPsdky5e9+vENeDQOvJXQNr1Pj6DgiksF491e9u8tA2lyhzI5j5/hJ8MMPE4ssEA3EsAIT5CUIfNde13GWHK1HHbL9eJiRvA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Convert iommu/io-pgtable-arm.c to use the new page allocation functions provided in iommu-pages.h. Signed-off-by: Pasha Tatashin Acked-by: David Rientjes --- 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 #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,