x86/mm: Unify pgtable_l5_enabled usage in early boot code
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fri, 18 May 2018 10:35:23 +0000 (13:35 +0300)
committerIngo Molnar <mingo@kernel.org>
Sat, 19 May 2018 09:56:57 +0000 (11:56 +0200)
commitad3fe525b9507d8d750d60e8e5dd8e0c0836fb99
tree9300eaefdeea98b308a87a2ca2995ea0a5fa89b9
parent30bbf728ba91b1e8b0e539126cd105ad7e2fa16a
x86/mm: Unify pgtable_l5_enabled usage in early boot code

Usually pgtable_l5_enabled is defined using cpu_feature_enabled().
cpu_feature_enabled() is not available in early boot code. We use
several different preprocessor tricks to get around it. It's messy.

Unify them all.

If cpu_feature_enabled() is not yet available, USE_EARLY_PGTABLE_L5 can
be defined before all includes. It makes pgtable_l5_enabled rely on
__pgtable_l5_enabled variable instead. This approach fits all early
users.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180518103528.59260-3-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/boot/compressed/kaslr.c
arch/x86/boot/compressed/misc.h
arch/x86/include/asm/pgtable_64_types.h
arch/x86/kernel/head64.c
arch/x86/mm/kasan_init_64.c