linux-sg2042/arch/riscv
Mark Rutland fd2efaa4eb locking/atomics: Rework ordering barriers
Currently architectures can override __atomic_op_*() to define the barriers
used before/after a relaxed atomic when used to build acquire/release/fence
variants.

This has the unfortunate property of requiring the architecture to define the
full wrapper for the atomics, rather than just the barriers they care about,
and gets in the way of generating atomics which can be easily read.

Instead, this patch has architectures define an optional set of barriers:

* __atomic_acquire_fence()
* __atomic_release_fence()
* __atomic_pre_full_fence()
* __atomic_post_full_fence()

... which <linux/atomic.h> uses to build the wrappers.

It would be nice if we could undef these, along with the __atomic_op_*()
wrappers, but that would break the cmpxchg() wrappers, which are written
in preprocessor. Undefs would have been nice, but alas.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Andrea Parri <parri.andrea@gmail.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: andy.shevchenko@gmail.com
Cc: arnd@arndb.de
Cc: aryabinin@virtuozzo.com
Cc: catalin.marinas@arm.com
Cc: dvyukov@google.com
Cc: glider@google.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: peter@hurleysoftware.com
Link: http://lkml.kernel.org/r/20180716113017.3909-7-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-07-25 11:53:59 +02:00
..
configs RISC-V: Add CONFIG_HVC_RISCV_SBI=y to defconfig 2018-06-11 09:16:24 -07:00
include locking/atomics: Rework ordering barriers 2018-07-25 11:53:59 +02:00
kernel RISC-V: Fix the rv32i kernel build 2018-07-04 14:12:53 -07:00
lib RISC-V: Make our port sparse-clean 2018-06-11 09:09:49 -07:00
mm RISC-V: Add conditional macro for zone of DMA32 2018-07-04 13:53:21 -07:00
Kconfig RISC-V: Select GENERIC_UCMPDI2 on RV32I 2018-07-04 13:53:33 -07:00
Makefile riscv: add riscv-specific predefines to CHECKFLAGS 2018-06-11 09:03:43 -07:00