From patchwork Tue Nov 28 20:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13471789 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 5AA28C07E97 for ; Tue, 28 Nov 2023 20:50:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 042896B0359; Tue, 28 Nov 2023 15:49:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F35E46B035A; Tue, 28 Nov 2023 15:49:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5FF26B035B; Tue, 28 Nov 2023 15:49:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id BBA666B0359 for ; Tue, 28 Nov 2023 15:49:50 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8B34416039A for ; Tue, 28 Nov 2023 20:49:50 +0000 (UTC) X-FDA: 81508554540.22.E79AEBC Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by imf10.hostedemail.com (Postfix) with ESMTP id BB71FC0023 for ; Tue, 28 Nov 2023 20:49:48 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=ooVgi3pI; spf=pass (imf10.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701204588; 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=jRGmXGqyJzQ9dzCxzy8J7vcwlH74KXpuX5+P/ckDUHQ=; b=FXjAHQm+eptRmKwBH+pMHiJSZiXRZVE/FkXLzUsLa74QnITeyYQcXyGovxZk7pZoFdD2JG s+ToU8PZyGR9JC1Oy+M+HWfUBgzb9jJYzivw0XJMWYoTo0CDoizaXQT9eRDjpmO1Q76i7+ Ht2g4GPhFuuAT5F58jgipquBZ9f6RZ8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701204588; a=rsa-sha256; cv=none; b=EzRLeptSAi83+PEMQ1tVwidoBiGppTlJ26xZhE6GNecUYhP6FWbclGeT6bFpQtSd8P730I ZKiloW6z+B3kzm8v9dbINHYbnWjcD9joEskK5vEixlsItF2nf3p7mvbN8VyLwmLbI8ZqGP OnzpA3GOqhjPw/sV231PJHbiS5eLtWU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=ooVgi3pI; spf=pass (imf10.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-d9caf5cc948so5416666276.0 for ; Tue, 28 Nov 2023 12:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701204588; x=1701809388; 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=jRGmXGqyJzQ9dzCxzy8J7vcwlH74KXpuX5+P/ckDUHQ=; b=ooVgi3pItrRBjZVQrdZabMynphA0FUJuXFdtBru7Ch/sBNWwkniVqRhq6jLPSQk+Sa 2edG+x7pvEQqLOXn9zVEyRiBUNc8PR9BDw8S8Vnb5hMxbq5oki/aBu4x7VvLqmKIgP3z ZpGnuvKK02NdhmMfAW5Bkm8ROQAYyWSqN0LoAcbUVGksGtIDtL2U1l1Nzh66NxWPhGpt mjAYTjVJVjXaR1hPaUmCobC0P0+OIvprQ9udCFDcIuQseLA/gngixcYwdqG11jwBOpDG okjhGSET9pdzMJQXo1hmbYc/wdjXXEKgLhtKVM3DCA/IsqqZw2qesvL3CfDVkyS6e8G5 YyAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701204588; x=1701809388; 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=jRGmXGqyJzQ9dzCxzy8J7vcwlH74KXpuX5+P/ckDUHQ=; b=stSz1gekOAREOAcgGJ4igGIFCz7Z65f/X60F7kc9UP0L/Q56nM+tl0KJ5CgCe9V3lC MqAzrj58/o+ZH8TMYVrIYH/2wjDesGzS35X/BLQc36dNfCa683g14iW3umlZ10e1iNcT m4z7X8ThnccIH66//EOyGwuIPc8uSLexeEEvgFcESDQmsKqWvzLpXofs+ia6ocavVEMe QRGGcDfnyye1SVCOn+YPdJiqtgn1BM71kTOsWogaIDC37vXHemJOcswPzcxVFZklX7/z UUOXWnKVCTYVbKENc4hukEC8WFkE3ZJBP1+nUzLk1oRdGnDU1IsL6SutYjnjjjlP+U+W P7KA== X-Gm-Message-State: AOJu0Yx8cC2uw2JY3bObAGwJ6KrHdZd1TiajYbxhLFN1FgsdPaIs0JU+ a4CPShLbyqygssygLT/NNhi50w== X-Google-Smtp-Source: AGHT+IE78UUsr3+phF/56bFMU/5eN5UKiQDczVpHvT25XLH3DszV1HuF5Eb6PvW6XiPusog1uQd9qQ== X-Received: by 2002:a05:6902:20f:b0:da0:c615:e4a6 with SMTP id j15-20020a056902020f00b00da0c615e4a6mr16658576ybs.24.1701204587831; Tue, 28 Nov 2023 12:49:47 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 12:49:47 -0800 (PST) From: Pasha Tatashin 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 07/16] iommu/exynos: use page allocation function provided by iommu-pages.h Date: Tue, 28 Nov 2023 20:49:29 +0000 Message-ID: <20231128204938.1453583-8-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 X-Stat-Signature: pn5xrucyi48o5tdcqnqtraze4us5ogdb X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BB71FC0023 X-Rspam-User: X-HE-Tag: 1701204588-848166 X-HE-Meta: U2FsdGVkX19oBh+5J77ZoKrvwCxTCp6LlZyvHTF6WKVFscbIy64jIsFXKpvvViMfgvGP89s1EN3iM/WQED1xTcmGx8aWtTmaotiUBRdNEK1Rwd8usOlNkcRrQHVLAjS2akcJZgAe+kuxzEO14uOZ3Q5Dah4iV7t5F/+nDiEox+h6FSqX7p7PvV5panqCLb7xc1tgvXltnsJXanNvhRL2sJvufVBmTI2zKg56noBjFgOfT6lrtPx26vv+LZtlPhRTzJcZ3xxK8fRNLYF+/D7bLe0atg8rdKhJ5lFPFVbc6cUsmoz793DRsvZxMGV4lU//OfhfrX+9lmkAzGGTA4UJ6pZNbtyisX4eo18csM7OF5EcD0gum4VWYFVXKO4T9I+TqOqkXlLqrYsNDXIc1WkiaDSQ1ex96Nqc00/c8likwfrGksqBQFzBm/DkUEAaVpFDHYQUyQBSY1A1vXn1efta3RSgoLmxcDmQQiUl4im5xhCL1oZhBHt0HqzOo2ZpTdGjjyViJAOa6NemHj3G/m0Tiyc2X3qHMJwqDp7P2OyISEvJ6liQ8KnKrHEX+BsVcfVq5dpndRKV9OsrNCV7Sp3rgbOllPNm3AEJGFX3GT/Qt4beXrViLdzqwjGJjM8I5rUb4VgpJDwas9FSv/dCpz4f0dmUFfPv8Or2tyofQS3tgh/UI9cUf9Q4tZZLHJdxSsm1j5V/0+ndOnOEEbyJpN+ZZuAUZXxFJW47euimLJLgApoLVj+apI3eU9bBigxrGb2lccq7p5gmKfpIkos8aQiGMlUr0dFlh+HokvYYUrgAF06oK6KTW6c/x1Zx4YO90DRUAyUofLOh2D1QrTjHqRPZxZnJRBzi6LOpIoKpDO2OB+Lqzde8Wzlk4JMUX6aJcBkPSzUWMss6kjHsG/eE7PD0nhzRM9AZSIZ5Jw4YAGvoaiEwSiSqt7BOt9aaXL9XGfpu1CYVJZlNmeDq8l/YH3R NHYEQq44 xyoDSZ48HPUqlKAomgeJ+56SawTD/DbQePZJTMMvKDrl8utprnBn3k69t2GDq2mY8lk8Z0KC/6sSo1zFgvaPK4PJno1uxGdebAton1aRd/21N4HpN1UW17k2IjgJwIcMDT2T5ud1qP1fYLhHGwk37F9SNp17fIUi41e10Hl4+NdZrzVMwMerMNBDPFiWAQMEonPlMBRN7ZgUIdW9n9C27U3Upd/7l/xVyFHlfde6N9GowVDszhPyVdsYnW+6qyoRUAYDhunAd/DTTf8pWpxz7gqyKNGsZCGpTRp+Bj20c1ojgQ4971t/2VhEewv/caGd2ue6KLXbJFhvGP2qaW6YmNkYoevtnqiIyErqJiF7DlORCzGfIB9EMYgpWxKCXJkiStZFwyN0SBRR4c8ZMGFDitxkg4l8GH+sbT7ZR6+N0LBO4BBWVEugwh+Bs3ns/fV/YWBac 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/exynos-iommu.c to use the new page allocation functions provided in iommu-pages.h. Signed-off-by: Pasha Tatashin --- drivers/iommu/exynos-iommu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 2c6e9094f1e9..3eab0ae65a4f 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -22,6 +22,8 @@ #include #include +#include "iommu-pages.h" + typedef u32 sysmmu_iova_t; typedef u32 sysmmu_pte_t; static struct iommu_domain exynos_identity_domain; @@ -900,11 +902,11 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) if (!domain) return NULL; - domain->pgtable = (sysmmu_pte_t *)__get_free_pages(GFP_KERNEL, 2); + domain->pgtable = iommu_alloc_pages(GFP_KERNEL, 2); if (!domain->pgtable) goto err_pgtable; - domain->lv2entcnt = (short *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1); + domain->lv2entcnt = iommu_alloc_pages(GFP_KERNEL, 1); if (!domain->lv2entcnt) goto err_counter; @@ -930,9 +932,9 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) return &domain->domain; err_lv2ent: - free_pages((unsigned long)domain->lv2entcnt, 1); + iommu_free_pages(domain->lv2entcnt, 1); err_counter: - free_pages((unsigned long)domain->pgtable, 2); + iommu_free_pages(domain->pgtable, 2); err_pgtable: kfree(domain); return NULL; @@ -973,8 +975,8 @@ static void exynos_iommu_domain_free(struct iommu_domain *iommu_domain) phys_to_virt(base)); } - free_pages((unsigned long)domain->pgtable, 2); - free_pages((unsigned long)domain->lv2entcnt, 1); + iommu_free_pages(domain->pgtable, 2); + iommu_free_pages(domain->lv2entcnt, 1); kfree(domain); }