aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/misc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-02 18:45:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-02 18:45:30 -0400
commitd22fff81418edc92be534cad8d59da914049bf69 (patch)
tree96b22b20bbc789a76e744bcfc11a7f0854b62ece /arch/x86/boot/compressed/misc.c
parent986b37c0ae4f0a3f93d8974d03a9cbc1502dd377 (diff)
parenteaeb8e76cd5751e805f6e4a3fcec91d283e3b0c2 (diff)
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm updates from Ingo Molnar: - Extend the memmap= boot parameter syntax to allow the redeclaration and dropping of existing ranges, and to support all e820 range types (Jan H. Schönherr) - Improve the W+X boot time security checks to remove false positive warnings on Xen (Jan Beulich) - Support booting as Xen PVH guest (Juergen Gross) - Improved 5-level paging (LA57) support, in particular it's possible now to have a single kernel image for both 4-level and 5-level hardware (Kirill A. Shutemov) - AMD hardware RAM encryption support (SME/SEV) fixes (Tom Lendacky) - Preparatory commits for hardware-encrypted RAM support on Intel CPUs. (Kirill A. Shutemov) - Improved Intel-MID support (Andy Shevchenko) - Show EFI page tables in page_tables debug files (Andy Lutomirski) - ... plus misc fixes and smaller cleanups * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (56 commits) x86/cpu/tme: Fix spelling: "configuation" -> "configuration" x86/boot: Fix SEV boot failure from change to __PHYSICAL_MASK_SHIFT x86/mm: Update comment in detect_tme() regarding x86_phys_bits x86/mm/32: Remove unused node_memmap_size_bytes() & CONFIG_NEED_NODE_MEMMAP_SIZE logic x86/mm: Remove pointless checks in vmalloc_fault x86/platform/intel-mid: Add special handling for ACPI HW reduced platforms ACPI, x86/boot: Introduce the ->reduced_hw_early_init() ACPI callback ACPI, x86/boot: Split out acpi_generic_reduce_hw_init() and export x86/pconfig: Provide defines and helper to run MKTME_KEY_PROG leaf x86/pconfig: Detect PCONFIG targets x86/tme: Detect if TME and MKTME is activated by BIOS x86/boot/compressed/64: Handle 5-level paging boot if kernel is above 4G x86/boot/compressed/64: Use page table in trampoline memory x86/boot/compressed/64: Use stack from trampoline memory x86/boot/compressed/64: Make sure we have a 32-bit code segment x86/mm: Do not use paravirtualized calls in native_set_p4d() kdump, vmcoreinfo: Export pgtable_l5_enabled value x86/boot/compressed/64: Prepare new top-level page table for trampoline x86/boot/compressed/64: Set up trampoline memory x86/boot/compressed/64: Save and restore trampoline memory ...
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