linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: lse: fix LSE atomics with LLVM's integrated assembler
@ 2019-10-07 20:14 Sami Tolvanen
  2019-10-07 20:28 ` Nick Desaulniers
  2019-10-08 21:27 ` [PATCH v2] " Sami Tolvanen
  0 siblings, 2 replies; 17+ messages in thread
From: Sami Tolvanen @ 2019-10-07 20:14 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Andrew Murray
  Cc: Kees Cook, linux-arm-kernel, linux-kernel, clang-built-linux,
	Sami Tolvanen

Unlike gcc, clang considers each inline assembly block to be independent
and therefore, when using the integrated assembler for inline assembly,
any preambles that enable features must be repeated in each block.

Instead of changing all inline assembly blocks that use LSE, this change
adds -march=armv8-a+lse to KBUILD_CFLAGS, which works with both clang
and gcc.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 arch/arm64/Makefile          | 2 ++
 arch/arm64/include/asm/lse.h | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 84a3d502c5a5..7a7c0cb8ed60 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -36,6 +36,8 @@ lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1)
 ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y)
   ifeq ($(lseinstr),)
 $(warning LSE atomics not supported by binutils)
+  else
+KBUILD_CFLAGS	+= -march=armv8-a+lse
   endif
 endif
 
diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h
index 80b388278149..8603a9881529 100644
--- a/arch/arm64/include/asm/lse.h
+++ b/arch/arm64/include/asm/lse.h
@@ -14,8 +14,6 @@
 #include <asm/atomic_lse.h>
 #include <asm/cpucaps.h>
 
-__asm__(".arch_extension	lse");
-
 extern struct static_key_false cpu_hwcap_keys[ARM64_NCAPS];
 extern struct static_key_false arm64_const_caps_ready;
 
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-10-15  0:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 20:14 [PATCH] arm64: lse: fix LSE atomics with LLVM's integrated assembler Sami Tolvanen
2019-10-07 20:28 ` Nick Desaulniers
2019-10-07 21:24   ` Sami Tolvanen
2019-10-07 21:46     ` Nick Desaulniers
2019-10-08 15:22       ` Sami Tolvanen
2019-10-08 16:18         ` Robin Murphy
2019-10-08 21:03           ` Ard Biesheuvel
2019-10-09 10:03             ` Robin Murphy
2019-10-08  8:37   ` Andrew Murray
2019-10-08 21:27 ` [PATCH v2] " Sami Tolvanen
2019-10-08 22:15   ` Nick Desaulniers
2019-10-08 23:31   ` Andrew Murray
2019-10-08 23:59     ` Sami Tolvanen
2019-10-09  0:01       ` Nathan Chancellor
2019-10-09  8:29         ` Andrew Murray
2019-10-10 20:59   ` Kees Cook
2019-10-15  0:33   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).