linux-stable/arch/loongarch/kernel
Huacai Chen b1ec3d6b86 LoongArch: Update cpu_sibling_map when disabling nonboot CPUs
commit 752cd08da3 upstream.

Update cpu_sibling_map when disabling nonboot CPUs by defining & calling
clear_cpu_sibling_map(), otherwise we get such errors on SMT systems:

jump label: negative count!
WARNING: CPU: 6 PID: 45 at kernel/jump_label.c:263 __static_key_slow_dec_cpuslocked+0xec/0x100
CPU: 6 PID: 45 Comm: cpuhp/6 Not tainted 6.8.0-rc5+ #1340
pc 90000000004c302c ra 90000000004c302c tp 90000001005bc000 sp 90000001005bfd20
a0 000000000000001b a1 900000000224c278 a2 90000001005bfb58 a3 900000000224c280
a4 900000000224c278 a5 90000001005bfb50 a6 0000000000000001 a7 0000000000000001
t0 ce87a4763eb5234a t1 ce87a4763eb5234a t2 0000000000000000 t3 0000000000000000
t4 0000000000000006 t5 0000000000000000 t6 0000000000000064 t7 0000000000001964
t8 000000000009ebf6 u0 9000000001f2a068 s9 0000000000000000 s0 900000000246a2d8
s1 ffffffffffffffff s2 ffffffffffffffff s3 90000000021518c0 s4 0000000000000040
s5 9000000002151058 s6 9000000009828e40 s7 00000000000000b4 s8 0000000000000006
   ra: 90000000004c302c __static_key_slow_dec_cpuslocked+0xec/0x100
  ERA: 90000000004c302c __static_key_slow_dec_cpuslocked+0xec/0x100
 CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
 PRMD: 00000004 (PPLV0 +PIE -PWE)
 EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
 ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
ESTAT: 000c0000 [BRK] (IS= ECode=12 EsubCode=0)
 PRID: 0014d000 (Loongson-64bit, Loongson-3A6000-HV)
CPU: 6 PID: 45 Comm: cpuhp/6 Not tainted 6.8.0-rc5+ #1340
Stack : 0000000000000000 900000000203f258 900000000179afc8 90000001005bc000
        90000001005bf980 0000000000000000 90000001005bf988 9000000001fe0be0
        900000000224c280 900000000224c278 90000001005bf8c0 0000000000000001
        0000000000000001 ce87a4763eb5234a 0000000007f38000 90000001003f8cc0
        0000000000000000 0000000000000006 0000000000000000 4c206e6f73676e6f
        6f4c203a656d616e 000000000009ec99 0000000007f38000 0000000000000000
        900000000214b000 9000000001fe0be0 0000000000000004 0000000000000000
        0000000000000107 0000000000000009 ffffffffffafdabe 00000000000000b4
        0000000000000006 90000000004c302c 9000000000224528 00005555939a0c7c
        00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c
        ...
