From patchwork Thu Nov 30 20:14:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13475015 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 60924C07CA9 for ; Thu, 30 Nov 2023 20:15:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD9566B049A; Thu, 30 Nov 2023 15:15:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C61756B049B; Thu, 30 Nov 2023 15:15:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8A5F6B049C; Thu, 30 Nov 2023 15:15:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 962AC6B049A for ; Thu, 30 Nov 2023 15:15:13 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6633F12030E for ; Thu, 30 Nov 2023 20:15:13 +0000 (UTC) X-FDA: 81515724906.22.23C150D Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by imf08.hostedemail.com (Postfix) with ESMTP id 947BD16000B for ; Thu, 30 Nov 2023 20:15:11 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=TMKUh94h; dmarc=none; spf=pass (imf08.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.210.54 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=1701375311; 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=agdpEgslqhHdhrn0hnWdDpIJa9Hen54IbPQiTYhpn3E=; b=gAu3ME1g5ogJ06QuuU5UCXdCg48thfHuUrER6Qw+JpOum5hZ1DmaKiWtmjbdLmV7PSnFG8 EvZWfH9s7hhARD+iQzoSOcYO7CjoQP4vaLBYp4VpT1BqzeFtB8aKVmV29fT0pmaikIsQuB AeXep4jd8khCRpUTBVwft93dHCl+74E= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=TMKUh94h; dmarc=none; spf=pass (imf08.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.210.54 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701375311; a=rsa-sha256; cv=none; b=dsOh4eU1fH3NQQkG9yct0vB4IajGYemY3b6+C/LKJTSN6C4SD/vhSH9wd0r6uqDWy0Y4t2 TLZVcNeokLHci2RXLMHYeN8Q7/FcKH3bYZulWyTbNPCCIXlMdxz+qBX7aYi9f7dttjrxNW jtDh3MscQg5JEs9W+eiTReYFBF9jSEM= Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6ce2eaf7c2bso872846a34.0 for ; Thu, 30 Nov 2023 12:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701375310; x=1701980110; 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=agdpEgslqhHdhrn0hnWdDpIJa9Hen54IbPQiTYhpn3E=; b=TMKUh94h/vE5YhFrr3I+P76I1bkILkw3O4flsqrZwYdsEvoGMQjB80uNag/7L8fGoP nt7Wxha4ezhLTzE6HlhAsuIsdytuE+mPUiEyIryvcW1fL6Q4kVG+qOV3zIImj4N1KKrN uWs/tbKu0A/J1daqsMhv+oh2Wufkmz54/qGs6wOnyi0zPkcH2S2vTzVgOvOM376Vxxtp vzLSumvlRhxCEI2nzfvTuxgExUcZuFOJPLfNECdC2juydF5zzPGkH/xFX6Hi7u0V3wvi KKhNcQ3G4XFn8d7sYlcdwcr5JZOJvZv8cmgGdE5sGCca2fVFxRAvVlluTs9rm1Y85hk5 KWZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701375310; x=1701980110; 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=vpF03co1MRdQGtsNJ1J4KwaPhoKqYaCJg9nk5QJQ4dnFBju0ZnxKl4Wl0HUvOcYi0g v9znqwWHgMeuUNcapF+ujRhSqDl8l/Wta04ogTsCCVV9dL46a9h1B/vKEfTzQeRTdDYz hPGLgxS3EiCDEA+tzMlTBgP92XScOIlq2rta92+OP7/SvM3DLSXA3DbmAbuF+Q8irjgd Uf/qz9MmtrluX8BGQ7PJLVObbTwuun4NL4NseJX1Dj0r4RaoxFr+2vGqdPu/J3qs9ot1 OQN30782JBrwBL/17D4opCT1YxsdoyMJfDIfn+9w/h26flC0VtZwnUpHX+Rvguh6wwa3 WhvQ== X-Gm-Message-State: AOJu0Yz5envXVpV/JEHEEPXZNFvRgFqdl884dcJaqhiR7lNBgobe4D6o Nk/iyCGdw4dPJy4tL7/oRlHV6A== X-Google-Smtp-Source: AGHT+IGqd1nCfT5mpKZHzFpkRZAyFydlrTR6nVwlbdpa33SL4CJzD0tuFZYwet7aKrGY42Lko6YVCg== X-Received: by 2002:a05:6830:2644:b0:6d5:11f6:eec7 with SMTP id f4-20020a056830264400b006d511f6eec7mr794143otu.28.1701375310765; Thu, 30 Nov 2023 12:15:10 -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 e1-20020a0cb441000000b0067a35608186sm795252qvf.28.2023.11.30.12.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:15: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 Subject: [PATCH v2 03/10] iommu/io-pgtable-arm: use page allocation function provided by iommu-pages.h Date: Thu, 30 Nov 2023 20:14:57 +0000 Message-ID: <20231130201504.2322355-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231130201504.2322355-1-pasha.tatashin@soleen.com> References: <20231130201504.2322355-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd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zC gdZgwvP3LvfcxOSuPZ9lZW/e61CfBHHVsAtuBIs2At5VNi1G3oVg+pLdz1iC+8CXQIXsP/7cxcFvkgWpar1VXW0vumWObxRIhwGmYI6oK053CRfQX9SR1ASDjCrAn2O9fizd67HteYUa9DM7BLascMaSnJ4a+g/upaxjn3rs5qpolu+ewcqvUbQFY2hoqa6OOdjlsBP3PPrh7OqSRMX4wT4OPXjifot5sWktj+MN82TfxkeV2S7LcAsYNUQZWjBYPy8QBXKPuLQiEmKqBEG6iR2PbW21ZjNOV1yEoAC7vw6HVH0oZduQx7xsk1GcGA6DuEBOk1FRR8IXDK4G2mIohebTBmyJK/vaTWDueJtRuHKmAWCYHSuQsn20ZStJHmOvf/94CY0b4oBc+//A6NdrMPg8PFH9CnkXUpGQq2HIny9bPBPgupqPR6oxwK88S5+P4qA8JWBrR9KoIVTU/qW/a/+aBd3QsJ1mN6Sk6TpvXy1FBRO7RSuGoAzTPpPyJmms3aRh4Tq88h8f+N5NyumJwbDd7fw== 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,