[PATCH 0/2] arm64: insn: clean-up memory barrier generation

Ada Couprie Diaz ada.coupriediaz at arm.com
Fri Oct 16 09:51:38 PDT 2026


Hello,

This is a small follow-up from [0], taking Vladimir's comments into
account and going a bit further in cleaning-up DMB/DSB generation.

The first patch prepares for inlining and cleans-up the enum cases,
encoding the values directly and matching their numerical order.

The second patch inlines the barrier type check and the instruction
generation functions, allowing checking at compile time for invalid
barrier types (only non-deprecated types are allowed now) and safe
usage in alternative callbacks.

The "empty" switch-case statements with a default `BUILD_BUG` might
not be the best way to check for valid type, but I thought that
it might be a bit better than a three-/six-way && if, do let me know !

Thanks in advance,
Ada

[0]: https://lore.kernel.org/r/20260928133034.243541-1-ada.coupriediaz@arm.com 

Ada Couprie Diaz (2):
  arm64: insn: clean-up memory barrier types
  arm64: insn: make `aarch64_insn_gen_d{m,s}b()` alternative-safe

 arch/arm64/include/asm/insn.h | 68 +++++++++++++++++++++++++++--------
 arch/arm64/lib/insn.c         | 58 ------------------------------
 arch/arm64/net/bpf_jit.h      |  2 +-
 3 files changed, 55 insertions(+), 73 deletions(-)


base-commit: 93f51579e7df248780214094418f205253383cc5
-- 
2.43.0




More information about the linux-arm-kernel mailing list