Skip to content

Commit 4c25f0f

Browse files
committed
s390/entry: workaround llvm's IAS limitations
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. Acked-by: Alexander Gordeev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Carstens <[email protected]>
1 parent e6ed91f commit 4c25f0f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

arch/s390/kernel/entry.S

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,19 @@ _LPP_OFFSET = __LC_LPP
172172
lgr %r14,\reg
173173
larl %r13,\start
174174
slgr %r14,%r13
175-
lghi %r13,\end - \start
176-
clgr %r14,%r13
175+
#ifdef CONFIG_AS_IS_LLVM
176+
clgfrl %r14,.Lrange_size\@
177+
#else
178+
clgfi %r14,\end - \start
179+
#endif
177180
jhe \outside_label
181+
#ifdef CONFIG_AS_IS_LLVM
182+
.section .rodata, "a"
183+
.align 4
184+
.Lrange_size\@:
185+
.long \end - \start
186+
.previous
187+
#endif
178188
.endm
179189

180190
.macro SIEEXIT

0 commit comments

Comments
 (0)