]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc: Untangle fixmap.h and pgtable.h and mmu.h
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 25 Sep 2023 18:31:21 +0000 (20:31 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 19 Oct 2023 06:12:44 +0000 (17:12 +1100)
fixmap.h need pgtable.h for [un]map_kernel_page()

pgtable.h need fixmap.h for FIXADDR_TOP.

Untangle the two files by moving FIXADDR_TOP into pgtable.h

Also move VIRT_IMMR_BASE to fixmap.h to avoid fixmap.h in mmu.h

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/5eba12392a018be28ad0a02ed844767b132589e7.1695659959.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/book3s/32/pgtable.h
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/include/asm/fixmap.h
arch/powerpc/include/asm/nohash/32/mmu-8xx.h
arch/powerpc/include/asm/nohash/32/pgtable.h
arch/powerpc/include/asm/nohash/64/pgtable.h
arch/powerpc/mm/init_32.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/nohash/8xx.c
arch/powerpc/platforms/83xx/misc.c
arch/powerpc/platforms/8xx/cpm1.c

index 543c3691839b7fbfa352f1f95bcc4a008c743acd..45b69ae2631e072ff48ec52c33be981497ccabae 100644 (file)
@@ -170,7 +170,14 @@ void unmap_kernel_page(unsigned long va);
  * value (for now) on others, from where we can start layout kernel
  * virtual space that goes below PKMAP and FIXMAP
  */
-#include <asm/fixmap.h>
+
+#define FIXADDR_SIZE   0
+#ifdef CONFIG_KASAN
+#include <asm/kasan.h>
+#define FIXADDR_TOP    (KASAN_SHADOW_START - PAGE_SIZE)
+#else
+#define FIXADDR_TOP    ((unsigned long)(-PAGE_SIZE))
+#endif
 
 /*
  * ioremap_bot starts at that address. Early ioremaps move down from there,
index 7c4ad1e03a49c4896653404e4c558471009a0938..dbd545e73161ab620680ce5ff155748c37d72a8c 100644 (file)
@@ -316,6 +316,7 @@ extern unsigned long pci_io_base;
 #define IOREMAP_START  (ioremap_bot)
 #define IOREMAP_END    (KERN_IO_END - FIXADDR_SIZE)
 #define FIXADDR_SIZE   SZ_32M
+#define FIXADDR_TOP    (IOREMAP_END + FIXADDR_SIZE)
 
 #ifndef __ASSEMBLY__
 
index a832aeafe560153535cc486f4ceee0d33a9547a4..f9068dd8dfce7a88c5c5354d645107d09a3e49a4 100644 (file)
 #include <asm/kmap_size.h>
 #endif
 
-#ifdef CONFIG_PPC64
-#define FIXADDR_TOP    (IOREMAP_END + FIXADDR_SIZE)
-#else
-#define FIXADDR_SIZE   0
-#ifdef CONFIG_KASAN
-#include <asm/kasan.h>
-#define FIXADDR_TOP    (KASAN_SHADOW_START - PAGE_SIZE)
-#else
-#define FIXADDR_TOP    ((unsigned long)(-PAGE_SIZE))
-#endif
-#endif
-
 /*
  * Here we define all the compile-time 'special' virtual
  * addresses. The point is to have a constant address at
@@ -119,5 +107,9 @@ static inline void __set_fixmap(enum fixed_addresses idx,
 
 #define __early_set_fixmap     __set_fixmap
 
+#ifdef CONFIG_PPC_8xx
+#define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE))
+#endif
+
 #endif /* !__ASSEMBLY__ */
 #endif
index 0e93a4728c9e15de509432a6f70879a5f0b0a809..141d82e249a868b55cd92626e1a38eb48d0cf9e8 100644 (file)
@@ -188,7 +188,6 @@ typedef struct {
 } mm_context_t;
 
 #define PHYS_IMMR_BASE (mfspr(SPRN_IMMR) & 0xfff80000)
-#define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE))
 
 /* Page size definitions, common between 32 and 64-bit
  *
index 868aecbec8d15e81e69db7d6b3ccaf87e277dddd..c8311ee088116a0b17f7257d8bd1e16ac88b559d 100644 (file)
@@ -71,7 +71,14 @@ void unmap_kernel_page(unsigned long va);
  * value (for now) on others, from where we can start layout kernel
  * virtual space that goes below PKMAP and FIXMAP
  */
-#include <asm/fixmap.h>
+
+#define FIXADDR_SIZE   0
+#ifdef CONFIG_KASAN
+#include <asm/kasan.h>
+#define FIXADDR_TOP    (KASAN_SHADOW_START - PAGE_SIZE)
+#else
+#define FIXADDR_TOP    ((unsigned long)(-PAGE_SIZE))
+#endif
 
 /*
  * ioremap_bot starts at that address. Early ioremaps move down from there,
index 8083c04a1e6daa196c74a9d1ccdd50d8b1b43ace..dee3fc654d4011681bf9ea61cc93b6c41e5215a2 100644 (file)
@@ -57,6 +57,7 @@
 #define IOREMAP_START  (ioremap_bot)
 #define IOREMAP_END    (KERN_IO_START + KERN_IO_SIZE - FIXADDR_SIZE)
 #define FIXADDR_SIZE   SZ_32M
+#define FIXADDR_TOP    (IOREMAP_END + FIXADDR_SIZE)
 
 /*
  * Defines the address of the vmemap area, in its own region on
index d8adc452f4310834842448044d9923046f1f27a2..4e71dfe7d026db2adf11408d88b9130789ac0cbc 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/hugetlb.h>
 #include <asm/kup.h>
 #include <asm/kasan.h>
+#include <asm/fixmap.h>
 
 #include <mm/mmu_decl.h>
 
index 8b121df7b08f8677d72c08fa0d63b1d7509fef96..08f3ec9d522b00634d5d47040c4274e5b1363258 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/ftrace.h>
 #include <asm/code-patching.h>
 #include <asm/setup.h>
+#include <asm/fixmap.h>
 
 #include <mm/mmu_decl.h>
 
index dbbfe897455dc443e1c804aa2d8ff8ad1a2aab28..bb9c39b449d171f1c3daa6fbfc1d089291b42200 100644 (file)
@@ -10,6 +10,8 @@
 #include <linux/memblock.h>
 #include <linux/hugetlb.h>
 
+#include <asm/fixmap.h>
+
 #include <mm/mmu_decl.h>
 
 #define IMMR_SIZE (FIX_IMMR_SIZE << PAGE_SHIFT)
index 2fb2a85d131fd510503d6945c40b60c791fe47df..1135c1ab923cc120f377a0d98767fef686cad1fe 100644 (file)
@@ -14,6 +14,8 @@
 #include <asm/io.h>
 #include <asm/hw_irq.h>
 #include <asm/ipic.h>
+#include <asm/fixmap.h>
+
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
index ebb5f6a27dbf398b8a905fde2665e0d447cd70c8..b24d4102fbf618efd5723a8704553bc80b537b42 100644 (file)
@@ -40,6 +40,7 @@
 #include <asm/io.h>
 #include <asm/rheap.h>
 #include <asm/cpm.h>
+#include <asm/fixmap.h>
 
 #include <sysdev/fsl_soc.h>