linux/arch/powerpc
Nysal Jan K.A. 0d5c9e901a powerpc/kexec: Enable SMT before waking offline CPUs
commit c2296a1e42 upstream.

If SMT is disabled or a partial SMT state is enabled, when a new kernel
image is loaded for kexec, on reboot the following warning is observed:

kexec: Waking offline cpu 228.
WARNING: CPU: 0 PID: 9062 at arch/powerpc/kexec/core_64.c:223 kexec_prepare_cpus+0x1b0/0x1bc
[snip]
 NIP kexec_prepare_cpus+0x1b0/0x1bc
 LR  kexec_prepare_cpus+0x1a0/0x1bc
 Call Trace:
  kexec_prepare_cpus+0x1a0/0x1bc (unreliable)
  default_machine_kexec+0x160/0x19c
  machine_kexec+0x80/0x88
  kernel_kexec+0xd0/0x118
  __do_sys_reboot+0x210/0x2c4
  system_call_exception+0x124/0x320
  system_call_vectored_common+0x15c/0x2ec

This occurs as add_cpu() fails due to cpu_bootable() returning false for
CPUs that fail the cpu_smt_thread_allowed() check or non primary
threads if SMT is disabled.

Fix the issue by enabling SMT and resetting the number of SMT threads to
the number of threads per core, before attempting to wake up all present
CPUs.

Fixes: 38253464bc ("cpu/SMT: Create topology_smt_thread_allowed()")
Reported-by: Sachin P Bappalige <sachinpb@linux.ibm.com>
Cc: stable@vger.kernel.org # v6.6+
Reviewed-by: Srikar Dronamraju <srikar@linux.ibm.com>
Signed-off-by: Nysal Jan K.A. <nysal@linux.ibm.com>
Tested-by: Samir M <samir@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20251028105516.26258-1-nysal@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-02 12:57:25 +01:00
..
boot powerpc/addnote: Fix overflow on 32-bit builds 2026-01-02 12:57:00 +01:00
configs Crypto library updates for 6.18 2025-09-29 15:48:56 -07:00
crypto lib/crypto: curve25519: Consolidate into single module 2025-09-06 16:32:43 -07:00
include crash: let architecture decide crash memory export to iomem_resource 2026-01-02 12:57:11 +01:00
kernel powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf() 2026-01-02 12:57:20 +01:00
kexec powerpc/kexec: Enable SMT before waking offline CPUs 2026-01-02 12:57:25 +01:00
kvm powerpc, ocxl: Fix extraction of struct xive_irq_data 2025-10-13 09:40:55 +05:30
lib powerpc/qspinlock: Add spinlock contention tracepoint 2025-09-01 13:38:12 +05:30
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/64s/ptdump: Fix kernel_hash_pagetable dump for ISA v3.00 HPTE format 2025-12-18 14:03:04 +01:00
net powerpc64/bpf: Implement PROBE_ATOMIC instructions 2025-09-06 15:49:44 +05:30
perf powerpc/perf/vpa-dtl: Handle the writing of perf record when aux wake up is needed 2025-09-22 14:48:57 +05:30
platforms mm: fix MAX_FOLIO_ORDER on powerpc configs with hugetlb 2025-11-15 10:52:00 -08:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc, ocxl: Fix extraction of struct xive_irq_data 2025-10-13 09:40:55 +05:30
tools powerpc/ftrace: Fix ftrace bug with KASAN=y 2024-11-10 22:33:51 +11:00
xmon powerpc/xmon: replace sizeof calculations with ARRAY_SIZE macro 2025-09-01 13:40:46 +05:30
Kbuild powerpc64/ftrace: Move ftrace sequence out of line 2024-10-31 11:00:54 +11:00
Kconfig mm: fix MAX_FOLIO_ORDER on powerpc configs with hugetlb 2025-11-15 10:52:00 -08:00
Kconfig.debug powerpc: Remove UDBG_RTAS_CONSOLE 2025-02-26 21:15:09 +05:30
Makefile kbuild: Add missing $(objtree) prefix to powerpc crtsavres.o artifact 2025-09-01 13:41:57 +05:30
Makefile.postlink powerpc/ftrace: Add a postlink script to validate function tracer 2024-10-31 11:00:54 +11:00