linux/arch/x86/include/asm
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
..
amd
cpuid
e820
fpu
numachip
shared
trace
uv
vdso
xen compiler: remove __ADDRESSABLE_ASM{_STR,}() again 2025-08-18 14:48:16 +02:00
GEN-for-each-reg.h
Kbuild
acenv.h
acpi.h x86: Handle KCOV __init vs inline mismatches 2025-07-24 16:55:11 -07:00
acrn.h
agp.h
alternative.h
apic.h x86/apic: Rename 'reg_off' to 'reg' 2025-07-10 09:44:44 -07:00
apicdef.h
apm.h
arch_hweight.h
archrandom.h
asm-offsets.h
asm-prototypes.h
asm.h
atomic.h
atomic64_32.h
atomic64_64.h
audit.h
barrier.h
bios_ebda.h
bitops.h
boot.h
bootparam_utils.h
bug.h x86/bug: Add ARCH_WARN_ASM macro for BUG/WARN asm code sharing with Rust 2025-07-22 23:58:55 +02:00
bugs.h
cache.h
cacheflush.h
cacheinfo.h
ce4100.h
cfi.h cfi: Move BPF CFI types and helpers to generic code 2025-07-31 18:23:53 -07:00
checksum.h
checksum_32.h
checksum_64.h
clocksource.h
cmdline.h
cmpxchg.h
cmpxchg_32.h
cmpxchg_64.h
coco.h
compat.h
cpu.h
cpu_device_id.h
cpu_entry_area.h
cpufeature.h
cpufeatures.h Mitigate VMSCAPE issue with indirect branch predictor flushes 2025-09-10 20:52:16 -07:00
cpuidle_haltpoll.h
cpumask.h
crash.h
crash_reserve.h
current.h
debugreg.h
delay.h
desc.h
desc_defs.h
device.h
div64.h
dma-mapping.h
dma.h
dmi.h
doublefault.h
dwarf2.h
edac.h
efi.h
elf.h
elfcore-compat.h
emergency-restart.h
emulate_prefix.h
enclu.h
entry-common.h x86/vmscape: Add conditional IBPB mitigation 2025-08-14 10:37:18 -07:00
espfix.h
exec.h
extable.h
extable_fixup_types.h
fixmap.h
floppy.h
fpu.h
frame.h
fred.h
fsgsbase.h
ftrace.h
futex.h
gart.h
genapic.h
geode.h
gsseg.h
hardirq.h
highmem.h
hpet.h
hugetlb.h
hw_breakpoint.h
hw_irq.h x86/irq: Plug vector setup race 2025-08-04 23:34:03 +02:00
hyperv_timer.h
hypervisor.h
i8259.h
ia32.h
ibt.h
idtentry.h
imr.h
inat.h
inat_types.h
init.h compiler_types: Provide __no_kstack_erase to disable coverage only on Clang 2025-07-29 17:19:35 -07:00
insn-eval.h
insn.h
inst.h
intel-family.h x86/cpu: Add new Intel CPU model numbers for Wildcatlake and Novalake 2025-08-01 18:22:34 +02:00
intel-mid.h
intel_ds.h
intel_pt.h
intel_punit_ipc.h
intel_telemetry.h
invpcid.h
io.h
io_apic.h
io_bitmap.h
iomap.h
iommu.h
iosf_mbi.h
irq.h
irq_remapping.h
irq_stack.h
irq_vectors.h
irq_work.h
irqdomain.h
irqflags.h
ist.h
jailhouse_para.h
jump_label.h
kasan.h
kaslr.h
kbdleds.h
kdebug.h
kexec-bzimage64.h
kexec.h
kfence.h
kgdb.h
kmsan.h
kprobes.h
kvm-x86-ops.h Merge tag 'kvm-x86-misc-6.17' of https://github.com/kvm-x86/linux into HEAD 2025-07-29 08:36:43 -04:00
kvm-x86-pmu-ops.h
kvm_host.h Merge tag 'kvm-x86-mmu-6.17' of https://github.com/kvm-x86/linux into HEAD 2025-07-29 08:36:43 -04:00
kvm_page_track.h
kvm_para.h
kvm_types.h
kvm_vcpu_regs.h
kvmclock.h
linkage.h
local.h
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h
mce.h
mem_encrypt.h
memtype.h
microcode.h
misc.h
mman.h
mmconfig.h
mmu.h
mmu_context.h
module.h
mpspec.h
mpspec_def.h
mshyperv.h x86/hyperv: Expose hv_map_msi_interrupt() 2025-07-15 06:24:16 +00:00
msi.h
msr-index.h ARM: 2025-07-30 17:14:01 -07:00
msr-trace.h
msr.h
mtrr.h
mwait.h
nmi.h
nops.h
nospec-branch.h x86/vmscape: Add conditional IBPB mitigation 2025-08-14 10:37:18 -07:00
numa.h
olpc.h
olpc_ofw.h
orc_header.h
orc_lookup.h
orc_types.h
page.h
page_32.h
page_32_types.h
page_64.h
page_64_types.h
page_types.h
paravirt.h
paravirt_api_clock.h
paravirt_types.h
parport.h
pc-conf-reg.h
pci-direct.h
pci-functions.h
pci.h
pci_x86.h
percpu.h
perf_event.h
perf_event_p4.h
pgalloc.h
pgtable-2level.h
pgtable-2level_types.h
pgtable-3level.h
pgtable-3level_types.h
pgtable-invert.h
pgtable.h mm: remove devmap related functions and page table bits 2025-07-09 22:42:18 -07:00
pgtable_32.h
pgtable_32_areas.h
pgtable_32_types.h
pgtable_64.h
pgtable_64_types.h x86/mm/64: define ARCH_PAGE_TABLE_SYNC_MASK and arch_sync_kernel_mappings() 2025-08-27 22:45:44 -07:00
pgtable_areas.h
pgtable_types.h Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
pkeys.h
pkru.h
platform_sst_audio.h
pm-trace.h
posix_types.h
posted_intr.h
preempt.h
probe_roms.h
processor-cyrix.h
processor-flags.h
processor.h
prom.h
proto.h
pti.h
ptrace.h
purgatory.h
pvclock-abi.h
pvclock.h
qrwlock.h
qspinlock.h
qspinlock_paravirt.h
realmode.h x86: Handle KCOV __init vs inline mismatches 2025-07-24 16:55:11 -07:00
reboot.h
reboot_fixups.h
resctrl.h
rmwcc.h
rqspinlock.h
runtime-const.h
seccomp.h
sections.h
segment.h
serial.h
set_memory.h
setup.h
setup_arch.h
setup_data.h
sev-common.h
sev-internal.h
sev.h x86/sev: Guard sev_evict_cache() with CONFIG_AMD_MEM_ENCRYPT 2025-09-15 18:29:43 +02:00
sgx.h
shmparam.h
shstk.h
sigcontext.h
sigframe.h
sighandling.h
signal.h
simd.h
smap.h
smp.h x86/lib: Add WBINVD and WBNOINVD helpers to target multiple CPUs 2025-07-10 13:30:17 +02:00
softirq_stack.h
sparsemem.h
spec-ctrl.h
special_insns.h x86/lib: Add WBNOINVD helper functions 2025-07-10 13:23:10 +02:00
spinlock.h
spinlock_types.h
stackprotector.h
stacktrace.h
static_call.h
string.h
string_32.h
string_64.h
suspend.h
suspend_32.h
suspend_64.h
svm.h
switch_to.h
sync_bitops.h
sync_core.h
syscall.h
syscall_wrapper.h
syscalls.h
tdx.h
tdx_global_metadata.h
text-patching.h
thermal.h
thread_info.h
time.h
timer.h
timex.h
tlb.h
tlbbatch.h
tlbflush.h mm: remove arch_flush_tlb_batched_pending() arch helper 2025-07-24 19:12:32 -07:00
topology.h x86/topology: Implement topology_is_core_online() to address SMT regression 2025-09-22 21:25:36 +02:00
trace_clock.h
trap_pf.h
trapnr.h
traps.h
tsc.h
uaccess.h
uaccess_32.h
uaccess_64.h
umip.h
unaccepted_memory.h
unistd.h
unwind.h
unwind_hints.h
uprobes.h
user.h
user32.h
user_32.h
user_64.h
vdso.h
vermagic.h
vga.h
vgtod.h
video.h
vm86.h
vmalloc.h
vmware.h
vmx.h
vmxfeatures.h
vsyscall.h
word-at-a-time.h
x86_init.h
xor.h
xor_32.h
xor_64.h
xor_avx.h