Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch, mm: convert all architectures to use 5level-fixup.h

If an architecture uses 4level-fixup.h we don't need to do anything as
it includes 5level-fixup.h.

If an architecture uses pgtable-nop*d.h, define __ARCH_USE_5LEVEL_HACK
before inclusion of the header. It makes asm-generic code to use
5level-fixup.h.

If an architecture has 4-level paging or folds levels on its own,
include 5level-fixup.h directly.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kirill A. Shutemov and committed by
Linus Torvalds
9849a569 30ec8426

+46 -1
+1
arch/arc/include/asm/hugepage.h
··· 11 11 #define _ASM_ARC_HUGEPAGE_H 12 12 13 13 #include <linux/types.h> 14 + #define __ARCH_USE_5LEVEL_HACK 14 15 #include <asm-generic/pgtable-nopmd.h> 15 16 16 17 static inline pte_t pmd_pte(pmd_t pmd)
+1
arch/arc/include/asm/pgtable.h
··· 37 37 38 38 #include <asm/page.h> 39 39 #include <asm/mmu.h> 40 + #define __ARCH_USE_5LEVEL_HACK 40 41 #include <asm-generic/pgtable-nopmd.h> 41 42 #include <linux/const.h> 42 43
+1
arch/arm/include/asm/pgtable.h
··· 20 20 21 21 #else 22 22 23 + #define __ARCH_USE_5LEVEL_HACK 23 24 #include <asm-generic/pgtable-nopud.h> 24 25 #include <asm/memory.h> 25 26 #include <asm/pgtable-hwdef.h>
+4
arch/arm64/include/asm/pgtable-types.h
··· 55 55 #define __pgprot(x) ((pgprot_t) { (x) } ) 56 56 57 57 #if CONFIG_PGTABLE_LEVELS == 2 58 + #define __ARCH_USE_5LEVEL_HACK 58 59 #include <asm-generic/pgtable-nopmd.h> 59 60 #elif CONFIG_PGTABLE_LEVELS == 3 61 + #define __ARCH_USE_5LEVEL_HACK 60 62 #include <asm-generic/pgtable-nopud.h> 63 + #elif CONFIG_PGTABLE_LEVELS == 4 64 + #include <asm-generic/5level-fixup.h> 61 65 #endif 62 66 63 67 #endif /* __ASM_PGTABLE_TYPES_H */
+1
arch/avr32/include/asm/pgtable-2level.h
··· 8 8 #ifndef __ASM_AVR32_PGTABLE_2LEVEL_H 9 9 #define __ASM_AVR32_PGTABLE_2LEVEL_H 10 10 11 + #define __ARCH_USE_5LEVEL_HACK 11 12 #include <asm-generic/pgtable-nopmd.h> 12 13 13 14 /*
+1
arch/cris/include/asm/pgtable.h
··· 6 6 #define _CRIS_PGTABLE_H 7 7 8 8 #include <asm/page.h> 9 + #define __ARCH_USE_5LEVEL_HACK 9 10 #include <asm-generic/pgtable-nopmd.h> 10 11 11 12 #ifndef __ASSEMBLY__
+1
arch/frv/include/asm/pgtable.h
··· 16 16 #ifndef _ASM_PGTABLE_H 17 17 #define _ASM_PGTABLE_H 18 18 19 + #include <asm-generic/5level-fixup.h> 19 20 #include <asm/mem-layout.h> 20 21 #include <asm/setup.h> 21 22 #include <asm/processor.h>
+1
arch/h8300/include/asm/pgtable.h
··· 1 1 #ifndef _H8300_PGTABLE_H 2 2 #define _H8300_PGTABLE_H 3 + #define __ARCH_USE_5LEVEL_HACK 3 4 #include <asm-generic/pgtable-nopud.h> 4 5 #include <asm-generic/pgtable.h> 5 6 #define pgtable_cache_init() do { } while (0)
+1
arch/hexagon/include/asm/pgtable.h
··· 26 26 */ 27 27 #include <linux/swap.h> 28 28 #include <asm/page.h> 29 + #define __ARCH_USE_5LEVEL_HACK 29 30 #include <asm-generic/pgtable-nopmd.h> 30 31 31 32 /* A handy thing to have if one has the RAM. Declared in head.S */
+2
arch/ia64/include/asm/pgtable.h
··· 587 587 588 588 589 589 #if CONFIG_PGTABLE_LEVELS == 3 590 + #define __ARCH_USE_5LEVEL_HACK 590 591 #include <asm-generic/pgtable-nopud.h> 591 592 #endif 593 + #include <asm-generic/5level-fixup.h> 592 594 #include <asm-generic/pgtable.h> 593 595 594 596 #endif /* _ASM_IA64_PGTABLE_H */
+1
arch/metag/include/asm/pgtable.h
··· 6 6 #define _METAG_PGTABLE_H 7 7 8 8 #include <asm/pgtable-bits.h> 9 + #define __ARCH_USE_5LEVEL_HACK 9 10 #include <asm-generic/pgtable-nopmd.h> 10 11 11 12 /* Invalid regions on Meta: 0x00000000-0x001FFFFF and 0xFFFF0000-0xFFFFFFFF */
+2 -1
arch/microblaze/include/asm/page.h
··· 95 95 # else /* CONFIG_MMU */ 96 96 typedef struct { unsigned long ste[64]; } pmd_t; 97 97 typedef struct { pmd_t pue[1]; } pud_t; 98 - typedef struct { pud_t pge[1]; } pgd_t; 98 + typedef struct { pud_t p4e[1]; } p4d_t; 99 + typedef struct { p4d_t pge[1]; } pgd_t; 99 100 # endif /* CONFIG_MMU */ 100 101 101 102 # define pte_val(x) ((x).pte)
+1
arch/mips/include/asm/pgtable-32.h
··· 16 16 #include <asm/cachectl.h> 17 17 #include <asm/fixmap.h> 18 18 19 + #define __ARCH_USE_5LEVEL_HACK 19 20 #include <asm-generic/pgtable-nopmd.h> 20 21 21 22 extern int temp_tlb_entry;
+1
arch/mips/include/asm/pgtable-64.h
··· 17 17 #include <asm/cachectl.h> 18 18 #include <asm/fixmap.h> 19 19 20 + #define __ARCH_USE_5LEVEL_HACK 20 21 #if defined(CONFIG_PAGE_SIZE_64KB) && !defined(CONFIG_MIPS_VA_BITS_48) 21 22 #include <asm-generic/pgtable-nopmd.h> 22 23 #else
+1
arch/mn10300/include/asm/page.h
··· 57 57 #define __pgd(x) ((pgd_t) { (x) }) 58 58 #define __pgprot(x) ((pgprot_t) { (x) }) 59 59 60 + #define __ARCH_USE_5LEVEL_HACK 60 61 #include <asm-generic/pgtable-nopmd.h> 61 62 62 63 #endif /* !__ASSEMBLY__ */
+1
arch/nios2/include/asm/pgtable.h
··· 22 22 #include <asm/tlbflush.h> 23 23 24 24 #include <asm/pgtable-bits.h> 25 + #define __ARCH_USE_5LEVEL_HACK 25 26 #include <asm-generic/pgtable-nopmd.h> 26 27 27 28 #define FIRST_USER_ADDRESS 0UL
+1
arch/openrisc/include/asm/pgtable.h
··· 25 25 #ifndef __ASM_OPENRISC_PGTABLE_H 26 26 #define __ASM_OPENRISC_PGTABLE_H 27 27 28 + #define __ARCH_USE_5LEVEL_HACK 28 29 #include <asm-generic/pgtable-nopmd.h> 29 30 30 31 #ifndef __ASSEMBLY__
+1
arch/powerpc/include/asm/book3s/32/pgtable.h
··· 1 1 #ifndef _ASM_POWERPC_BOOK3S_32_PGTABLE_H 2 2 #define _ASM_POWERPC_BOOK3S_32_PGTABLE_H 3 3 4 + #define __ARCH_USE_5LEVEL_HACK 4 5 #include <asm-generic/pgtable-nopmd.h> 5 6 6 7 #include <asm/book3s/32/hash.h>
+3
arch/powerpc/include/asm/book3s/64/pgtable.h
··· 1 1 #ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_H_ 2 2 #define _ASM_POWERPC_BOOK3S_64_PGTABLE_H_ 3 3 4 + #include <asm-generic/5level-fixup.h> 5 + 4 6 #ifndef __ASSEMBLY__ 5 7 #include <linux/mmdebug.h> 6 8 #endif 9 + 7 10 /* 8 11 * Common bits between hash and Radix page table 9 12 */
+1
arch/powerpc/include/asm/nohash/32/pgtable.h
··· 1 1 #ifndef _ASM_POWERPC_NOHASH_32_PGTABLE_H 2 2 #define _ASM_POWERPC_NOHASH_32_PGTABLE_H 3 3 4 + #define __ARCH_USE_5LEVEL_HACK 4 5 #include <asm-generic/pgtable-nopmd.h> 5 6 6 7 #ifndef __ASSEMBLY__
+3
arch/powerpc/include/asm/nohash/64/pgtable-4k.h
··· 1 1 #ifndef _ASM_POWERPC_NOHASH_64_PGTABLE_4K_H 2 2 #define _ASM_POWERPC_NOHASH_64_PGTABLE_4K_H 3 + 4 + #include <asm-generic/5level-fixup.h> 5 + 3 6 /* 4 7 * Entries per page directory level. The PTE level must use a 64b record 5 8 * for each page table entry. The PMD and PGD level use a 32b record for
+1
arch/powerpc/include/asm/nohash/64/pgtable-64k.h
··· 1 1 #ifndef _ASM_POWERPC_NOHASH_64_PGTABLE_64K_H 2 2 #define _ASM_POWERPC_NOHASH_64_PGTABLE_64K_H 3 3 4 + #define __ARCH_USE_5LEVEL_HACK 4 5 #include <asm-generic/pgtable-nopud.h> 5 6 6 7
+1
arch/s390/include/asm/pgtable.h
··· 24 24 * the S390 page table tree. 25 25 */ 26 26 #ifndef __ASSEMBLY__ 27 + #include <asm-generic/5level-fixup.h> 27 28 #include <linux/sched.h> 28 29 #include <linux/mm_types.h> 29 30 #include <linux/page-flags.h>
+1
arch/score/include/asm/pgtable.h
··· 2 2 #define _ASM_SCORE_PGTABLE_H 3 3 4 4 #include <linux/const.h> 5 + #define __ARCH_USE_5LEVEL_HACK 5 6 #include <asm-generic/pgtable-nopmd.h> 6 7 7 8 #include <asm/fixmap.h>
+1
arch/sh/include/asm/pgtable-2level.h
··· 1 1 #ifndef __ASM_SH_PGTABLE_2LEVEL_H 2 2 #define __ASM_SH_PGTABLE_2LEVEL_H 3 3 4 + #define __ARCH_USE_5LEVEL_HACK 4 5 #include <asm-generic/pgtable-nopmd.h> 5 6 6 7 /*
+1
arch/sh/include/asm/pgtable-3level.h
··· 1 1 #ifndef __ASM_SH_PGTABLE_3LEVEL_H 2 2 #define __ASM_SH_PGTABLE_3LEVEL_H 3 3 4 + #define __ARCH_USE_5LEVEL_HACK 4 5 #include <asm-generic/pgtable-nopud.h> 5 6 6 7 /*
+1
arch/sparc/include/asm/pgtable_64.h
··· 12 12 * the SpitFire page tables. 13 13 */ 14 14 15 + #include <asm-generic/5level-fixup.h> 15 16 #include <linux/compiler.h> 16 17 #include <linux/const.h> 17 18 #include <asm/types.h>
+1
arch/tile/include/asm/pgtable_32.h
··· 74 74 #define MAXMEM (_VMALLOC_START - PAGE_OFFSET) 75 75 76 76 /* We have no pmd or pud since we are strictly a two-level page table */ 77 + #define __ARCH_USE_5LEVEL_HACK 77 78 #include <asm-generic/pgtable-nopmd.h> 78 79 79 80 static inline int pud_huge_page(pud_t pud) { return 0; }
+1
arch/tile/include/asm/pgtable_64.h
··· 59 59 #ifndef __ASSEMBLY__ 60 60 61 61 /* We have no pud since we are a three-level page table. */ 62 + #define __ARCH_USE_5LEVEL_HACK 62 63 #include <asm-generic/pgtable-nopud.h> 63 64 64 65 /*
+1
arch/um/include/asm/pgtable-2level.h
··· 8 8 #ifndef __UM_PGTABLE_2LEVEL_H 9 9 #define __UM_PGTABLE_2LEVEL_H 10 10 11 + #define __ARCH_USE_5LEVEL_HACK 11 12 #include <asm-generic/pgtable-nopmd.h> 12 13 13 14 /* PGDIR_SHIFT determines what a third-level page table entry can map */
+1
arch/um/include/asm/pgtable-3level.h
··· 7 7 #ifndef __UM_PGTABLE_3LEVEL_H 8 8 #define __UM_PGTABLE_3LEVEL_H 9 9 10 + #define __ARCH_USE_5LEVEL_HACK 10 11 #include <asm-generic/pgtable-nopud.h> 11 12 12 13 /* PGDIR_SHIFT determines what a third-level page table entry can map */
+1
arch/unicore32/include/asm/pgtable.h
··· 12 12 #ifndef __UNICORE_PGTABLE_H__ 13 13 #define __UNICORE_PGTABLE_H__ 14 14 15 + #define __ARCH_USE_5LEVEL_HACK 15 16 #include <asm-generic/pgtable-nopmd.h> 16 17 #include <asm/cpu-single.h> 17 18
+4
arch/x86/include/asm/pgtable_types.h
··· 273 273 } 274 274 275 275 #if CONFIG_PGTABLE_LEVELS > 3 276 + #include <asm-generic/5level-fixup.h> 277 + 276 278 typedef struct { pudval_t pud; } pud_t; 277 279 278 280 static inline pud_t native_make_pud(pmdval_t val) ··· 287 285 return pud.pud; 288 286 } 289 287 #else 288 + #define __ARCH_USE_5LEVEL_HACK 290 289 #include <asm-generic/pgtable-nopud.h> 291 290 292 291 static inline pudval_t native_pud_val(pud_t pud) ··· 309 306 return pmd.pmd; 310 307 } 311 308 #else 309 + #define __ARCH_USE_5LEVEL_HACK 312 310 #include <asm-generic/pgtable-nopmd.h> 313 311 314 312 static inline pmdval_t native_pmd_val(pmd_t pmd)
+1
arch/xtensa/include/asm/pgtable.h
··· 11 11 #ifndef _XTENSA_PGTABLE_H 12 12 #define _XTENSA_PGTABLE_H 13 13 14 + #define __ARCH_USE_5LEVEL_HACK 14 15 #include <asm-generic/pgtable-nopmd.h> 15 16 #include <asm/page.h> 16 17 #include <asm/kmem_layout.h>