Skip to content

Commit 5668a64

Browse files
committed
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 ...
2 parents 36ae1c4 + 2a11e14 commit 5668a64

8 files changed

Lines changed: 283 additions & 254 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ Kernel parameters
125125
may result in duplicate corrected error reports.
126126
nospcr -- disable console in ACPI SPCR table as
127127
default _serial_ console on ARM64
128+
spcr -- enable console in ACPI SPCR table as
129+
default _serial_ console on x86
128130
For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
129131
"acpi=nospcr" are available
130132
For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"

arch/x86/include/asm/e820/api.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ extern bool e820__mapped_all(u64 start, u64 end, enum e820_type type);
1616

1717
extern void e820__range_add (u64 start, u64 size, enum e820_type type);
1818
extern u64 e820__range_update(u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
19-
extern u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type);
19+
extern void e820__range_remove(u64 start, u64 size, enum e820_type filter_type);
2020
extern u64 e820__range_update_table(struct e820_table *t, u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
2121

22-
extern void e820__print_table(char *who);
2322
extern int e820__update_table(struct e820_table *table);
2423
extern void e820__update_table_print(void);
2524

arch/x86/include/asm/e820/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct e820_entry {
8383
* The whole array of E820 entries:
8484
*/
8585
struct e820_table {
86-
__u32 nr_entries;
86+
u32 nr_entries;
8787
struct e820_entry entries[E820_MAX_ENTRIES];
8888
};
8989

arch/x86/kernel/acpi/boot.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <asm/smp.h>
3636
#include <asm/i8259.h>
3737
#include <asm/setup.h>
38+
#include <asm/hypervisor.h>
3839

3940
#include "sleep.h" /* To include x86_acpi_suspend_lowlevel */
4041
static int __initdata acpi_force = 0;
@@ -47,7 +48,8 @@ EXPORT_SYMBOL(acpi_disabled);
4748

4849
int acpi_noirq; /* skip ACPI IRQ initialization */
4950
static int acpi_nobgrt; /* skip ACPI BGRT */
50-
int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
51+
static int acpi_spcr_add __initdata; /* add SPCR-provided console */
52+
int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
5153
EXPORT_SYMBOL(acpi_pci_disabled);
5254

5355
int acpi_lapic;
@@ -164,11 +166,14 @@ static bool __init acpi_is_processor_usable(u32 lapic_flags)
164166
if (lapic_flags & ACPI_MADT_ENABLED)
165167
return true;
166168

167-
if (!acpi_support_online_capable ||
168-
(lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
169-
return true;
169+
if (acpi_support_online_capable)
170+
return lapic_flags & ACPI_MADT_ONLINE_CAPABLE;
170171

171-
return false;
172+
/*
173+
* QEMU expects legacy "Enabled=0" LAPIC entries to be counted as usable
174+
* in order to support CPU hotplug in guests.
175+
*/
176+
return !hypervisor_is_type(X86_HYPER_NATIVE);
172177
}
173178

174179
static int __init
@@ -1665,8 +1670,8 @@ int __init acpi_boot_init(void)
16651670
if (!acpi_noirq)
16661671
x86_init.pci.init = pci_acpi_init;
16671672

1668-
/* Do not enable ACPI SPCR console by default */
1669-
acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
1673+
acpi_parse_spcr(earlycon_acpi_spcr_enable, acpi_spcr_add);
1674+
16701675
return 0;
16711676
}
16721677

@@ -1703,6 +1708,10 @@ static int __init parse_acpi(char *arg)
17031708
/* "acpi=nocmcff" disables FF mode for corrected errors */
17041709
else if (strcmp(arg, "nocmcff") == 0) {
17051710
acpi_disable_cmcff = 1;
1711+
}
1712+
/* "acpi=spcr" adds the SPCR-provided console as a preferred one */
1713+
else if (strcmp(arg, "spcr") == 0) {
1714+
acpi_spcr_add = 1;
17061715
} else {
17071716
/* Core will printk when we return error. */
17081717
return -EINVAL;

arch/x86/kernel/cpu/topology.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <xen/xen.h>
2828

2929
#include <asm/apic.h>
30-
#include <asm/hypervisor.h>
3130
#include <asm/io_apic.h>
3231
#include <asm/mpspec.h>
3332
#include <asm/msr.h>
@@ -236,20 +235,6 @@ static __init void topo_register_apic(u32 apic_id, u32 acpi_id, bool present)
236235
cpuid_to_apicid[cpu] = apic_id;
237236
topo_set_cpuids(cpu, apic_id, acpi_id);
238237
} else {
239-
u32 pkgid = topo_apicid(apic_id, TOPO_PKG_DOMAIN);
240-
241-
/*
242-
* Check for present APICs in the same package when running
243-
* on bare metal. Allow the bogosity in a guest.
244-
*/
245-
if (hypervisor_is_type(X86_HYPER_NATIVE) &&
246-
topo_unit_count(pkgid, TOPO_PKG_DOMAIN, phys_cpu_present_map)) {
247-
pr_info_once("Ignoring hot-pluggable APIC ID %x in present package.\n",
248-
apic_id);
249-
topo_info.nr_rejected_cpus++;
250-
return;
251-
}
252-
253238
topo_info.nr_disabled_cpus++;
254239
}
255240

0 commit comments

Comments
 (0)