linux/arch/loongarch/kernel
Huacai Chen a2ccf46333 LoongArch/smp: Call rcutree_report_cpu_starting() earlier
rcutree_report_cpu_starting() must be called before cpu_probe() to avoid
the following lockdep splat that triggered by calling __alloc_pages() when
CONFIG_PROVE_RCU_LIST=y:

 =============================
 WARNING: suspicious RCU usage
 6.6.0+ #980 Not tainted
 -----------------------------
 kernel/locking/lockdep.c:3761 RCU-list traversed in non-reader section!!
 other info that might help us debug this:
 RCU used illegally from offline CPU!
 rcu_scheduler_active = 1, debug_locks = 1
 1 lock held by swapper/1/0:
  #0: 900000000c82ef98 (&pcp->lock){+.+.}-{2:2}, at: get_page_from_freelist+0x894/0x1790
 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.6.0+ #980
 Stack : 0000000000000001 9000000004f79508 9000000004893670 9000000100310000
         90000001003137d0 0000000000000000 90000001003137d8 9000000004f79508
         0000000000000000 0000000000000001 0000000000000000 90000000048a3384
         203a656d616e2065 ca43677b3687e616 90000001002c3480 0000000000000008
         000000000000009d 0000000000000000 0000000000000001 80000000ffffe0b8
         000000000000000d 0000000000000033 0000000007ec0000 13bbf50562dad831
         9000000005140748 0000000000000000 9000000004f79508 0000000000000004
         0000000000000000 9000000005140748 90000001002bad40 0000000000000000
         90000001002ba400 0000000000000000 9000000003573ec8 0000000000000000
         00000000000000b0 0000000000000004 0000000000000000 0000000000070000
         ...
 Call Trace:
 [<9000000003573ec8>] show_stack+0x38/0x150
 [<9000000004893670>] dump_stack_lvl+0x74/0xa8
 [<900000000360d2bc>] lockdep_rcu_suspicious+0x14c/0x190
 [<900000000361235c>] __lock_acquire+0xd0c/0x2740
 [<90000000036146f4>] lock_acquire+0x104/0x2c0
 [<90000000048a955c>] _raw_spin_lock_irqsave+0x5c/0x90
 [<900000000381cd5c>] rmqueue_bulk+0x6c/0x950
 [<900000000381fc0c>] get_page_from_freelist+0xd4c/0x1790
 [<9000000003821c6c>] __alloc_pages+0x1bc/0x3e0
 [<9000000003583b40>] tlb_init+0x150/0x2a0
 [<90000000035742a0>] per_cpu_trap_init+0xf0/0x110
 [<90000000035712fc>] cpu_probe+0x3dc/0x7a0
 [<900000000357ed20>] start_secondary+0x40/0xb0
 [<9000000004897138>] smpboot_entry+0x54/0x58

raw_smp_processor_id() is required in order to avoid calling into lockdep
before RCU has declared the CPU to be watched for readers.

See also commit 29368e0939 ("x86/smpboot: Move rcu_cpu_starting() earlier"),
commit de5d9dae15 ("s390/smp: move rcu_cpu_starting() earlier") and commit
99f070b623 ("powerpc/smp: Call rcu_cpu_starting() earlier").

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-11-08 14:12:15 +08:00
..
.gitignore
access-helper.h LoongArch: Add exception/interrupt handling 2022-06-03 20:09:28 +08:00
acpi.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08: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: Add ELF and module support 2022-06-03 20:09:28 +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_dyn.c LoongArch: ftrace: Add direct call support 2023-05-01 17:19:53 +08:00
ftrace.c LoongArch/ftrace: Add basic support 2022-12-14 08:41: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 LoongArch: Add misc common routines 2022-06-03 20:09:28 +08:00
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
Makefile LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
mcount_dyn.S LoongArch: Remove unneeded #include <asm/export.h> 2023-08-25 23:40:26 +08:00
mcount.S LoongArch: Replace #include <asm/export.h> with #include <linux/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 some build warnings with W=1 2023-09-20 14:26:28 +08:00
ptrace.c LoongArch: Add Loongson Binary Translation (LBT) extension support 2023-09-06 22:53:55 +08:00
relocate_kernel.S LoongArch: Remove dead code in relocate_new_kernel 2023-09-20 14:26:29 +08:00
relocate.c LoongArch: Simplify the processing of jumping new kernel for KASLR 2023-09-06 22:54:16 +08:00
reset.c LoongArch: Add hibernation (ACPI S4) support 2022-12-14 08:41:53 +08:00
rethook_trampoline.S LoongArch: Replace kretprobe with rethook 2023-06-29 20:58:44 +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
setup.c LoongArch: Disable WUC for pgprot_writecombine() like ioremap_wc() 2023-10-18 08:42:52 +08:00
signal.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
smp.c LoongArch/smp: Call rcutree_report_cpu_starting() earlier 2023-11-08 14:12:15 +08:00
stacktrace.c LoongArch: Get partial stack information when providing regs parameter 2023-09-06 22:54:16 +08: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: Fix some build warnings with W=1 2023-09-20 14:26:28 +08: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_guess.c LoongArch: Strip guess unwinder out from prologue unwinder 2023-01-17 11:42:16 +08:00
unwind_prologue.c LoongArch: Check unwind_error() in arch_stack_walk() 2023-04-19 12:07:27 +08:00
unwind.c LoongArch: Check unwind_error() in arch_stack_walk() 2023-04-19 12:07:27 +08: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