lkml.org 
[lkml]   [2022]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/8] s390/entry: workaround llvm's IAS limitations
Date
llvm's integrated assembler cannot handle immediate values which are
calculated with two local labels:

<instantiation>:3:13: error: invalid operand for instruction
clgfi %r14,.Lsie_done - .Lsie_gmap

Workaround this by adding clang specific code which reads the specific
value from memory. Since this code is within the hot paths of the kernel
and adds an additional memory reference, keep the original code, and add
ifdef'ed code.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/kernel/entry.S | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index e1664b45090f..ff7a75078e93 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -171,8 +171,19 @@ _LPP_OFFSET = __LC_LPP
.macro OUTSIDE reg,start,end,outside_label
larl %r14,\start
slgrk %r14,\reg,%r14
+#ifdef CONFIG_CC_IS_CLANG
+ clgfrl %r14,.Lrange_size\@
+#else
clgfi %r14,\end - \start
+#endif
jhe \outside_label
+#ifdef CONFIG_CC_IS_CLANG
+ .section .rodata, "a"
+ .align 4
+.Lrange_size\@:
+ .long \end - \start
+ .previous
+#endif
.endm

.macro SIEEXIT
--
2.32.0
\
 
 \ /
  Last update: 2022-05-11 14:07    [W:0.174 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site