arm64: insn: always inline predicates
authorMark Rutland <mark.rutland@arm.com>
Mon, 14 Nov 2022 13:59:26 +0000 (13:59 +0000)
committerWill Deacon <will@kernel.org>
Tue, 15 Nov 2022 13:07:44 +0000 (13:07 +0000)
commit9b948e79d5369bda7a628bf69521172200d07613
tree8caea65b6823587cb9e9e7dc0ad97861f4187b90
parent1b6bf2da7b1d2ba7560c793b22d66f134ac61416
arm64: insn: always inline predicates

We have a number of aarch64_insn_*() predicates which are used in code
which is not instrumentation safe (e.g. alternatives patching, kprobes).
Some of those are marked with __kprobes, but most are not, and are
implemented out-of-line in insn.c.

This patch moves the predicates to insn.h and marks them with
__always_inline. This is ensures that they will respect the
instrumentation requirements of their caller which they will be inlined
into.

At the same time, I've formatted each of the functions consistently as a
list, to make them easier to read and update in future.

Other than preventing unwanted instrumentation, there should be no
functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Link: https://lore.kernel.org/r/20221114135928.3000571-3-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/insn.h
arch/arm64/lib/insn.c