|
10 | 10 | #define BIOS_START_MIN 0x20000U /* 128K, less than this is insane */ |
11 | 11 | #define BIOS_START_MAX 0x9f000U /* 640K, absolute maximum */ |
12 | 12 |
|
13 | | -#ifdef CONFIG_X86_5LEVEL |
14 | 13 | /* __pgtable_l5_enabled needs to be in .data to avoid being cleared along with .bss */ |
15 | 14 | unsigned int __section(".data") __pgtable_l5_enabled; |
16 | 15 | unsigned int __section(".data") pgdir_shift = 39; |
17 | 16 | unsigned int __section(".data") ptrs_per_p4d = 1; |
18 | | -#endif |
19 | 17 |
|
20 | 18 | /* Buffer to preserve trampoline memory */ |
21 | 19 | static char trampoline_save[TRAMPOLINE_32BIT_SIZE]; |
@@ -114,18 +112,13 @@ asmlinkage void configure_5level_paging(struct boot_params *bp, void *pgtable) |
114 | 112 | * Check if LA57 is desired and supported. |
115 | 113 | * |
116 | 114 | * There are several parts to the check: |
117 | | - * - if the kernel supports 5-level paging: CONFIG_X86_5LEVEL=y |
118 | 115 | * - if user asked to disable 5-level paging: no5lvl in cmdline |
119 | 116 | * - if the machine supports 5-level paging: |
120 | 117 | * + CPUID leaf 7 is supported |
121 | 118 | * + the leaf has the feature bit set |
122 | | - * |
123 | | - * That's substitute for boot_cpu_has() in early boot code. |
124 | 119 | */ |
125 | | - if (IS_ENABLED(CONFIG_X86_5LEVEL) && |
126 | | - !cmdline_find_option_bool("no5lvl") && |
127 | | - native_cpuid_eax(0) >= 7 && |
128 | | - (native_cpuid_ecx(7) & (1 << (X86_FEATURE_LA57 & 31)))) { |
| 120 | + if (!cmdline_find_option_bool("no5lvl") && |
| 121 | + native_cpuid_eax(0) >= 7 && (native_cpuid_ecx(7) & BIT(16))) { |
129 | 122 | l5_required = true; |
130 | 123 |
|
131 | 124 | /* Initialize variables for 5-level paging */ |
|
0 commit comments