Commit 49a97f99 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Kleber Sacilotto de Souza

s390: fix br_r1_trampoline for machines without exrl

BugLink: https://bugs.launchpad.net/bugs/1792392

commit 26f84384 upstream.

For machines without the exrl instruction the BFP jit generates
code that uses an "br %r1" instruction located in the lowcore page.
Unfortunately there is a cut & paste error that puts an additional
"larl %r1,.+14" instruction in the code that clobbers the branch
target address in %r1. Remove the larl instruction.

Cc: <stable@vger.kernel.org> # v4.17+
Fixes: de5cb6eb ("s390: use expoline thunks in the BPF JIT")
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent f8bf5a8a
...@@ -522,8 +522,6 @@ static void bpf_jit_epilogue(struct bpf_jit *jit) ...@@ -522,8 +522,6 @@ static void bpf_jit_epilogue(struct bpf_jit *jit)
/* br %r1 */ /* br %r1 */
_EMIT2(0x07f1); _EMIT2(0x07f1);
} else { } else {
/* larl %r1,.+14 */
EMIT6_PCREL_RILB(0xc0000000, REG_1, jit->prg + 14);
/* ex 0,S390_lowcore.br_r1_tampoline */ /* ex 0,S390_lowcore.br_r1_tampoline */
EMIT4_DISP(0x44000000, REG_0, REG_0, EMIT4_DISP(0x44000000, REG_0, REG_0,
offsetof(struct _lowcore, br_r1_trampoline)); offsetof(struct _lowcore, br_r1_trampoline));
......
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