x86/mm: Make PGDIR_SHIFT and PTRS_PER_P4D variable
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 14 Feb 2018 11:16:53 +0000 (14:16 +0300)
committerIngo Molnar <mingo@kernel.org>
Wed, 14 Feb 2018 12:11:14 +0000 (13:11 +0100)
commitc65e774fb3f6af212641538694b9778ff9ab4300
tree3c4da88dd0658874ea3fc7de3cc96ee27d711ef9
parent5c7919bb1994f8dc7fed219a5db09e6bb9d473a5
x86/mm: Make PGDIR_SHIFT and PTRS_PER_P4D variable

For boot-time switching between 4- and 5-level paging we need to be able
to fold p4d page table level at runtime. It requires variable
PGDIR_SHIFT and PTRS_PER_P4D.

The change doesn't affect the kernel image size much:

   text    data     bss     dec     hex filename
8628091 4734304 1368064 14730459  e0c4db vmlinux.before
8628393 4734340 1368064 14730797  e0c62d vmlinux.after

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180214111656.88514-7-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
13 files changed:
arch/x86/boot/compressed/kaslr.c
arch/x86/include/asm/pgtable_32.h
arch/x86/include/asm/pgtable_64_types.h
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/head64.c
arch/x86/mm/dump_pagetables.c
arch/x86/mm/init_64.c
arch/x86/mm/kasan_init_64.c
arch/x86/platform/efi/efi_64.c
include/asm-generic/5level-fixup.h
include/asm-generic/pgtable-nop4d.h
include/linux/kasan.h
mm/kasan/kasan_init.c