linux/arch/x86/kernel
Thomas Gleixner 2066f00e5b x86/topology: Implement topology_is_core_online() to address SMT regression
Christian reported that commit a430c11f40 ("intel_idle: Rescan "dead" SMT
siblings during initialization") broke the use case in which both 'nosmt'
and 'maxcpus' are on the kernel command line because it onlines primary
threads, which were offline due to the maxcpus limit.

The initially proposed fix to skip primary threads in the loop is
inconsistent. While it prevents the primary thread to be onlined, it then
onlines the corresponding hyperthread(s), which does not really make sense.

The CPU iterator in cpuhp_smt_enable() contains a check which excludes all
threads of a core, when the primary thread is offline. The default
implementation is a NOOP and therefore not effective on x86.

Implement topology_is_core_online() on x86 to address this issue. This
makes the behaviour consistent between x86 and PowerPC.

Fixes: a430c11f40 ("intel_idle: Rescan "dead" SMT siblings during initialization")
Fixes: f694481b1d ("ACPI: processor: Rescan "dead" SMT siblings during initialization")
Closes: https://lore.kernel.org/linux-pm/724616a2-6374-4ba3-8ce3-ea9c45e2ae3b@arm.com/
Reported-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/12740505.O9o76ZdvQC@rafael.j.wysocki
2025-09-22 21:25:36 +02:00
..
acpi hyperv-next for v6.16 2025-06-03 08:39:20 -07:00
apic x86/apic: Move apic_update_irq_cfg() call to apic_update_vector() 2025-07-15 11:54:09 +02:00
cpu x86/topology: Implement topology_is_core_online() to address SMT regression 2025-09-22 21:25:36 +02:00
fpu x86/fpu: Fix NULL dereference in avx512_status() 2025-08-11 13:28:07 -07:00
kprobes x86/kprobes: enable EXECMEM_ROX_CACHE for kprobes allocations 2025-08-02 12:06:12 -07:00
.gitignore
Makefile Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
alternative.c Significant patch series in this pull request: 2025-08-05 16:02:07 +03:00
amd_gart_64.c
amd_nb.c x86/cpuid: Set <asm/cpuid/api.h> as the main CPUID header 2025-05-15 18:23:55 +02:00
amd_node.c
aperture_64.c
apm_32.c
asm-offsets.c x86/asm-offsets: Export certain 'struct cpuinfo_x86' fields for 64-bit asm use too 2025-05-15 09:12:07 +02:00
asm-offsets_32.c x86/asm-offsets: Export certain 'struct cpuinfo_x86' fields for 64-bit asm use too 2025-05-15 09:12:07 +02:00
asm-offsets_64.c
audit_64.c
bootflag.c
callthunks.c
cet.c
cfi.c
check.c
cpuid.c
crash.c x86: implement crashkernel cma reservation 2025-07-19 19:08:23 -07:00
crash_dump_32.c
crash_dump_64.c
devicetree.c
doublefault_32.c
dumpstack.c
dumpstack_32.c
dumpstack_64.c
e820.c
early-quirks.c
early_printk.c
ebda.c
eisa.c
espfix_64.c
fred.c
ftrace.c x86/ftrace: enable EXECMEM_ROX_CACHE for ftrace allocations 2025-08-02 12:06:12 -07:00
ftrace_32.S
ftrace_64.S
head32.c
head64.c x86/mm/64: Make 5-level paging support unconditional 2025-05-17 10:38:16 +02:00
head_32.S
head_64.S x86/mm/64: Make 5-level paging support unconditional 2025-05-17 10:38:16 +02:00
hpet.c x86/cpuid: Set <asm/cpuid/api.h> as the main CPUID header 2025-05-15 18:23:55 +02:00
hw_breakpoint.c
i8237.c
i8253.c
i8259.c
ibt_selftest.S
idt.c
io_delay.c
ioport.c x86/iopl: Cure TIF_IO_BITMAP inconsistencies 2025-06-03 15:56:39 +02:00
irq.c x86/irq: Plug vector setup race 2025-08-04 23:34:03 +02:00
irq_32.c
irq_64.c
irq_work.c
irqflags.S
irqinit.c
itmt.c x86/itmt: Add debugfs file to show core priorities 2025-07-07 22:35:51 +02:00
jailhouse.c x86/cpuid: Rename hypervisor_cpuid_base()/for_each_possible_hypervisor_cpuid_base() to cpuid_base_hypervisor()/for_each_possible_cpuid_base_hypervisor() 2025-05-16 10:54:47 +02:00
jump_label.c
kdebugfs.c
kexec-bzimage64.c - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
kgdb.c x86/traps: Initialize DR7 by writing its architectural reset value 2025-06-24 13:15:52 -07:00
ksysfs.c sysfs: treewide: switch back to attribute_group::bin_attrs 2025-06-17 10:44:15 +02:00
kvm.c x86: Handle KCOV __init vs inline mismatches 2025-07-24 16:55:11 -07:00
kvmclock.c
ldt.c
machine_kexec_32.c
machine_kexec_64.c - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
mmconf-fam10h_64.c
module.c Merge commit 'its-for-linus-20250509-merge' into x86/core, to resolve conflicts 2025-05-13 10:47:10 +02:00
mpparse.c
msr.c
nmi.c
nmi_selftest.c
paravirt-spinlocks.c
paravirt.c x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only 2025-05-17 10:38:29 +02:00
pci-dma.c
pcspeaker.c
perf_regs.c
platform-quirks.c
pmem.c
probe_roms.c
process.c Linux 6.16 2025-07-28 07:17:38 +02:00
process.h
process_32.c x86/traps: Initialize DR7 by writing its architectural reset value 2025-06-24 13:15:52 -07:00
process_64.c x86/process: Clear hardware feedback history for AMD processors 2025-07-07 22:30:36 +02:00
ptrace.c x86/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:48 -07:00
pvclock.c
quirks.c
reboot.c
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S
resource.c
rethook.c
rtc.c
setup.c Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
setup_percpu.c
sev_verify_cbit.S
shstk.c
signal.c
signal_32.c x86/fred/signal: Prevent immediate repeat of single step trap on return from SIGTRAP handler 2025-06-09 08:50:58 -07:00
signal_64.c x86/fred/signal: Prevent immediate repeat of single step trap on return from SIGTRAP handler 2025-06-09 08:50:58 -07:00
smp.c x86/smp: PM/hibernate: Split arch_resume_nosmt() 2025-06-07 14:22:56 +02:00
smpboot.c Merge branch 'tip/sched/urgent' 2025-07-14 17:16:28 +02:00
stacktrace.c
static_call.c Merge commit 'its-for-linus-20250509-merge' into x86/core, to resolve conflicts 2025-05-13 10:47:10 +02:00
step.c
sys_ia32.c
sys_x86_64.c
tboot.c
time.c
tls.c
tls.h
trace.c
trace_clock.c
traps.c x86/traps: Initialize DR6 by writing its architectural reset value 2025-06-24 13:15:51 -07:00
tsc.c x86/cpuid: Set <asm/cpuid/api.h> as the main CPUID header 2025-05-15 18:23:55 +02:00
tsc_msr.c
tsc_sync.c
umip.c
unwind_frame.c
unwind_guess.c
unwind_orc.c
uprobes.c
verify_cpu.S
vm86_32.c
vmcore_info_32.c
vmcore_info_64.c
vmlinux.lds.S Merge commit 'its-for-linus-20250509-merge' into x86/core, to resolve conflicts 2025-05-13 10:47:10 +02:00
vsmp_64.c
x86_init.c