Thread (14 messages) 14 messages, 2 authors, 5d ago

Re: [PATCH v3 06/11] selftests: Fix arm64 IO barriers to match kernel

From: Nathan Chancellor <nathan@kernel.org>
Date: 2026-07-16 23:22:17
Also in: kvm, linux-kselftest, linux-patches, linux-rdma, llvm

On Thu, Jul 16, 2026 at 02:03:22PM -0300, Jason Gunthorpe wrote:
The tools/include readl/writel MMIO accessors on arm64 use
inner-shareable barriers (dmb ish) while the kernel uses
outer-shareable (dmb osh).  Fix them to match.

Add __io_bw() and __io_ar() definitions matching the kernel's
arch/arm64/include/asm/io.h, including the dummy control dependency
in __io_ar() that orders MMIO reads against all subsequent
instructions.

Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
...
quoted hunk ↗ jump to hunk
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index f02cc8a2e4ae32..fdd22df9174b88 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -5,9 +5,14 @@ ifneq ($(filter %/,$(LLVM)),)
 LLVM_PREFIX := $(LLVM)
 else ifneq ($(filter -%,$(LLVM)),)
 LLVM_SUFFIX := $(LLVM)
+else ifneq ($(LLVM),1)
+$(error Invalid value for LLVM, see Documentation/kbuild/llvm.rst)
 endif
 
 CLANG := $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
+LD := $(LLVM_PREFIX)ld.lld$(LLVM_SUFFIX)
+# Selftests link through $(CC), so point clang at the LLVM linker.
+LDFLAGS += --ld-path=$(LD)
 
 CLANG_TARGET_FLAGS_arm          := arm-linux-gnueabi
 CLANG_TARGET_FLAGS_arm64        := aarch64-linux-gnu
Was this hunk intended to be included in this change? It is not
mentioned anywhere. I assume this is the only reason that the LLVM folks
were CC'd on this series.

-- 
Cheers,
Nathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help