linux-yocto/arch/mips/kernel
Paul Burton 51d7044627 MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core
[ Upstream commit 00a134fc2b ]

The pm-cps code has up until now used per-CPU variables indexed by core,
rather than CPU number, in order to share data amongst sibling CPUs (ie.
VPs/threads in a core). This works fine for single cluster systems, but
with multi-cluster systems a core number is no longer unique in the
system, leading to sharing between CPUs that are not actually siblings.

Avoid this issue by using per-CPU variables as they are more generally
used - ie. access them using CPU numbers rather than core numbers.
Sharing between siblings is then accomplished by:
 - Assigning the same pointer to entries for each sibling CPU for the
   nc_asm_enter & ready_count variables, which allow this by virtue of
   being per-CPU pointers.

 - Indexing by the first CPU set in a CPUs cpu_sibling_map in the case
   of pm_barrier, for which we can't use the previous approach because
   the per-CPU variable is not a pointer.

Signed-off-by: Paul Burton <paulburton@kernel.org>
Signed-off-by: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-04 14:38:00 +02:00
..
syscalls mips: fix compat_sys_lseek syscall 2024-07-27 10:46:10 +02:00
.gitignore
access-helper.h MIPS: Fix new sparse warnings 2021-04-07 16:11:05 +02:00
asm-offsets.c MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:50:54 +02:00
bmips_5xxx_init.S
bmips_vec.S
branch.c
cacheinfo.c drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() 2021-09-01 10:29:10 +02:00
cevt-bcm1480.c
cevt-ds1287.c MIPS: cevt-ds1287: Add missing ds1287.h include 2025-05-02 07:44:23 +02:00
cevt-gt641xx.c
cevt-r4k.c MIPS: cevt-r4k: Don't call get_c0_compare_int if timer irq is installed 2024-09-12 11:07:50 +02:00
cevt-sb1250.c
cevt-txx9.c mips: kernel: convert comma to semicolon 2020-12-28 22:32:28 +01:00
cmpxchg.c locking/atomic: mips: move to ARCH_ATOMIC 2021-05-26 13:20:51 +02:00
cps-vec-ns16550.S
cps-vec.S MIPS: CPS: don't create redundant .text.cps-vec section 2021-01-15 15:27:54 +01:00
cpu-probe.c MIPS: Loongson64: Set timer mode in cpu-probe 2024-09-04 13:23:35 +02:00
cpu-r3k-probe.c MIPS: kernel: Reserve exception base early to prevent corruption 2021-03-09 11:22:59 +01:00
crash_dump.c MIPS: crash_dump.c: Simplify copy_oldmem_page() 2021-02-09 13:30:12 +01:00
crash.c
csrc-bcm1480.c
csrc-ioasic.c
csrc-r4k.c
csrc-sb1250.c
early_printk_8250.c
early_printk.c
elf.c mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan 2024-02-23 08:54:36 +01:00
entry.S
fpu-probe.c
fpu-probe.h
ftrace.c MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static 2025-03-13 12:50:33 +01:00
genex.S MIPS: Make check condition for SDBBP consistent with EJTAG spec 2021-02-11 11:04:31 +01:00
gpio_txx9.c
head.S MIPS: of: Introduce helper function to get DTB 2021-02-04 13:34:51 +01:00
i8253.c
idle.c Revert "MIPS: Remove unused R4300 CPU support" 2021-01-22 11:39:45 +01:00
irq_txx9.c
irq-gt641xx.c
irq-msc01.c
irq.c irqchip/mips: Fix RCU violation when using irqdomain lookup on interrupt entry 2021-07-09 10:18:58 +01:00
jump_label.c MIPS: jump_label: Fix compat branch range check 2022-11-16 09:58:24 +01:00
kgdb.c MIPS: kernel: Drop kgdb_call_nmi_hook 2021-02-15 12:23:54 +01:00
kprobes.c kprobes: treewide: Cleanup the error messages for kprobes 2023-02-22 12:57:00 +01:00
linux32.c
machine_kexec.c
Makefile MIPS: Makefile: Replace -pg with CC_FLAGS_FTRACE 2021-04-21 13:44:35 +02:00
mcount.S
mips-cm.c MIPS: cm: Detect CM quirks from device tree 2025-05-02 07:44:34 +02:00
mips-cpc.c mips: cpc: Fix refcount leak in mips_cpc_default_phys_base 2022-06-14 18:36:14 +02:00
mips-mt-fpaff.c MIPS: Replace deprecated CPU-hotplug functions. 2021-08-05 10:57:01 +02:00
mips-mt.c
mips-r2-to-r6-emul.c MIPS: Fix build error due to PTR used in more places 2022-02-16 12:56:16 +01:00
module.c MIPS: module: optimize module relocations processing 2021-01-18 15:55:16 +01:00
octeon_switch.S
perf_event_mipsxx.c MIPS: perf: Add support for OCTEON III perf events. 2021-01-04 11:32:57 +01:00
perf_event.c
perf_regs.c MIPS: kernel: Support extracting off-line stack traces from user-space with perf 2021-02-04 21:55:45 +01:00
pm-cps.c MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core 2025-06-04 14:38:00 +02:00
pm.c
probes-common.h
proc.c MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-08-17 14:22:58 +02:00
process.c MIPS: Replace deprecated CPU-hotplug functions. 2021-08-05 10:57:01 +02:00
prom.c
ptrace.c MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:50:54 +02:00
ptrace32.c
r4k_fpu.S MIPS: Fix build error due to PTR used in more places 2022-02-16 12:56:16 +01:00
r4k_switch.S
r4k-bugs64.c arch: mips: update references to current linux-mips list 2021-02-23 13:24:38 +01:00
r2300_fpu.S MIPS: Fix build error due to PTR used in more places 2022-02-16 12:56:16 +01:00
r2300_switch.S
relocate_kernel.S MIPS: fix duplicate definitions for exported symbols 2022-11-26 09:24:38 +01:00
relocate.c kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
reset.c
rtlx-cmp.c
rtlx-mt.c
rtlx.c
scall32-o32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:50:54 +02:00
scall64-n32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:50:54 +02:00
scall64-n64.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:50:54 +02:00
scall64-o32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:50:54 +02:00
segment.c
setup.c mips: Fix incorrect max_low_pfn adjustment 2024-01-25 14:52:50 -08:00
signal_n32.c
signal_o32.c
signal-common.h
signal.c entry: rseq: Call rseq_handle_notify_resume() in tracehook_notify_resume() 2021-09-22 10:24:01 -04:00
signal32.c
smp-bmips.c mips: smp-bmips: fix CPU mappings 2021-03-06 08:43:39 +01:00
smp-cmp.c
smp-cps.c MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later 2024-08-19 05:45:24 +02:00
smp-mt.c
smp-up.c
smp.c MIPS: smp: fill in sibling and core maps earlier 2022-03-19 13:47:48 +01:00
spinlock_test.c mips: kernel: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() 2021-03-14 14:09:49 +01:00
spram.c
stacktrace.c
sync-r4k.c
syscall.c MIPS: Fix build error due to PTR used in more places 2022-02-16 12:56:16 +01:00
sysrq.c
time.c MIPS: Fix CP0 counter erratum detection for R4k CPUs 2022-05-12 12:30:00 +02:00
topology.c
traps.c MIPS: reserve exception vector space ONLY ONCE 2024-03-01 13:21:44 +01:00
unaligned.c MIPS: Fix new sparse warnings 2021-04-07 16:11:05 +02:00
uprobes.c MIPS: Return true/false (not 1/0) from bool functions 2021-08-21 10:37:30 +02:00
vdso.c MIPS: vdso: Utilize __pa() for gic_pfn 2022-08-17 14:24:06 +02:00
vmlinux.lds.S MIPS: Define RUNTIME_DISCARD_EXIT in LD script 2023-04-26 13:51:53 +02:00
vpe-cmp.c MIPS: vpe-cmp: fix possible memory leak while module exiting 2022-12-31 13:14:02 +01:00
vpe-mt.c MIPS: vpe-mt: drop physical_memsize 2024-03-01 13:21:51 +01:00
vpe.c MIPS: vpe: Remove vpe_getcwd 2021-01-27 21:49:16 +01:00
watch.c