Message ID | 20231128204938.1453583-4-pasha.tatashin@soleen.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 8C41AC07E98 for <linux-mm@archiver.kernel.org>; Tue, 28 Nov 2023 20:49:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 487E36B0353; Tue, 28 Nov 2023 15:49:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 411B86B0354; Tue, 28 Nov 2023 15:49:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EEA46B0355; Tue, 28 Nov 2023 15:49:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EF42B6B0353 for <linux-mm@kvack.org>; Tue, 28 Nov 2023 15:49:46 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D1BF31C0180 for <linux-mm@kvack.org>; Tue, 28 Nov 2023 20:49:46 +0000 (UTC) X-FDA: 81508554372.24.3F2C974 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by imf23.hostedemail.com (Postfix) with ESMTP id 15B19140003 for <linux-mm@kvack.org>; Tue, 28 Nov 2023 20:49:44 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=DfEVXdkb; dmarc=none; spf=pass (imf23.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.172 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=1701204585; 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=5tTJWlyFTLDE/UyZwCyhCtgKBBBK/p7jTE6MioehqIEdjdBrjdzYnZ+nzdiNKwhn3CsleV expAXXTUNLWq3v5yKv4gwoCThWmbJME9kBNKHMKJ4+vAZQROsQLPCWA7Ma78unX7julWz9 GWqsPEZnrCsnHhxKd9L5H5JhIGpgVQA= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=DfEVXdkb; dmarc=none; spf=pass (imf23.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.172 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701204585; a=rsa-sha256; cv=none; b=NmaHIxJEbvvu7AkJ2xQlUqxnOjalzZxMsY+bXWxUmQoFkkTvR15oR81iiT7KzkZTP3l0+A 2KbIvswZ9fSLF/+/gnonBV4QMRPr3PuW679q2DE1uz1KSHHMiyJbrfn3kLLJBgDmXW6D7O 7i/rr+9xxBwxte7xcFHGjoXoSwHT07w= Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-423c28db22eso1591451cf.1 for <linux-mm@kvack.org>; Tue, 28 Nov 2023 12:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701204584; x=1701809384; 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=DfEVXdkb/GhnTpx5X549w2HsA+NyBrmYRSpQS74fM+OMkG/+HzQc0+kavB7OVc0lPK vhHgj1uPydfTdjCK4vKFE0cX6+41NBCXQyZwfbtwJhC+a3AaqMbGvawi5HEgAp5azKB2 4G8rnWQvbOtrem+U7+cf8RsUOV7r5EzvcgVWxkpCC8ZgBzYsg6My+2aqGyJvkvigpvwj E2rhQe8bqHsXo87D/yLyAEPaV/dkE2A8unpr4M4CSoL19Oyyhu2KIyWGq8S4sG1ltvoz Rgv8Q5cbPjGpSq9nNTa4No2oAZJoKHrnVgnt5DFZG8dQ7PWRkWfyHAiHk93bze6UTD0w Lb4g== 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=Zz2rVhXklk06NlnZDQhouGENaFt/50/aVwmb6A1D1TMjJakzxMVzXiitKce4WVKc5z TGHC67jaVViWMshOS9j+AaYljwSbGn1ZaWnsWEoFRKlrxbDN3k9V49/QKIFGLLt4IcvL ZEdW7yxkT5IHw5Tj15X0vXjChQ3PQgBSMAr2IUPpu9duDTeNCVmHzeBEFwyVNRBXjNIF nT0Qe3jNVoO4wtaRLFbORNx/PCTaG72+b55t0O9Okc/YF2fOLWnz5uPkMZZkJ2kygDun WNtgDdq8R38H6qhpOpu3uMJw2JdYsgsjgqhY5AV7YhI9dOj3xx7Dhp2YCUt17t8qsLmE JIqA== X-Gm-Message-State: AOJu0YyKTVCARezBmgctQryilmVKX8xeyoitp+lR7YoXBcbv4si+s/Tr uklK3Jie2j/lQ+iqFwgOL3i6qA== X-Google-Smtp-Source: AGHT+IGsN1gYKfhSPZCpUVGbGKIu06D7uLG0xM+OZwtg49W/WqG56O+xCl6uRGYTfUcoNhDPZKc9YQ== 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-Rspamd-Queue-Id: 15B19140003 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ir7ayih8fiagzej9uubtacyntokzyt57 X-HE-Tag: 1701204584-182290 X-HE-Meta: U2FsdGVkX19sNOJqXfuYWelBgqr/FRdgajoyQN5uGrWKm6GsaJttW2r1tTg60v0kMIzB7XjqZcDil5kpr635ume5bgZ+MVQ6vQ1BB71RBi1ojg/SvNlCluXrbybTUVRsVczIxfo6gVb3LiM1+iT3K1HQK/WsSNc2JTIHyb7jQTfrw+B4LJxtoICXjcHtxzpWAKwTMPHTH/e0vLNY+dy0vqRldyTOIEq6QKr0nbMOYwNkQvF92rV0SdpKqmPouTZ+WsFDNVJjc9FhR58R9Y5Y6dbRw74bdK8dHGW+PmXcSBYZEVQ1RGMEOlko2BHrRrAZZY6hfKcAn/d7c/ZgbNrOW4inulMFFMgy3hegtsHbpAGp7I1VJHrYuDUXk+2XXgaVJLKmiwPSQUfCATkBUpQFk9Hvv+EFHQgx6ZozFhu5dve7Nn3PsDsRfjga49cw8yp0M8ympPjAzA5B5w12Qpq6rX+VCCJH+QHQjcTNsXzQ6inQGGseKGPXHL4E1LLd9Q3IvaFCHeKvgU7TOpV103f/EWNWDrJ4EPCopDxqHVzsXp0fQecLoi8DK8KkkIpqsxPkpiJ4DA+6cvaZzPCTBcXjcjr5KQn1lB5qQ555EwBTf3DC58Db/wDvekmv2BA323zxlF7bNqxiYt5MSeigF+vZwTs/if3rD85twfUymB4XI0QCDfynv6LFwyWuN+FYgaO2hScr8IXLRg8J6z34Ilz7KIqIof1r9iDWc165F/zrMAnq3C589GrHFeIdRUog9YwJb8u2NEZHiJSsu2yHR7wB6W1pDLb+tU7NHjL7lcfzo+52El1YHAZPngb8bfjtUbBhKM5kxNLzAb5UoEE0R7mwetXZQ8Div8EMrni/UIveCI6a21ni6DA16sp26Mk9krSJSwq/AA+xwntUewXwknR86sfUKhdYy1CDQXUvNsX8XpfAWhav0Hi9wx4OWOf/4yN0T59jQfI9HlkmPqyec5O SnNLDexp RIiaBalgYOWrPE0WAsSnLZyGZNd+XDCLNGtA9+qA6NRdt10fqS+0Nh4xTGf+d+A9Z9cBbfxFLTRHXEJauBptCZJNOYA3rVC4wilZrIOrFkk5Xp3TnTLhDJeeJScUG3Diypb/yrOhL4vpUZxztxVjDxys+t3H+ZYKt8OUfDNb/A/BIY8n/l6CjRJNCwQtWPUEp8KuiCEraXCQUSIHo77joPYcnbSCEj18K2QDxPTpNA55h3nGn7GWprT+yz1Kkmd5Wdr8e1siR2Xi0+W/Hjuir6esmqLx4wuLqcUQVnpNxNrqoaxMM4F+ga1dUApNwFSWstS/1cpFvnyAhbh2Ryzoq4z4M6de+aiWaJjVDDt4CF5Tr1FQhi5X/4/CYeiy9/gb69/veGWCnm8eM8+O/a59rnwirjnebr/5lsH8ytyhPwOk30JFiaNfegpAcCstCmb8UqE6h 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
IOMMU memory observability
|
expand
|
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,
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(-)