]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ARM: mm: rename PGD helpers
authorKevin Brodsky <kevin.brodsky@arm.com>
Fri, 3 Jan 2025 18:44:13 +0000 (18:44 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 26 Jan 2025 04:22:24 +0000 (20:22 -0800)
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}.

Link: https://lkml.kernel.org/r/20250103184415.2744423-5-kevin.brodsky@arm.com
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/arm/mm/pgd.c

index f8e9bc58a84f08729a9261ca2e50ee78c51c6834..2a1077747758bad7a2da3fd83fb6402595210964 100644 (file)
 #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 @@ no_pmd:
 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 @@ no_pgd:
                p4d_free(mm, p4d);
        }
 #endif
-       __pgd_free(pgd_base);
+       _pgd_free(mm, pgd_base);
 }