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

Pull x86/boot updates from Ingo Molnar:

 - x86/acpi: Add acpi=spcr to use SPCR-provided default console
   (Shenghao Yang)

 - x86/acpi/boot: Correct the acpi_is_processor_usable() check again
   (Yazen Ghannam)

 - Refresh the x86 memory map (e820 table) handling code, and make the
   printouts a bit more informative (Ingo Molnar)

* tag 'x86-boot-2026-02-09' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits)
  x86/acpi: Add acpi=spcr to use SPCR-provided default console
  x86/boot/e820: Use <linux/sizes.h> symbols for literals
  x86/boot/e820: Make sure e820_search_gap() finds all gaps
  x86/boot/e820: Simplify the e820__range_remove() API
  x86/boot/e820: Remove e820__range_remove()'s unused return parameter
  x86/boot/e820: Simplify append_e820_table() and remove restriction on single-entry tables
  x86/boot/e820: Standardize __init/__initdata tag placement
  x86/boot/e820: Simplify & clarify __e820__range_add() a bit
  x86/boot/e820: Rename gap_start/gap_size to max_gap_start/max_gap_start in e820_search_gap() et al
  x86/boot/e820: Change e820_search_gap() to search for the highest-address PCI gap
  x86/boot/e820: Clean up e820__setup_pci_gap()/e820_search_gap() a bit
  x86/boot/e820: Change struct e820_table::nr_entries type from __u32 to u32
  x86/boot/e820: Standardize e820 table index variable types under 'u32'
  x86/boot/e820: Standardize e820 table index variable names under 'idx'
  x86/boot/e820: Remove unnecessary header inclusions
  x86/boot/e820: Clean up __refdata use a bit
  x86/boot/e820: Clean up __e820__range_add() a bit
  x86/boot/e820: Improve e820_print_type() messages
  x86/boot/e820: Clean up confusing and self-contradictory verbiage around E820 related resource allocations
  x86/boot/e820: Remove pointless early_panic() indirection
  ...
