mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
30ec842660
commit
9849a5697d
|
@ -11,6 +11,7 @@
|
|||
#define _ASM_ARC_HUGEPAGE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
static inline pte_t pmd_pte(pmd_t pmd)
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
#include <asm/page.h>
|
||||
#include <asm/mmu.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
#include <linux/const.h>
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#else
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
#include <asm/memory.h>
|
||||
#include <asm/pgtable-hwdef.h>
|
||||
|
|
|
@ -55,9 +55,13 @@ typedef struct { pteval_t pgprot; } pgprot_t;
|
|||
#define __pgprot(x) ((pgprot_t) { (x) } )
|
||||
|
||||
#if CONFIG_PGTABLE_LEVELS == 2
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
#elif CONFIG_PGTABLE_LEVELS == 3
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
#elif CONFIG_PGTABLE_LEVELS == 4
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_PGTABLE_TYPES_H */
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#ifndef __ASM_AVR32_PGTABLE_2LEVEL_H
|
||||
#define __ASM_AVR32_PGTABLE_2LEVEL_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#define _CRIS_PGTABLE_H
|
||||
|
||||
#include <asm/page.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#ifndef _ASM_PGTABLE_H
|
||||
#define _ASM_PGTABLE_H
|
||||
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
#include <asm/mem-layout.h>
|
||||
#include <asm/setup.h>
|
||||
#include <asm/processor.h>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#ifndef _H8300_PGTABLE_H
|
||||
#define _H8300_PGTABLE_H
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
#include <asm-generic/pgtable.h>
|
||||
#define pgtable_cache_init() do { } while (0)
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
*/
|
||||
#include <linux/swap.h>
|
||||
#include <asm/page.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
/* A handy thing to have if one has the RAM. Declared in head.S */
|
||||
|
|
|
@ -587,8 +587,10 @@ extern struct page *zero_page_memmap_ptr;
|
|||
|
||||
|
||||
#if CONFIG_PGTABLE_LEVELS == 3
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
#endif
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
#include <asm-generic/pgtable.h>
|
||||
|
||||
#endif /* _ASM_IA64_PGTABLE_H */
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#define _METAG_PGTABLE_H
|
||||
|
||||
#include <asm/pgtable-bits.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
/* Invalid regions on Meta: 0x00000000-0x001FFFFF and 0xFFFF0000-0xFFFFFFFF */
|
||||
|
|
|
@ -95,7 +95,8 @@ typedef struct { unsigned long pgd; } pgd_t;
|
|||
# else /* CONFIG_MMU */
|
||||
typedef struct { unsigned long ste[64]; } pmd_t;
|
||||
typedef struct { pmd_t pue[1]; } pud_t;
|
||||
typedef struct { pud_t pge[1]; } pgd_t;
|
||||
typedef struct { pud_t p4e[1]; } p4d_t;
|
||||
typedef struct { p4d_t pge[1]; } pgd_t;
|
||||
# endif /* CONFIG_MMU */
|
||||
|
||||
# define pte_val(x) ((x).pte)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <asm/cachectl.h>
|
||||
#include <asm/fixmap.h>
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
extern int temp_tlb_entry;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <asm/cachectl.h>
|
||||
#include <asm/fixmap.h>
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#if defined(CONFIG_PAGE_SIZE_64KB) && !defined(CONFIG_MIPS_VA_BITS_48)
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
#else
|
||||
|
|
|
@ -57,6 +57,7 @@ typedef struct page *pgtable_t;
|
|||
#define __pgd(x) ((pgd_t) { (x) })
|
||||
#define __pgprot(x) ((pgprot_t) { (x) })
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <asm/tlbflush.h>
|
||||
|
||||
#include <asm/pgtable-bits.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#define FIRST_USER_ADDRESS 0UL
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#ifndef __ASM_OPENRISC_PGTABLE_H
|
||||
#define __ASM_OPENRISC_PGTABLE_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _ASM_POWERPC_BOOK3S_32_PGTABLE_H
|
||||
#define _ASM_POWERPC_BOOK3S_32_PGTABLE_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#include <asm/book3s/32/hash.h>
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
#ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_H_
|
||||
#define _ASM_POWERPC_BOOK3S_64_PGTABLE_H_
|
||||
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <linux/mmdebug.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Common bits between hash and Radix page table
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _ASM_POWERPC_NOHASH_32_PGTABLE_H
|
||||
#define _ASM_POWERPC_NOHASH_32_PGTABLE_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#ifndef _ASM_POWERPC_NOHASH_64_PGTABLE_4K_H
|
||||
#define _ASM_POWERPC_NOHASH_64_PGTABLE_4K_H
|
||||
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
|
||||
/*
|
||||
* Entries per page directory level. The PTE level must use a 64b record
|
||||
* for each page table entry. The PMD and PGD level use a 32b record for
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _ASM_POWERPC_NOHASH_64_PGTABLE_64K_H
|
||||
#define _ASM_POWERPC_NOHASH_64_PGTABLE_64K_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
* the S390 page table tree.
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm_types.h>
|
||||
#include <linux/page-flags.h>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define _ASM_SCORE_PGTABLE_H
|
||||
|
||||
#include <linux/const.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#include <asm/fixmap.h>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef __ASM_SH_PGTABLE_2LEVEL_H
|
||||
#define __ASM_SH_PGTABLE_2LEVEL_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef __ASM_SH_PGTABLE_3LEVEL_H
|
||||
#define __ASM_SH_PGTABLE_3LEVEL_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* the SpitFire page tables.
|
||||
*/
|
||||
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/const.h>
|
||||
#include <asm/types.h>
|
||||
|
|
|
@ -74,6 +74,7 @@ extern unsigned long VMALLOC_RESERVE /* = CONFIG_VMALLOC_RESERVE */;
|
|||
#define MAXMEM (_VMALLOC_START - PAGE_OFFSET)
|
||||
|
||||
/* We have no pmd or pud since we are strictly a two-level page table */
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
static inline int pud_huge_page(pud_t pud) { return 0; }
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* We have no pud since we are a three-level page table. */
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#ifndef __UM_PGTABLE_2LEVEL_H
|
||||
#define __UM_PGTABLE_2LEVEL_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
/* PGDIR_SHIFT determines what a third-level page table entry can map */
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#ifndef __UM_PGTABLE_3LEVEL_H
|
||||
#define __UM_PGTABLE_3LEVEL_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
|
||||
/* PGDIR_SHIFT determines what a third-level page table entry can map */
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#ifndef __UNICORE_PGTABLE_H__
|
||||
#define __UNICORE_PGTABLE_H__
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
#include <asm/cpu-single.h>
|
||||
|
||||
|
|
|
@ -273,6 +273,8 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
|
|||
}
|
||||
|
||||
#if CONFIG_PGTABLE_LEVELS > 3
|
||||
#include <asm-generic/5level-fixup.h>
|
||||
|
||||
typedef struct { pudval_t pud; } pud_t;
|
||||
|
||||
static inline pud_t native_make_pud(pmdval_t val)
|
||||
|
@ -285,6 +287,7 @@ static inline pudval_t native_pud_val(pud_t pud)
|
|||
return pud.pud;
|
||||
}
|
||||
#else
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
|
||||
static inline pudval_t native_pud_val(pud_t pud)
|
||||
|
@ -306,6 +309,7 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
|
|||
return pmd.pmd;
|
||||
}
|
||||
#else
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
static inline pmdval_t native_pmd_val(pmd_t pmd)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#ifndef _XTENSA_PGTABLE_H
|
||||
#define _XTENSA_PGTABLE_H
|
||||
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/kmem_layout.h>
|
||||
|
|
Loading…
Reference in New Issue