aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot/compressed/misc.c')
-rw-r--r--arch/x86/boot/compressed/misc.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 252fee320816..8dd1d5ccae58 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -14,6 +14,7 @@
14 14
15#include "misc.h" 15#include "misc.h"
16#include "error.h" 16#include "error.h"
17#include "pgtable.h"
17#include "../string.h" 18#include "../string.h"
18#include "../voffset.h" 19#include "../voffset.h"
19 20
@@ -169,16 +170,6 @@ void __puthex(unsigned long value)
169 } 170 }
170} 171}
171 172
172static bool l5_supported(void)
173{
174 /* Check if leaf 7 is supported. */
175 if (native_cpuid_eax(0) < 7)
176 return 0;
177
178 /* Check if la57 is supported. */
179 return native_cpuid_ecx(7) & (1 << (X86_FEATURE_LA57 & 31));
180}
181
182#if CONFIG_X86_NEED_RELOCS 173#if CONFIG_X86_NEED_RELOCS
183static void handle_relocations(void *output, unsigned long output_len, 174static void handle_relocations(void *output, unsigned long output_len,
184 unsigned long virt_addr) 175 unsigned long virt_addr)
@@ -376,12 +367,6 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
376 console_init(); 367 console_init();
377 debug_putstr("early console in extract_kernel\n"); 368 debug_putstr("early console in extract_kernel\n");
378 369
379 if (IS_ENABLED(CONFIG_X86_5LEVEL) && !l5_supported()) {
380 error("This linux kernel as configured requires 5-level paging\n"
381 "This CPU does not support the required 'cr4.la57' feature\n"
382 "Unable to boot - please use a kernel appropriate for your CPU\n");
383 }
384
385 free_mem_ptr = heap; /* Heap */ 370 free_mem_ptr = heap; /* Heap */
386 free_mem_end_ptr = heap + BOOT_HEAP_SIZE; 371 free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
387 372
@@ -392,6 +377,11 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
392 debug_putaddr(output_len); 377 debug_putaddr(output_len);
393 debug_putaddr(kernel_total_size); 378 debug_putaddr(kernel_total_size);
394 379
380#ifdef CONFIG_X86_64
381 /* Report address of 32-bit trampoline */
382 debug_putaddr(trampoline_32bit);
383#endif
384
395 /* 385 /*
396 * The memory hole needed for the kernel is the larger of either 386 * The memory hole needed for the kernel is the larger of either
397 * the entire decompressed kernel plus relocation table, or the 387 * the entire decompressed kernel plus relocation table, or the