This commit is contained in:
Linus Torvalds
2026-02-10 13:12:54 -08:00
8 changed files with 282 additions and 253 deletions
@@ -125,6 +125,8 @@ Kernel parameters
may result in duplicate corrected error reports.
nospcr -- disable console in ACPI SPCR table as
default _serial_ console on ARM64
spcr -- enable console in ACPI SPCR table as
default _serial_ console on x86
For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
"acpi=nospcr" are available
For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
+1 -2
View File
@@ -16,10 +16,9 @@ extern bool e820__mapped_all(u64 start, u64 end, enum e820_type type);
extern void e820__range_add (u64 start, u64 size, enum e820_type type);
extern u64 e820__range_update(u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
extern u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type);
extern void e820__range_remove(u64 start, u64 size, enum e820_type filter_type);
extern u64 e820__range_update_table(struct e820_table *t, u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
extern void e820__print_table(char *who);
extern int e820__update_table(struct e820_table *table);
extern void e820__update_table_print(void);
+1 -1
View File
@@ -83,7 +83,7 @@ struct e820_entry {
* The whole array of E820 entries:
*/
struct e820_table {
__u32 nr_entries;
u32 nr_entries;
struct e820_entry entries[E820_MAX_ENTRIES];
};
+16 -7
View File
@@ -35,6 +35,7 @@
#include <asm/smp.h>
#include <asm/i8259.h>
#include <asm/setup.h>
#include <asm/hypervisor.h>
#include "sleep.h" /* To include x86_acpi_suspend_lowlevel */
static int __initdata acpi_force = 0;
@@ -47,7 +48,8 @@ EXPORT_SYMBOL(acpi_disabled);
int acpi_noirq; /* skip ACPI IRQ initialization */
static int acpi_nobgrt; /* skip ACPI BGRT */
int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
static int acpi_spcr_add __initdata; /* add SPCR-provided console */
int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
EXPORT_SYMBOL(acpi_pci_disabled);
int acpi_lapic;
@@ -164,11 +166,14 @@ static bool __init acpi_is_processor_usable(u32 lapic_flags)
if (lapic_flags & ACPI_MADT_ENABLED)
return true;
if (!acpi_support_online_capable ||
(lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
return true;
if (acpi_support_online_capable)
return lapic_flags & ACPI_MADT_ONLINE_CAPABLE;
return false;
/*
* QEMU expects legacy "Enabled=0" LAPIC entries to be counted as usable
* in order to support CPU hotplug in guests.
*/
return !hypervisor_is_type(X86_HYPER_NATIVE);
}
static int __init
@@ -1665,8 +1670,8 @@ int __init acpi_boot_init(void)
if (!acpi_noirq)
x86_init.pci.init = pci_acpi_init;
/* Do not enable ACPI SPCR console by default */
acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
acpi_parse_spcr(earlycon_acpi_spcr_enable, acpi_spcr_add);
return 0;
}
@@ -1703,6 +1708,10 @@ static int __init parse_acpi(char *arg)
/* "acpi=nocmcff" disables FF mode for corrected errors */
else if (strcmp(arg, "nocmcff") == 0) {
acpi_disable_cmcff = 1;
}
/* "acpi=spcr" adds the SPCR-provided console as a preferred one */
else if (strcmp(arg, "spcr") == 0) {
acpi_spcr_add = 1;
} else {
/* Core will printk when we return error. */
return -EINVAL;
-15
View File
@@ -27,7 +27,6 @@
#include <xen/xen.h>
#include <asm/apic.h>
#include <asm/hypervisor.h>
#include <asm/io_apic.h>
#include <asm/mpspec.h>
#include <asm/msr.h>
@@ -236,20 +235,6 @@ static __init void topo_register_apic(u32 apic_id, u32 acpi_id, bool present)
cpuid_to_apicid[cpu] = apic_id;
topo_set_cpuids(cpu, apic_id, acpi_id);
} else {
u32 pkgid = topo_apicid(apic_id, TOPO_PKG_DOMAIN);
/*
* Check for present APICs in the same package when running
* on bare metal. Allow the bogosity in a guest.
*/
if (hypervisor_is_type(X86_HYPER_NATIVE) &&
topo_unit_count(pkgid, TOPO_PKG_DOMAIN, phys_cpu_present_map)) {
pr_info_once("Ignoring hot-pluggable APIC ID %x in present package.\n",
apic_id);
topo_info.nr_rejected_cpus++;
return;
}
topo_info.nr_disabled_cpus++;
}
+257 -220
View File
File diff suppressed because it is too large Load Diff
+4 -6
View File
@@ -761,7 +761,7 @@ static void __init trim_bios_range(void)
* area (640Kb -> 1Mb) as RAM even though it is not.
* take them out.
*/
e820__range_remove(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_TYPE_RAM, 1);
e820__range_remove(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_TYPE_RAM);
e820__update_table(e820_table);
}
@@ -783,7 +783,7 @@ static void __init e820_add_kernel_range(void)
return;
pr_warn(".text .data .bss are not marked as E820_TYPE_RAM!\n");
e820__range_remove(start, size, E820_TYPE_RAM, 0);
e820__range_remove(start, size, 0);
e820__range_add(start, size, E820_TYPE_RAM);
}
@@ -1013,11 +1013,9 @@ void __init setup_arch(char **cmdline_p)
trim_bios_range();
#ifdef CONFIG_X86_32
if (ppro_with_ram_bug()) {
e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM,
E820_TYPE_RESERVED);
pr_info("Applying PPro RAM bug workaround: punching 256 kB hole at 1.75 GB physical.\n");
e820__range_update(0x70000000ULL, SZ_256K, E820_TYPE_RAM, E820_TYPE_RESERVED);
e820__update_table(e820_table);
printk(KERN_INFO "fixed physical RAM map:\n");
e820__print_table("bad_ppro");
}
#else
early_gart_iommu_check();
+1 -2
View File
@@ -333,8 +333,7 @@ static void __init efi_remove_e820_mmio(void)
if (size >= 256*1024) {
pr_info("Remove mem%02u: MMIO range=[0x%08llx-0x%08llx] (%lluMB) from e820 map\n",
i, start, end, size >> 20);
e820__range_remove(start, size,
E820_TYPE_RESERVED, 1);
e820__range_remove(start, size, E820_TYPE_RESERVED);
} else {
pr_info("Not removing mem%02u: MMIO range=[0x%08llx-0x%08llx] (%lluKB) from e820 map\n",
i, start, end, size >> 10);