linux-stable/arch/arc/include/asm
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
..
Kbuild local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
arcregs.h ARC: allow userspace DSP applications to use AGU extensions 2020-03-16 10:30:49 -07:00
asm-offsets.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
asserts.h ARC: allow userspace DSP applications to use AGU extensions 2020-03-16 10:30:49 -07:00
atomic-llsc.h ARC: atomics: Add compiler barrier to atomic operations... 2023-09-19 12:23:00 +02:00
atomic-spinlock.h ARC: atomic: !LLSC: use int data type consistently 2021-08-24 14:25:46 -07:00
atomic.h ARC: atomic_cmpxchg/atomic_xchg: implement relaxed variants 2021-08-24 14:25:47 -07:00
atomic64-arcv2.h ARC: atomics: Add compiler barrier to atomic operations... 2023-09-19 12:23:00 +02:00
barrier.h ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
bitops.h ARC: bitops: fls/ffs to take int (vs long) per asm-generic defines 2021-08-24 14:25:47 -07:00
bug.h arc: add show_stack_loglvl() 2020-06-09 09:39:10 -07:00
cache.h ARC: mm: move mmu/cache externs out to setup.h 2021-08-24 14:25:48 -07:00
cacheflush.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
checksum.h arc: Prefer unsigned int to bare use of unsigned 2021-08-03 18:58:33 -07:00
cmpxchg.h ARC: atomic_cmpxchg/atomic_xchg: implement relaxed variants 2021-08-24 14:25:47 -07:00
current.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
delay.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
disasm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
dma.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
dsp-impl.h ARC: guard dsp early init against non ARCv2 2020-04-29 11:53:51 -07:00
dsp.h ARC: allow userspace DSP applications to use AGU extensions 2020-03-16 10:30:49 -07:00
dwarf.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
elf.h ARC: elf: use right ELF_ARCH 2020-06-16 12:56:37 -07:00
entry-arcv2.h ARC: entry: comment 2020-04-12 22:45:35 -07:00
entry-compact.h ARC: mm: use SCRATCH_DATA0 register for caching pgdir in ARCv2 only 2021-08-24 14:25:48 -07:00
entry.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
exec.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
fb.h
fpu.h ARC: fpu: fix randconfig build error reported by 0-day test service 2020-02-09 22:17:22 -08:00
futex.h futex: arch_futex_atomic_op_inuser() calling conventions change 2020-03-27 23:58:51 -04:00
highmem.h arc/mm/highmem: Use generic kmap atomic implementation 2020-11-06 23:14:55 +01:00
hugepage.h ARC: mm: switch pgtable_t back to struct page * 2021-08-26 13:42:42 -07:00
io.h arc: iounmap() arg is volatile 2022-11-03 23:59:15 +09:00
irq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irqflags-arcv2.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irqflags-compact.h ARC: [arcompact] fix bitrot with 2 levels of interrupt 2020-06-16 12:56:37 -07:00
irqflags.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
jump_label.h ARC: ARCv2: jump label: implement jump label patching 2019-11-08 16:14:32 -08:00
kdebug.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
kgdb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
kprobes.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
linkage.h ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-23 13:47:15 +02:00
mach_desc.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
mmu-arcv2.h ARC: mm: disintegrate mmu.h (arcv2 bits out) 2021-08-25 15:53:19 -07:00
mmu.h ARC: mm: disintegrate mmu.h (arcv2 bits out) 2021-08-25 15:53:19 -07:00
mmu_context.h ARC: mm: move MMU specific bits out of ASID allocator 2021-08-24 14:25:48 -07:00
module.h arch: split MODULE_ARCH_VERMAGIC definitions out to <asm/vermagic.h> 2020-04-23 10:50:26 +09:00
page.h ARC: mm: support 4 levels of page tables 2021-08-26 13:43:19 -07:00
pci.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
perf_event.h arc: Prefer unsigned int to bare use of unsigned 2021-08-03 18:58:33 -07:00
pgalloc.h ARC: mm: support 4 levels of page tables 2021-08-26 13:43:19 -07:00
pgtable-bits-arcv2.h ARC: mm: disintegrate pgtable.h into levels and flags 2021-08-25 15:53:19 -07:00
pgtable-levels.h ARC: mm: fix leakage of memory allocated for PTE 2022-11-03 23:59:13 +09:00
pgtable.h ARC: fix potential build snafu 2021-10-15 18:06:32 -07:00
processor.h ARC: mm: support 3 levels of page tables 2021-08-26 13:43:19 -07:00
ptrace.h ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
sections.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
segment.h uaccess: remove segment_eq 2020-08-12 10:57:58 -07:00
serial.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
setup.h ARC: mm: move mmu/cache externs out to setup.h 2021-08-24 14:25:48 -07:00
shmparam.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
smp.h ARC: switch to generic bitops 2021-08-24 14:25:47 -07:00
spinlock.h ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
spinlock_types.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
stacktrace.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
string.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
switch_to.h ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
syscall.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
syscalls.h ARC: wireup clone3 syscall 2020-01-15 16:08:12 -08:00
thread_info.h arc: add support for TIF_NOTIFY_SIGNAL 2020-11-09 08:16:55 -07:00
timex.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tlb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tlbflush.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
uaccess.h asm-generic: remove extra strn{cpy_from,len}_user declarations 2021-07-27 23:01:13 +02:00
unaligned.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
unwind.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vermagic.h arch: split MODULE_ARCH_VERMAGIC definitions out to <asm/vermagic.h> 2020-04-23 10:50:26 +09:00
vmalloc.h mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00