Skip to content

Commit 430693c

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/lowcore: Use inline qualifier for get_lowcore() inline assembly
Use asm_inline to let the compiler know that the get_lowcore() inline assembly has the smallest possible size. The ALTERNATIVE construct is used to generate a single instruction, however the macro expands to multiple lines. GCC uses the number of lines of an inline assembly to count the number of instructions within an inline assembly, which then has an effect on inlining decisions. In order to avoid incorrect assumptions use asm_inline. The result is that more functions are inlined, which results in a small growth of the kernel image: add/remove: 59/480 grow/shrink: 854/647 up/down: 168780/-162394 (6386) Reviewed-by: Juergen Christ <jchrist@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 20de8f8 commit 430693c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

arch/s390/include/asm/lowcore.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,12 @@ static __always_inline struct lowcore *get_lowcore(void)
223223

224224
if (__is_defined(__DECOMPRESSOR))
225225
return NULL;
226-
asm(ALTERNATIVE("llilh %[lc],0", "llilh %[lc],%[alt]", ALT_FEATURE(MFEATURE_LOWCORE))
227-
: [lc] "=d" (lc)
228-
: [alt] "i" (LOWCORE_ALT_ADDRESS >> 16));
226+
asm_inline(
227+
ALTERNATIVE(" llilh %[lc],0",
228+
" llilh %[lc],%[alt]",
229+
ALT_FEATURE(MFEATURE_LOWCORE))
230+
: [lc] "=d" (lc)
231+
: [alt] "i" (LOWCORE_ALT_ADDRESS >> 16));
229232
return lc;
230233
}
231234

0 commit comments

Comments
 (0)