Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2997830rdb; Tue, 26 Dec 2023 12:03:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpe8kTLshLcQuu3ARMUVqEwS5gWp5Jpnxql9cKTUBPSle7LCMY020Om3ECbUr63TbTEHDv X-Received: by 2002:a17:90a:da06:b0:28c:c69:b402 with SMTP id e6-20020a17090ada0600b0028c0c69b402mr3406872pjv.69.1703621029712; Tue, 26 Dec 2023 12:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703621029; cv=none; d=google.com; s=arc-20160816; b=JQ6Fa8z/erGcPHnwg66Prss4duV+dlCLpZ78d0ZuU6WuiwWj6tzA7NuH1DebWtbnPv JQ8GWsV8+9ncbix3gD/4f+4C54FTOc9NUuIFhps5oHVIvhv8+B4ooMk4IJogLCEbwLEX p30B529qvjGPOJcG2NQSnMIbr+Q1yGxZAB6I2YstjXdgXr7I8C5ttWExZLt3ymMU8PFx MMh3X20DYO9xFp8v0jAlinIDYZUgEYjh7ltlQMiyircFoPiURj5is+e0YSvt75fbTHMP hWbefNZq2rltjhFkuihkUv9Rv+gbC0Pl98B18S3PVKP6CBT41qCZPXubhElpFByLOvLx oK8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=ypS1Neib8HIDm9UmxS/HJDs2d4K6sNmK80zg2UdXDks=; fh=lUkiT048LCyG2kYH3uS9GPNyu6fkGQdYtFXGdyQ4NZk=; b=x5qhqjNglcYJr1LZDueoGKIRqxRlGkeviEC6kx75nj2klvnU12EFXF3EKiNMx/VqK0 bFng2JhkZ8fSaNNADy37W2H9R/6v2K5+Fx856mPVnwOH5OyCceQrDknqyRrV+oEAzsCO G9/dlpNdt0JJjkes2nk4BMxztivpVY0URV8AWF+uoT1YLcRtLhS/LHc2hWwh3Kw9KUl7 sYGGO5XYhrkmsGYvh6v4bOZ2hJO9e9mL9wgfcxBdHWyQamT8ItdV/GbooK6U10pXOX5D gTXHl3aMVGM7nBAOPNoTK9SEPhjdBH6pWXAkOO2N8u33FpVQntmJaitJSaqSwa6tz1Py eluQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=Mz60WDXb; spf=pass (google.com: domain of linux-kernel+bounces-11668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11668-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a11-20020a17090a8c0b00b0028bd0b18f34si11490809pjo.74.2023.12.26.12.03.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 12:03:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=Mz60WDXb; spf=pass (google.com: domain of linux-kernel+bounces-11668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11668-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 00D4AB221A3 for ; Tue, 26 Dec 2023 20:03:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7634612B99; Tue, 26 Dec 2023 20:02:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="Mz60WDXb" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C4F74C87 for ; Tue, 26 Dec 2023 20:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-680496bc3aaso2655476d6.0 for ; Tue, 26 Dec 2023 12:02:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1703620931; x=1704225731; 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=ypS1Neib8HIDm9UmxS/HJDs2d4K6sNmK80zg2UdXDks=; b=Mz60WDXbpFTLMDyHRdY9vFqb9GiRwrgMJP3uiarok5TH8mDKD7pI4jZwI6xCdo0iqA yPpOPI27GIyMveUhr3q73OYpp4PIm4J3IvhDEEzZ4PgRPvZ8UZQ9Xb5JQKOeINo7zTwO dVe5PJO8izc+1oeRL5FiQqg0vCcTn0GkIRG5iPxMmRf03OC+6A+rFj+GdGGdDsSTUKoU IpsQls1plJlhIMnlGyHxnGeKPDjN/TM3Gl6SzlwHH6PG2/b8t/kHs/8YJzz67c9Z3mKr pLBhPlHNrROtZFawm2aDNmhHx5AFAizJ+HyhuRmI/XDBNuGmTB395IYfkf6uoSV6MYZm 2isg== 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=jqeDXPKkryuZlBocj9veJCLUW3p65vzWe29mHsRItDBnKBVgJqgw+k6r5u4dH0NUTe 5ekSYdYvVvP9jTbQiRrKxgY/txexgXaM2s6Q05U9FyNVY35OgH8Ho0PcK4+L9Ww+4uHr p1TCVyYFPJTelZQJv+aQrOdeoti4ulPqmxgTEBhgT0vpHLDA8VZBTNIEYvod+em08dVy 8Kag/ZnJOjlU+X7z3hRNruhTjqJC1kcstEMJbsDBqIEEW/+HIYrDdS3IObVpsYdqdO+E zLgYBm8gyXOlAr/C3fjdS1ZImr/WjsktriEDwckcTFVnSlh5iuQA6Rp5G/DaUvGTh068 YfoQ== X-Gm-Message-State: AOJu0YyaYK6bsd2OfMIsxpFcjbywfULkgVQdp2yaqzFk1Gl3fE8vLYT1 gfaMkH7BFB3yxRe4H1615izwMReAUKejBg== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, -- 2.43.0.472.g3155946c3a-goog