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-urgent-2023-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:

- Fix a secondary CPUs enumeration regression caused by creative MADT
APIC table entries on certain systems.

- Fix a race in the NOP-patcher that can spuriously trigger crashes on
bootup.

- Fix a bootup failure regression caused by the parallel bringup code,
caused by firmware inconsistency between the APIC initialization
states of the boot and secondary CPUs, on certain systems.

* tag 'x86-urgent-2023-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/acpi: Handle bogus MADT APIC tables gracefully
x86/alternatives: Disable interrupts and sync when optimizing NOPs in place
x86/alternatives: Sync core before enabling interrupts
x86/smpboot/64: Handle X2APIC BIOS inconsistency gracefully

+29 -3
+1 -1
arch/x86/kernel/acpi/boot.c
··· 293 293 processor->processor_id, /* ACPI ID */ 294 294 processor->lapic_flags & ACPI_MADT_ENABLED); 295 295 296 + has_lapic_cpus = true; 296 297 return 0; 297 298 } 298 299 ··· 1135 1134 if (!count) { 1136 1135 count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC, 1137 1136 acpi_parse_lapic, MAX_LOCAL_APIC); 1138 - has_lapic_cpus = count > 0; 1139 1137 x2count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC, 1140 1138 acpi_parse_x2apic, MAX_LOCAL_APIC); 1141 1139 }
+12 -2
arch/x86/kernel/alternative.c
··· 255 255 } 256 256 } 257 257 258 + static void __init_or_module noinline optimize_nops_inplace(u8 *instr, size_t len) 259 + { 260 + unsigned long flags; 261 + 262 + local_irq_save(flags); 263 + optimize_nops(instr, len); 264 + sync_core(); 265 + local_irq_restore(flags); 266 + } 267 + 258 268 /* 259 269 * In this context, "source" is where the instructions are placed in the 260 270 * section .altinstr_replacement, for example during kernel build by the ··· 448 438 * patch if feature is *NOT* present. 449 439 */ 450 440 if (!boot_cpu_has(a->cpuid) == !(a->flags & ALT_FLAG_NOT)) { 451 - optimize_nops(instr, a->instrlen); 441 + optimize_nops_inplace(instr, a->instrlen); 452 442 continue; 453 443 } 454 444 ··· 1695 1685 } else { 1696 1686 local_irq_save(flags); 1697 1687 memcpy(addr, opcode, len); 1698 - local_irq_restore(flags); 1699 1688 sync_core(); 1689 + local_irq_restore(flags); 1700 1690 1701 1691 /* 1702 1692 * Could also do a CLFLUSH here to speed up CPU recovery; but
+16
arch/x86/kernel/head_64.S
··· 255 255 testl $X2APIC_ENABLE, %eax 256 256 jnz .Lread_apicid_msr 257 257 258 + #ifdef CONFIG_X86_X2APIC 259 + /* 260 + * If system is in X2APIC mode then MMIO base might not be 261 + * mapped causing the MMIO read below to fault. Faults can't 262 + * be handled at that point. 263 + */ 264 + cmpl $0, x2apic_mode(%rip) 265 + jz .Lread_apicid_mmio 266 + 267 + /* Force the AP into X2APIC mode. */ 268 + orl $X2APIC_ENABLE, %eax 269 + wrmsr 270 + jmp .Lread_apicid_msr 271 + #endif 272 + 273 + .Lread_apicid_mmio: 258 274 /* Read the APIC ID from the fix-mapped MMIO space. */ 259 275 movq apic_mmio_base(%rip), %rcx 260 276 addq $APIC_ID, %rcx