linux/arch/arc/include/asm
Pavel Kozlov f2953184bf 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:28:04 +02:00
..
arcregs.h
asm-offsets.h
asserts.h
atomic-llsc.h ARC: atomics: Add compiler barrier to atomic operations... 2023-09-19 12:28:04 +02:00
atomic-spinlock.h
atomic.h
atomic64-arcv2.h ARC: atomics: Add compiler barrier to atomic operations... 2023-09-19 12:28:04 +02:00
barrier.h
bitops.h ARC: bitops: Change __fls to return unsigned long 2022-10-17 16:32:12 -07:00
bug.h
cache.h
cacheflush.h Add linux/cacheflush.h 2021-11-17 10:36:15 -05:00
checksum.h
cmpxchg.h
current.h
delay.h
disasm.h
dma.h PCI: Move isa_dma_bridge_buggy out of asm/dma.h 2022-07-22 17:24:47 -05:00
dsp-impl.h
dsp.h
dwarf.h
elf.h
entry-arcv2.h
entry-compact.h ARC: Fix comment typo 2022-10-17 16:32:11 -07:00
entry.h
exec.h
fb.h
fpu.h
futex.h
highmem.h
hugepage.h arch: Add pmd_pfn() where it is missing 2022-03-21 12:59:02 -04:00
io.h arc: iounmap() arg is volatile 2022-10-17 16:32:12 -07:00
irq.h
irqflags-arcv2.h
irqflags-compact.h arc: Replace lkml.org links with lore 2021-12-28 19:48:49 -08:00
irqflags.h
jump_label.h
Kbuild
kdebug.h
kgdb.h
kprobes.h
linkage.h ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-19 16:21:42 +02:00
mach_desc.h
mmu_context.h
mmu-arcv2.h
mmu.h
module.h
page.h
pci.h
perf_event.h ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type 2022-04-26 09:35:28 -07:00
pgalloc.h
pgtable-bits-arcv2.h arc/mm: enable ARCH_HAS_VM_GET_PAGE_PROT 2022-07-17 17:14:40 -07:00
pgtable-levels.h ARC: mm: fix leakage of memory allocated for PTE 2022-10-17 16:32:12 -07:00
pgtable.h
processor.h kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
ptrace.h ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature 2022-04-25 13:09:47 -07:00
sections.h
serial.h
setup.h
shmparam.h
smp.h
spinlock_types.h
spinlock.h
stacktrace.h
string.h
switch_to.h
syscall.h ARC: implement syscall tracepoints 2022-04-25 13:09:47 -07:00
syscalls.h
thread_info.h ARC: implement syscall tracepoints 2022-04-25 13:09:47 -07:00
timex.h
tlb.h
tlbflush.h
uaccess.h uaccess: remove CONFIG_SET_FS 2022-02-25 09:36:06 +01:00
unaligned.h
unwind.h
vermagic.h
vmalloc.h