linux-stable/arch
Pavel Kozlov 0476f2016d ARC: atomics: Add compiler barrier to atomic operations...
commit 42f51fb24f upstream.

... to avoid unwanted gcc optimizations

SMP kernels fail to boot with commit 596ff4a09b
("cpumask: re-introduce constant-sized cpumask optimizations").

|
| percpu: BUG: failure at mm/percpu.c:2981/pcpu_build_alloc_info()!
|

The write operation performed by the SCOND instruction in the atomic
inline asm code is not properly passed to the compiler. The compiler
cannot correctly optimize a nested loop that runs through the cpumask
in the pcpu_build_alloc_info() function.

Fix this by add a compiler barrier (memory clobber in inline asm).

Apparently atomic ops used to have memory clobber implicitly via
surrounding smp_mb(). However commit b64be68369
("ARC: atomics: implement relaxed variants") removed the smp_mb() for
the relaxed variants, but failed to add the explicit compiler barrier.

Link: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/135
Cc: <stable@vger.kernel.org> # v6.3+
Fixes: b64be68369 ("ARC: atomics: implement relaxed variants")
Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
[vgupta: tweaked the changelog and added Fixes tag]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-19 12:23:00 +02:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:22:03 +02:00
arc ARC: atomics: Add compiler barrier to atomic operations... 2023-09-19 12:23:00 +02:00
arm ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch() 2023-09-19 12:22:50 +02:00
arm64 arm64: sdei: abort running SDEI handlers during crash 2023-09-19 12:22:52 +02:00
csky kprobes: treewide: Cleanup the error messages for kprobes 2023-02-22 12:57:00 +01:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-01 08:27:21 +01:00
hexagon hexagon: Fix function name in die() 2023-02-01 08:27:20 +01:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:58:30 +02:00
m68k m68k: Fix invalid .section syntax 2023-09-19 12:22:27 +02:00
microblaze exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
mips mmc: au1xmmc: force non-modular build and remove symbol_get usage 2023-09-06 21:28:37 +01:00
nds32 exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:59:14 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-11 23:00:37 +09:00
parisc parisc: led: Fix LAN receive and transmit LEDs 2023-09-19 12:22:55 +02:00
powerpc powerpc/iommu: Fix notifiers being shared by PCI and VIO buses 2023-09-19 12:22:42 +02:00
riscv riscv: uaccess: Return the number of bytes effectively not copied 2023-08-26 14:23:36 +02:00
s390 s390/ipl: add missing secure/has_secure file to ipl type 'unknown' 2023-09-19 12:22:52 +02:00
sh sh: boards: Fix CEU buffer size passed to dma_declare_coherent_memory() 2023-09-19 12:23:00 +02:00
sparc sparc/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:58:31 +02:00
um um: Fix hostaudio build errors 2023-09-19 12:22:49 +02:00
x86 x86/virt: Drop unnecessary check on extended CPUID level in cpu_has_svm() 2023-09-19 12:22:57 +02:00
xtensa xtensa: PMU: fix base address for the newer hardware 2023-09-19 12:22:51 +02:00
.gitignore
Kconfig init: Provide arch_cpu_finalize_init() 2023-08-08 19:58:30 +02:00