]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
powerpc/32: Remove __map_without_ltlbs
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 14 Jun 2022 10:32:25 +0000 (12:32 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jun 2022 06:59:06 +0000 (16:59 +1000)
__map_without_ltlbs is used only for 40x, and only when
STRICT_KERNEL_RWX, KFENCE or DEBUG_PAGEALLOC is active.

Do the verification directly in 40x version of mmu_mapin_ram()
and remove __map_without_ltlbs from core ppc32.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/3422094db965d218c4c3d8580f526963a9ac897f.1655202721.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/init_32.c
arch/powerpc/mm/nohash/40x.c

index 6f2e6210c273a98802af32d6ec12576247cd5863..62d9af6606cd291c70c72b0b5114d7ceeb8f1b64 100644 (file)
@@ -69,29 +69,9 @@ EXPORT_SYMBOL(agp_special_page);
 
 void MMU_init(void);
 
-int __map_without_ltlbs;
-
 /* max amount of low RAM to map in */
 unsigned long __max_low_memory = MAX_LOW_MEM;
 
-/*
- * Check for command-line options that affect what MMU_init will do.
- */
-static void __init MMU_setup(void)
-{
-       if (IS_ENABLED(CONFIG_PPC_8xx))
-               return;
-
-       if (IS_ENABLED(CONFIG_KFENCE))
-               __map_without_ltlbs = 1;
-
-       if (debug_pagealloc_enabled())
-               __map_without_ltlbs = 1;
-
-       if (strict_kernel_rwx_enabled())
-               __map_without_ltlbs = 1;
-}
-
 /*
  * MMU_init sets up the basic memory mappings for the kernel,
  * including both RAM and possibly some I/O regions,
@@ -102,9 +82,6 @@ void __init MMU_init(void)
        if (ppc_md.progress)
                ppc_md.progress("MMU:enter", 0x111);
 
-       /* parse args from command line */
-       MMU_setup();
-
        /*
         * Reserve gigantic pages for hugetlb.  This MUST occur before
         * lowmem_end_addr is initialized below.
index b32e465a3d526f9031d75e767f8c08c1460bf20d..3684d6e570fb5eac9ec0d7b802b8ba4b3b25e0de 100644 (file)
@@ -43,7 +43,6 @@
 
 #include <mm/mmu_decl.h>
 
-extern int __map_without_ltlbs;
 /*
  * MMU_init_hw does the chip-specific initialization of the MMU hardware.
  */
@@ -94,7 +93,13 @@ unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top)
        p = 0;
        s = total_lowmem;
 
-       if (__map_without_ltlbs)
+       if (IS_ENABLED(CONFIG_KFENCE))
+               return 0;
+
+       if (debug_pagealloc_enabled())
+               return 0;
+
+       if (strict_kernel_rwx_enabled())
                return 0;
 
        while (s >= LARGE_PAGE_SIZE_16M) {