Call Trace:
[<9000000000224528>] show_stack+0x48/0x1a0
[<900000000179afc8>] dump_stack_lvl+0x78/0xa0
[<9000000000263ed0>] __warn+0x90/0x1a0
[<90000000017419b8>] report_bug+0x1b8/0x280
[<900000000179c564>] do_bp+0x264/0x420
[<90000000004c302c>] __static_key_slow_dec_cpuslocked+0xec/0x100
[<90000000002b4d7c>] sched_cpu_deactivate+0x2fc/0x300
[<9000000000266498>] cpuhp_invoke_callback+0x178/0x8a0
[<9000000000267f70>] cpuhp_thread_fun+0xf0/0x240
[<90000000002a117c>] smpboot_thread_fn+0x1dc/0x2e0
[<900000000029a720>] kthread+0x140/0x160
[<9000000000222288>] ret_from_kernel_thread+0xc/0xa4

Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:34:58 +01:00
..
.gitignore
Makefile LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
access-helper.h
acpi.c LoongArch: Change acpi_core_pic[NR_CPUS] to acpi_core_pic[MAX_CORE_PIC] 2024-03-01 13:34:55 +01:00
alternative.c LoongArch: Use common function sign_extend64() 2023-01-17 11:42:16 +08:00
asm-offsets.c LoongArch: Add Loongson Binary Translation (LBT) extension support 2023-09-06 22:53:55 +08:00
cacheinfo.c LoongArch: Refactor cache probe and flush methods 2022-10-12 16:36:14 +08:00
cpu-probe.c LoongArch: Add Loongson Binary Translation (LBT) extension support 2023-09-06 22:53:55 +08:00
crash_dump.c LoongArch: Add kdump support 2022-10-12 16:36:19 +08:00
dma.c LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA 2022-09-24 18:39:21 +02:00
efi-header.S LoongArch: Calculate various sizes in the linker script 2023-06-29 20:58:42 +08:00
efi.c efi: Do not include <linux/screen_info.h> from EFI header 2023-07-08 20:26:36 +02:00
elf.c LoongArch: Fix and simplify fcsr initialization on execve() 2024-01-25 15:35:44 -08:00
entry.S LoongArch: Use SYM_CODE_* to annotate exception handlers 2023-10-18 08:42:52 +08:00
env.c LoongArch: Add FDT booting support from efi system table 2022-12-14 08:41:53 +08:00
fpu.S LoongArch: Add Loongson Binary Translation (LBT) extension support 2023-09-06 22:53:55 +08:00
ftrace.c LoongArch/ftrace: Add basic support 2022-12-14 08:41:53 +08:00
ftrace_dyn.c LoongArch: ftrace: Add direct call support 2023-05-01 17:19:53 +08:00
genex.S LoongArch: Use SYM_CODE_* to annotate exception handlers 2023-10-18 08:42:52 +08:00
head.S LoongArch: Add KASAN (Kernel Address Sanitizer) support 2023-09-06 22:54:16 +08:00
hw_breakpoint.c LoongArch: Fix hw_breakpoint_control() for watchpoints 2023-08-26 22:21:57 +08:00
idle.c arch/idle: Change arch_cpu_idle() behavior: always exit with IRQs disabled 2023-01-13 11:48:15 +01:00
image-vars.h efi: loongarch: Drop exports of unused string routines 2022-11-09 12:42:02 +01:00
inst.c LoongArch: Add larch_insn_gen_break() to generate break insns 2023-06-29 20:58:44 +08:00
io.c
irq.c LoongArch: Clean up the architectural interrupt definitions 2023-05-01 17:19:10 +08:00
jump_label.c LoongArch: Add jump-label implementation 2023-06-29 20:58:44 +08:00
kfpu.c LoongArch: Allow usage of LSX/LASX in the kernel 2023-09-06 22:53:55 +08:00
kgdb.c LoongArch: Add basic KGDB & KDB support 2023-09-06 22:53:55 +08:00
kprobes.c LoongArch: Use larch_insn_gen_break() for kprobes 2023-06-29 20:58:44 +08:00
lbt.S LoongArch: Add Loongson Binary Translation (LBT) extension support 2023-09-06 22:53:55 +08:00
machine_kexec.c LoongArch: Add kdump support 2022-10-12 16:36:19 +08:00
mcount.S LoongArch: Replace #include <asm/export.h> with #include <linux/export.h> 2023-08-25 23:40:26 +08:00
mcount_dyn.S LoongArch: Remove unneeded #include <asm/export.h> 2023-08-25 23:40:26 +08:00
mem.c LoongArch: Set all reserved memblocks on Node#0 at initialization 2023-09-20 14:26:29 +08:00
module-sections.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
module.c LoongArch: Add support for 64_PCREL relocation type 2023-09-27 16:19:13 +08:00
numa.c LoongArch: numa: Fix high_memory calculation 2023-09-27 16:19:13 +08:00
perf_event.c LoongArch: Fix perf event id calculation 2023-06-15 14:35:52 +08:00
perf_regs.c LoongArch: Add perf events support 2022-10-12 16:36:14 +08:00
proc.c LoongArch: Introduce hardware page table walker 2023-06-29 20:58:44 +08:00
process.c LoongArch: Fix and simplify fcsr initialization on execve() 2024-01-25 15:35:44 -08:00
ptrace.c LoongArch: Add Loongson Binary Translation (LBT) extension support 2023-09-06 22:53:55 +08:00
relocate.c LoongArch: Silence the boot warning about 'nokaslr' 2023-12-20 17:01:57 +01:00
relocate_kernel.S LoongArch: Remove dead code in relocate_new_kernel 2023-09-20 14:26:29 +08:00
reset.c LoongArch: Add hibernation (ACPI S4) support 2022-12-14 08:41:53 +08:00
rethook.c LoongArch: Replace kretprobe with rethook 2023-06-29 20:58:44 +08:00
rethook.h LoongArch: Replace kretprobe with rethook 2023-06-29 20:58:44 +08:00
rethook_trampoline.S LoongArch: Replace kretprobe with rethook 2023-06-29 20:58:44 +08:00
setup.c LoongArch: Call early_init_fdt_scan_reserved_mem() earlier 2024-03-01 13:34:58 +01:00
signal.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
smp.c LoongArch: Update cpu_sibling_map when disabling nonboot CPUs 2024-03-01 13:34:58 +01:00
stacktrace.c LoongArch: Set unwind stack type to unknown rather than set error flag 2024-01-20 11:51:42 +01:00
switch.S LoongArch: Add basic STACKPROTECTOR support 2022-12-14 08:41:53 +08:00
syscall.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
sysrq.c tty: sysrq: switch sysrq handlers from int to u8 2023-07-25 19:21:03 +02:00
time.c LoongArch: Implement constant timer shutdown interface 2023-12-20 17:01:58 +01:00
topology.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
traps.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
unaligned.c LoongArch: Delete unnecessary debugfs checking 2023-06-29 20:58:42 +08:00
unwind.c LoongArch: Set unwind stack type to unknown rather than set error flag 2024-01-20 11:51:42 +01:00
unwind_guess.c LoongArch: Strip guess unwinder out from prologue unwinder 2023-01-17 11:42:16 +08:00
unwind_prologue.c LoongArch: Set unwind stack type to unknown rather than set error flag 2024-01-20 11:51:42 +01:00
uprobes.c LoongArch: Add uprobes support 2023-06-29 20:58:44 +08:00
vdso.c LoongArch: Add support to clone a time namespace 2023-06-29 20:58:43 +08:00
vmlinux.lds.S LoongArch: Fix lockdep static memory detection 2023-09-20 14:26:28 +08:00