linux/arch
Paul Burton 3972bd4ca5 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>
History 2025-06-04 14:40:12 +02:00
..
alpha alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support 2025-03-28 21:58:51 +01:00
arc ARC: build: Try to guess GCC variant of cross compiler 2025-01-09 13:30:05 +01:00
arm ARM: at91: pm: fix at91_suspend_finish for ZQ calibration 2025-06-04 14:40:10 +02:00
arm64 arm64: tegra: p2597: Fix gpio for vdd-1v8-dis regulator 2025-06-04 14:40:08 +02:00
csky mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
hexagon hexagon: Fix unbalanced spinlock in die() 2025-02-21 13:49:25 +01:00
ia64 mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
loongarch LoongArch: Explicitly specify code model in Makefile 2025-05-22 14:10:09 +02:00
m68k m68k: vga: Fix I/O defines 2025-02-21 13:49:38 +01:00
microblaze microblaze: Export xmb_manager functions 2024-12-14 19:53:20 +01:00
mips MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core 2025-06-04 14:40:12 +02:00
nios2 mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
openrisc mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
parisc parisc: Fix double SIGFPE crash 2025-05-09 09:41:34 +02:00
powerpc powerpc/prom_init: Fixup missing #size-cells on PowerBook6,7 2025-06-04 14:40:08 +02:00
riscv riscv: mm: Fix the out of bound issue of vmemmap address 2025-05-22 14:10:09 +02:00
s390 KVM: s390: Don't use %pK through tracepoints 2025-05-02 07:47:04 +02:00
sh sh: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2024-12-14 19:54:03 +01:00
sparc sparc/mm: disable preemption in lazy mmu mode 2025-04-25 10:43:42 +02:00
um um: Update min_low_pfn to match changes in uml_reserved 2025-06-04 14:40:05 +02:00
x86 x86/kaslr: Reduce KASLR entropy on most x86 systems 2025-06-04 14:40:12 +02:00
xtensa mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:46:24 +02:00