Commit 5eda25b1 authored by Martin Schwidefsky's avatar Martin Schwidefsky

s390/lib: use expoline for all bcr instructions

The memove, memset, memcpy, __memset16, __memset32 and __memset64
function have an additional indirect return branch in form of a
"bzr" instruction. These need to use expolines as well.

Cc: <> # v4.17+
Fixes: 97489e06 ("s390/lib: use expoline for indirect branches")
Reviewed-by: default avatarHeiko Carstens <>
Signed-off-by: default avatarMartin Schwidefsky <>
parent fb7d7518
......@@ -17,7 +17,7 @@
ltgr %r4,%r4
lgr %r1,%r2
bzr %r14
jz .Lmemmove_exit
aghi %r4,-1
clgr %r2,%r3
jnh .Lmemmove_forward
......@@ -36,6 +36,7 @@ ENTRY(memmove)
larl %r5,.Lmemmove_mvc
ex %r4,0(%r5)
BR_EX %r14
ic %r0,0(%r4,%r3)
......@@ -65,7 +66,7 @@ EXPORT_SYMBOL(memmove)
ltgr %r4,%r4
bzr %r14
jz .Lmemset_exit
ltgr %r3,%r3
jnz .Lmemset_fill
aghi %r4,-1
......@@ -80,6 +81,7 @@ ENTRY(memset)
larl %r3,.Lmemset_xc
ex %r4,0(%r3)
BR_EX %r14
cghi %r4,1
......@@ -115,7 +117,7 @@ EXPORT_SYMBOL(memset)
ltgr %r4,%r4
bzr %r14
jz .Lmemcpy_exit
aghi %r4,-1
srlg %r5,%r4,8
ltgr %r5,%r5
......@@ -124,6 +126,7 @@ ENTRY(memcpy)
larl %r5,.Lmemcpy_mvc
ex %r4,0(%r5)
BR_EX %r14
mvc 0(256,%r1),0(%r3)
......@@ -145,9 +148,9 @@ EXPORT_SYMBOL(memcpy)
.macro __MEMSET bits,bytes,insn
ltgr %r4,%r4
bzr %r14
jz .L__memset_exit\bits
cghi %r4,\bytes
je .L__memset_exit\bits
je .L__memset_store\bits
aghi %r4,-(\bytes+1)
srlg %r5,%r4,8
ltgr %r5,%r5
......@@ -163,8 +166,9 @@ ENTRY(__memset\bits)
larl %r5,.L__memset_mvc\bits
ex %r4,0(%r5)
BR_EX %r14
\insn %r3,0(%r2)
BR_EX %r14
mvc \bytes(1,%r1),0(%r1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment