From patchwork Fri Jan 3 18:44:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13925793 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 C6E52E7718F for ; Fri, 3 Jan 2025 18:44:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5DFCE6B0098; Fri, 3 Jan 2025 13:44:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 58FD36B0099; Fri, 3 Jan 2025 13:44:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 457FF6B009B; Fri, 3 Jan 2025 13:44:49 -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 28C706B0098 for ; Fri, 3 Jan 2025 13:44:49 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A7BAFC0A55 for ; Fri, 3 Jan 2025 18:44:48 +0000 (UTC) X-FDA: 82967017056.07.E9FDB61 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf04.hostedemail.com (Postfix) with ESMTP id 2447440012 for ; Fri, 3 Jan 2025 18:44:46 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735929887; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UgvT7pAeV3IIDBflFGuCxx0F4tXh8w8e+aOL3RS3IYM=; b=Ek8JrOzIzBEqGNHi3RyKW2t5Pd2O0rYiy8EdrH6//ABRYhBHy+238Bieahiwu4ZNbhoohk Q+NMvnT1CMHNfJbSBWxJbgp04WRjn/QyY8Djf5CaCoGL3nlI5jBJBrNOXBlN12u4V0wa23 zMMT/c1MBRj83bo2gHvHg6hpU58/JT0= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735929887; a=rsa-sha256; cv=none; b=70w62wJMNEhks82eBl6onNT1nVlRpM04YCZW7qoc4sqYCXljwgmg5EFMMQS79EoWm6LppC Xr0CL54RBQXuVpMFE6SPXs2dYOjBwPmR0nbRAmN0kLfM6DvFkq+21DRhI9LI3SRUw8PJDv RLCqKiKI2juCYI55i2tQbfqB41NWLVI= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92BE9150C; Fri, 3 Jan 2025 10:45:14 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CBB03F673; Fri, 3 Jan 2025 10:44:42 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org Cc: Kevin Brodsky , Andrew Morton , Catalin Marinas , Dave Hansen , Linus Walleij , Andy Lutomirski , Peter Zijlstra , "Mike Rapoport (IBM)" , Ryan Roberts , Thomas Gleixner , Will Deacon , Matthew Wilcox , Qi Zheng , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, loongarch@lists.linux.dev, x86@kernel.org Subject: [PATCH v2 4/6] ARM: mm: Rename PGD helpers Date: Fri, 3 Jan 2025 18:44:13 +0000 Message-ID: <20250103184415.2744423-5-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250103184415.2744423-1-kevin.brodsky@arm.com> References: <20250103184415.2744423-1-kevin.brodsky@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2447440012 X-Stat-Signature: x57esuxw5ztuz15dqqm4eh3rqaziy6ca X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1735929886-290539 X-HE-Meta: U2FsdGVkX19EYD4lW/2ROe6ImHU4ac/FNigaHX7AYwFsQ5CWxxdyTU2JKe4Bhco9RmLmll3O4fP2wM+VTTnzk5SGCy9DqxXHPKopyl5u+FNtlMJcjv1pzIxD/PMoAOkzciXWLoKfF+QAZ5+KTSwVQ7KYGz1YZdrZxAODNlpqjXR2N31egw3TCX+HC1OVtWKA0e091Zkeafgm/06Mt0GwfzraWSvDZ8+1U+MFd7rD8bp+FpIqrGjz7CLsVdoZAbHcjns4uyc4XHVHurMXclkJbzEMpisqsYXplVQsuntRx8BrT9cDT+iiRGQGWNIDw7Y1tqtJR5Vjti/xKF9fka6OK46lT90FpXc0T2RM6GGz7NZsiR7FujpQs1BdrFaRlXGwjrIu02leA5AmfV+vUHV30RZif9O9jNV1CmLtSyQZvoOnVs20KWWGaPlUcGpG3Wq91f34FTNMvV9VHgSVyjNP3n6eu7s5CVeyWekZpqzG6Vgq3y59fDKvgNBVhFx3yvoJzDgkLXnJBb+z8FY2UkEdGtbwwUzTGqMquPWNQS0mSCaiOnF+dK1ZTKpQXVceEILZkavmUajx1Y+5Ggg1JXrdGuAqqnZ5fQ4vWwoqY5J8B9Z/5gyrkd6W381hDU/JtkuEgOry7k7I+xcpSxJuCqcYJXCsrPk/QtV3A7BKiQtLYmF/SmynsheH/2NdPsoBRKmRdHCCJ6eRGdZ5FtDtc4uW8xoZDwInHuJyUCd8suVA/QAY2LfGo//S57P8ytNivF032cMA+aID8QyMk23N4ycE9xOl0r5yhpVeJZDLkgXeuzXQTVvz/Y2MftWzGSVQ/jPluUx29CvI38ZhDkaVYV7z63TfucRGTyGTkSxmUYLC5CpKQoJLzByllURdQA0d8Yfb9PlcxczQ8f+FmOMnbXXLYXhHX6a9mH1zqk4L8zf/4fqcMcLsKvcIWMcgHgHkCsOk/spdSeisbfnWMXX7kO8 ffhfjr7f 3mEb8ZvWO1ulWhCIvLig3/E+1omy49YqUZ7bzaatDWAdKewqk9mgUlCsRlu6MOrLj69JmAFLUg1AX0d/+PJvhJ2n1aFMANe18tu+zQ2Iqxim0o7yQM3LWoe92INYoZe2Ld9lNhdk5d7MsKggHe7UN84+wvTU+I+zVr2FTQGnoADwwc2r6mrZ8BDcMqQ== 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: Generic implementations of __pgd_alloc and __pgd_free are about to be introduced. Rename the macros in arch/arm/mm/pgd.c to avoid clashes. While we're at it, also pass down the mm as argument to those helpers, as it will be needed to call the generic __pgd_{alloc,free}. Acked-by: Dave Hansen Signed-off-by: Kevin Brodsky --- arch/arm/mm/pgd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c index f8e9bc58a84f..2a1077747758 100644 --- a/arch/arm/mm/pgd.c +++ b/arch/arm/mm/pgd.c @@ -17,11 +17,11 @@ #include "mm.h" #ifdef CONFIG_ARM_LPAE -#define __pgd_alloc() kmalloc_array(PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL) -#define __pgd_free(pgd) kfree(pgd) +#define _pgd_alloc(mm) kmalloc_array(PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL) +#define _pgd_free(mm, pgd) kfree(pgd) #else -#define __pgd_alloc() (pgd_t *)__get_free_pages(GFP_KERNEL, 2) -#define __pgd_free(pgd) free_pages((unsigned long)pgd, 2) +#define _pgd_alloc(mm) (pgd_t *)__get_free_pages(GFP_KERNEL, 2) +#define _pgd_free(mm, pgd) free_pages((unsigned long)pgd, 2) #endif /* @@ -35,7 +35,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) pmd_t *new_pmd, *init_pmd; pte_t *new_pte, *init_pte; - new_pgd = __pgd_alloc(); + new_pgd = _pgd_alloc(mm); if (!new_pgd) goto no_pgd; @@ -134,7 +134,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) no_pud: p4d_free(mm, new_p4d); no_p4d: - __pgd_free(new_pgd); + _pgd_free(mm, new_pgd); no_pgd: return NULL; } @@ -207,5 +207,5 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd_base) p4d_free(mm, p4d); } #endif - __pgd_free(pgd_base); + _pgd_free(mm, pgd_base); }