locking/atomic: scripts: add trivial raw_atomic*_<op>()
authorMark Rutland <mark.rutland@arm.com>
Mon, 5 Jun 2023 07:01:14 +0000 (08:01 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 5 Jun 2023 07:57:19 +0000 (09:57 +0200)
commitc9268ac615f9f6dded7801df5993374598934377
tree668c1082698a2cb532c7a7f9e39f59c169be3ac0
parent7ed7a1564090fdd265f49d1ad94ee92845b14c76
locking/atomic: scripts: add trivial raw_atomic*_<op>()

Currently a number of arch_atomic*_<op>() functions are optional, and
where an arch does not provide a given arch_atomic*_<op>() we will
define an implementation of arch_atomic*_<op>() in
atomic-arch-fallback.h.

Filling in the missing ops requires special care as we want to select
the optimal definition of each op (e.g. preferentially defining ops in
terms of their relaxed form rather than their fully-ordered form). The
ifdeffery necessary for this requires us to group ordering variants
together, which can be a bit painful to read, and is painful for
kerneldoc generation.

It would be easier to handle this if we generated ops into a separate
namespace, as this would remove the need to take special care with the
ifdeffery, and allow each ordering variant to be generated separately.

This patch adds a new set of raw_atomic_<op>() definitions, which are
currently trivial wrappers of their arch_atomic_<op>() equivalent. This
will allow us to move treewide users of arch_atomic_<op>() over to raw
atomic op before we rework the fallback generation to generate
raw_atomic_<op> directly.

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

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230605070124.3741859-18-mark.rutland@arm.com
include/linux/atomic.h
include/linux/atomic/atomic-instrumented.h
include/linux/atomic/atomic-raw.h [new file with mode: 0644]
scripts/atomic/gen-atomic-instrumented.sh
scripts/atomic/gen-atomic-raw.sh [new file with mode: 0644]
scripts/atomic/gen-atomics.sh