diff options
author | Kirill A. Shutemov <[email protected]> | 2018-05-18 13:35:23 +0300 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2018-05-19 11:56:57 +0200 |
commit | ad3fe525b9507d8d750d60e8e5dd8e0c0836fb99 (patch) | |
tree | 9300eaefdeea98b308a87a2ca2995ea0a5fa89b9 /arch/x86/mm/kasan_init_64.c | |
parent | 30bbf728ba91b1e8b0e539126cd105ad7e2fa16a (diff) |
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 <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'arch/x86/mm/kasan_init_64.c')
-rw-r--r-- | arch/x86/mm/kasan_init_64.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c index 980dbebd0ca7..340bb9b32e01 100644 --- a/arch/x86/mm/kasan_init_64.c +++ b/arch/x86/mm/kasan_init_64.c @@ -2,10 +2,8 @@ #define DISABLE_BRANCH_PROFILING #define pr_fmt(fmt) "kasan: " fmt -#ifdef CONFIG_X86_5LEVEL -/* Too early to use cpu_feature_enabled() */ -#define pgtable_l5_enabled __pgtable_l5_enabled -#endif +/* cpu_feature_enabled() cannot be used this early */ +#define USE_EARLY_PGTABLE_L5 #include <linux/bootmem.h> #include <linux/kasan.h> |