Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp490120rdb; Thu, 22 Feb 2024 09:41:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCcHORwPbrcFx0B6tqulKRuNzmgsWzN+n7/dKHxqGVXg9hARjO2BG3GJelvWvqErzKo/HeWaXR0t2TnhLx5BjmdPnLZwRQEfIgFggOCQ== X-Google-Smtp-Source: AGHT+IEw1tNoPuR8yfTCvKsa85+gSuKepVRyredm0UEdaVmjrPu2wTL47GdZXNvcSmBkAt+e1GnL X-Received: by 2002:a17:902:ecc1:b0:1dc:673:1932 with SMTP id a1-20020a170902ecc100b001dc06731932mr12850505plh.38.1708623708519; Thu, 22 Feb 2024 09:41:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708623708; cv=pass; d=google.com; s=arc-20160816; b=WtG66wx3PxnuSjAw/GLlivj+NBIhcvy3wwUGifxKAeb05h4UmXEQAJa4e8Am77eY4c NyFN7sypxA2xTB0ZxbrzC/iK8lFj0Ll00ZhjeGJp27LRPy84pbIGh8GG/7xKLm3R0YQf 65WTsCRl/A1UEOX0TZ4xgMB1vAeRjb9ew0uSdOROcCnoML9152VNNZ9pDYdpPi8GtYwv 5W3e0jsi1oPWXdkE4FnhDRSgZ3FlGBT3wHTiiVW8DVjBwi/s+yigWfcQF/saPfwyE40h x7Do0kbLmxT6CL1op+o0z32OkTN9Qy+iowjuw3jgQC5Pc33M5xxoW2R+stjZDq2Sm46B F+Wg== ARC-Message-Signature: i=2; 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=C9sOCaXXTnuRzyvLt2S+i0eLigQNp6D64P7FATFt28E=; fh=tiu+8fXe7QEjX0tkSzHEbyu8Cth4qwIcci9UAwK1U+o=; b=gvBdiJR0k44YnnngLZELS+DWMJUs/wkzkCKOtcZXa7eDdumgnxpa4gxskBDEnXl4Yx jUOWqddute82LX+BQko/zsZ4O3uvRFT92wAyWanNY2kpFL0neBJ0MDcVZycdMF2VaPSY XUe4o0SlVPQJ/peQYQ/Zp2TL55L6E231tGQTZPW9A5INCJ2n9tUcOprNc6l0ta3qiaE/ zaHmZlX/JVyBGsyjHoF8ryzWeFxSIetfg+sI+9NrZL7ebhrjEd+EITnjnME5llQRgXqx /dm3ADPodaFV5vHSSpxsZIHOdV7KalE6fYC3Xsw5Y8zf034G2HNVJtw9xA5Vm8D0pOjZ 3FPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=kgWL7qSK; arc=pass (i=1 spf=pass spfdomain=soleen.com dkim=pass dkdomain=soleen-com.20230601.gappssmtp.com dmarc=pass fromdomain=soleen.com); spf=pass (google.com: domain of linux-kernel+bounces-76992-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=soleen.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a4-20020a170902ecc400b001d9ec0d76b6si9454015plh.585.2024.02.22.09.41.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:41:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76992-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=kgWL7qSK; arc=pass (i=1 spf=pass spfdomain=soleen.com dkim=pass dkdomain=soleen-com.20230601.gappssmtp.com dmarc=pass fromdomain=soleen.com); spf=pass (google.com: domain of linux-kernel+bounces-76992-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=soleen.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 49ECC28393E for ; Thu, 22 Feb 2024 17:41:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 457401586E6; Thu, 22 Feb 2024 17:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen-com.20230601.gappssmtp.com header.i=@soleen-com.20230601.gappssmtp.com header.b="kgWL7qSK" Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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 3783F156999 for ; Thu, 22 Feb 2024 17:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708623597; cv=none; b=mmzdSiPqoWNwPhNjqwE6ER6aHbTsdpj4SahcSDqSIS5XUwz/76L5lzr2xxti8mK4YC+0QFLabWx72+yb6NFg+YSMdgtuVb04NFqa+oAhAGfodCQWasmVfJsf2/DAf7GOASITl23h2tXaIUVvEqlJgDyL1YGat8/p3saj0GbZZk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708623597; c=relaxed/simple; bh=MO9zupR8uvU3mAVWpwjGwF/5I/sWszt0d3zRSJTo/LE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tJJhtuCHU3BlTSAQ0LLYCcObL+j4GgLYNTE18sfAVzJ15khASztaKsQ/ogILIYe/GDV+5hvkGfpUi1INSz4LCRt+Z2AgOHNJa816sEg+p7oWtf7jFA9bdYMTdlYktZVAO91Y5va/PJqXWtHH0HKNXBvxx6b0JvX1Na8kYC99U2k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen-com.20230601.gappssmtp.com header.i=@soleen-com.20230601.gappssmtp.com header.b=kgWL7qSK; arc=none smtp.client-ip=209.85.160.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-42dd9dfe170so30530831cf.1 for ; Thu, 22 Feb 2024 09:39:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1708623589; x=1709228389; 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=C9sOCaXXTnuRzyvLt2S+i0eLigQNp6D64P7FATFt28E=; b=kgWL7qSKrkDISDWErtzFAM3YdEsISgMQN2Grsg1Kd3QAEsGtmDE266Ab7meFXa7J9p RF2I/rjuqMtR4EaXO0Ej2mM1b1LiZ6/+2XqmHdD3+1ond2x7uxlD+Xg1pla9jKG6GcJK x2IIZvTBZ1dj0xDslNyCe3EQIe+8kqKuk8ZUykNn2mP3gHVFzj42+R1cCYgcbMzwADjw nFF7YX7L55glWaz4rT3lcsy2eMOS84fSCQzWcACbWTc2Sm6dg8MAbpfbFZ7AHlsNHG6c 8t2EuCyQrxTDERSIyKcLADb0mrUuAy74C5KxrHk7dV9JdDFttaLdCORsmgYH1geMsGcJ B56A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708623589; x=1709228389; 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=C9sOCaXXTnuRzyvLt2S+i0eLigQNp6D64P7FATFt28E=; b=K/Na8LoR7PRE3kRx2BOnc6bvMbJ8HkdD/HgX6mZbs+xlkPnl35Jejp0lmAA+zXOsr+ bd1T+YvDTHyyaB7vgHaiKWZAkla5sypoezd7tBgm2GJ1Q5X18T7yj8EtE517o83vKCUZ i675K+QxJ2TJ+1cY4WGIT/DLZXlCRXDW4kFDK3dqP6wRkadUyaC5pUTPigj+dSwPRYlo eTScm4PscNRBA9TXDLL8l/5C/9X9c0KxEHtUnHLSiL56h5cQzv3R4U3tM5Q8+fimGoXt K6rPk4eHuZoQodUZVs/TPIo0Nz+iqRVHa5eI1EieWRBKmOPmlFna1CcP3fsDni7s2UnT sh5Q== X-Forwarded-Encrypted: i=1; AJvYcCVLgdPj5Qbsk/TVFXzSRU8EkkccjgfToFtmU6NXIF2xm3Td9eL/pjolWATIDzuN5pX+xa/0Yg8ltcyV1fMw+jedqBWcCi3sXoDwqjbk X-Gm-Message-State: AOJu0Yz0pz33hkmoFoguaCgyLseC1NKoJqidFXeG0c1Zjy6i2Mc/6SbO OBU9IUWtrP3D8nufNsID10iCi0+50I9mpZtxamuvngv1Cow87gdclcqhzPKsO+k= X-Received: by 2002:a05:622a:103:b0:42d:b355:1538 with SMTP id u3-20020a05622a010300b0042db3551538mr27425174qtw.55.1708623589605; Thu, 22 Feb 2024 09:39:49 -0800 (PST) Received: from soleen.c.googlers.com.com (249.240.85.34.bc.googleusercontent.com. [34.85.240.249]) by smtp.gmail.com with ESMTPSA id f17-20020ac86ed1000000b0042e5ab6f24fsm259682qtv.7.2024.02.22.09.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:39:49 -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, bagasdotme@gmail.com, mkoutny@suse.com Subject: [PATCH v5 04/11] iommu/io-pgtable-arm: use page allocation function provided by iommu-pages.h Date: Thu, 22 Feb 2024 17:39:30 +0000 Message-ID: <20240222173942.1481394-5-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240222173942.1481394-1-pasha.tatashin@soleen.com> References: <20240222173942.1481394-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 Tested-by: Bagas Sanjaya --- drivers/iommu/io-pgtable-arm.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index f7828a7aad41..3d23b924cec1 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 @@ -198,14 +199,10 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp, VM_BUG_ON((gfp & __GFP_HIGHMEM)); - if (cfg->alloc) { + if (cfg->alloc) pages = cfg->alloc(cookie, size, gfp); - } else { - struct page *p; - - p = alloc_pages_node(dev_to_node(dev), gfp | __GFP_ZERO, order); - pages = p ? page_address(p) : NULL; - } + else + pages = iommu_alloc_pages_node(dev_to_node(dev), gfp, order); if (!pages) return NULL; @@ -233,7 +230,7 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp, if (cfg->free) cfg->free(cookie, pages, size); else - free_pages((unsigned long)pages, order); + iommu_free_pages(pages, order); return NULL; } @@ -249,7 +246,7 @@ static void __arm_lpae_free_pages(void *pages, size_t size, if (cfg->free) cfg->free(cookie, pages, size); else - 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.44.0.rc0.258.g7320e95886-goog