Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86-boot-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 boot updates from Ingo Molnar:

- Robustify/fix calling startup_{32,64}() from the decompressor code,
and removing x86 quirk from scripts/head-object-list.txt as a result.

- Do not register processors that cannot be onlined for x2APIC

* tag 'x86-boot-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/acpi/boot: Do not register processors that cannot be onlined for x2APIC
scripts/head-object-list: Remove x86 from the list
x86/boot: Robustify calling startup_{32,64}() from the decompressor code

+29 -18
+1 -1
arch/x86/boot/compressed/head_32.S
··· 187 187 leal boot_heap@GOTOFF(%ebx), %eax 188 188 pushl %eax /* heap area */ 189 189 pushl %esi /* real mode pointer */ 190 - call extract_kernel /* returns kernel location in %eax */ 190 + call extract_kernel /* returns kernel entry point in %eax */ 191 191 addl $24, %esp 192 192 193 193 /*
+1 -1
arch/x86/boot/compressed/head_64.S
··· 569 569 movl input_len(%rip), %ecx /* input_len */ 570 570 movq %rbp, %r8 /* output target address */ 571 571 movl output_len(%rip), %r9d /* decompressed length, end of relocs */ 572 - call extract_kernel /* returns kernel location in %rax */ 572 + call extract_kernel /* returns kernel entry point in %rax */ 573 573 popq %rsi 574 574 575 575 /*
+11 -7
arch/x86/boot/compressed/misc.c
··· 277 277 { } 278 278 #endif 279 279 280 - static void parse_elf(void *output) 280 + static size_t parse_elf(void *output) 281 281 { 282 282 #ifdef CONFIG_X86_64 283 283 Elf64_Ehdr ehdr; ··· 293 293 if (ehdr.e_ident[EI_MAG0] != ELFMAG0 || 294 294 ehdr.e_ident[EI_MAG1] != ELFMAG1 || 295 295 ehdr.e_ident[EI_MAG2] != ELFMAG2 || 296 - ehdr.e_ident[EI_MAG3] != ELFMAG3) { 296 + ehdr.e_ident[EI_MAG3] != ELFMAG3) 297 297 error("Kernel is not a valid ELF file"); 298 - return; 299 - } 300 298 301 299 debug_putstr("Parsing ELF... "); 302 300 ··· 326 328 } 327 329 328 330 free(phdrs); 331 + 332 + return ehdr.e_entry - LOAD_PHYSICAL_ADDR; 329 333 } 330 334 331 335 /* ··· 356 356 const unsigned long kernel_total_size = VO__end - VO__text; 357 357 unsigned long virt_addr = LOAD_PHYSICAL_ADDR; 358 358 unsigned long needed_size; 359 + size_t entry_offset; 359 360 360 361 /* Retain x86 boot parameters pointer passed from startup_32/64. */ 361 362 boot_params = rmode; ··· 457 456 debug_putstr("\nDecompressing Linux... "); 458 457 __decompress(input_data, input_len, NULL, NULL, output, output_len, 459 458 NULL, error); 460 - parse_elf(output); 459 + entry_offset = parse_elf(output); 461 460 handle_relocations(output, output_len, virt_addr); 462 - debug_putstr("done.\nBooting the kernel.\n"); 461 + 462 + debug_putstr("done.\nBooting the kernel (entry_offset: 0x"); 463 + debug_puthex(entry_offset); 464 + debug_putstr(").\n"); 463 465 464 466 /* Disable exception handling before booting the kernel */ 465 467 cleanup_exception_handling(); 466 468 467 - return output; 469 + return output + entry_offset; 468 470 } 469 471 470 472 void fortify_panic(const char *name)
+16 -3
arch/x86/kernel/acpi/boot.c
··· 188 188 return cpu; 189 189 } 190 190 191 + static bool __init acpi_is_processor_usable(u32 lapic_flags) 192 + { 193 + if (lapic_flags & ACPI_MADT_ENABLED) 194 + return true; 195 + 196 + if (acpi_support_online_capable && (lapic_flags & ACPI_MADT_ONLINE_CAPABLE)) 197 + return true; 198 + 199 + return false; 200 + } 201 + 191 202 static int __init 192 203 acpi_parse_x2apic(union acpi_subtable_headers *header, const unsigned long end) 193 204 { ··· 221 210 222 211 /* Ignore invalid ID */ 223 212 if (apic_id == 0xffffffff) 213 + return 0; 214 + 215 + /* don't register processors that cannot be onlined */ 216 + if (!acpi_is_processor_usable(processor->lapic_flags)) 224 217 return 0; 225 218 226 219 /* ··· 265 250 return 0; 266 251 267 252 /* don't register processors that can not be onlined */ 268 - if (acpi_support_online_capable && 269 - !(processor->lapic_flags & ACPI_MADT_ENABLED) && 270 - !(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE)) 253 + if (!acpi_is_processor_usable(processor->lapic_flags)) 271 254 return 0; 272 255 273 256 /*
-6
scripts/head-object-list.txt
··· 42 42 arch/sh/kernel/head_32.o 43 43 arch/sparc/kernel/head_32.o 44 44 arch/sparc/kernel/head_64.o 45 - arch/x86/kernel/head_32.o 46 - arch/x86/kernel/head_64.o 47 - arch/x86/kernel/head32.o 48 - arch/x86/kernel/head64.o 49 - arch/x86/kernel/ebda.o 50 - arch/x86/kernel/platform-quirks.o 51 45 arch/xtensa/kernel/head.o