Commit 6cef3003 authored by Martin Schwidefsky's avatar Martin Schwidefsky

s390/bpf,jit: fix prolog oddity

The prolog of functions generated by the bpf jit compiler uses an
instruction sequence with an "ahi" instruction to create stack space
instead of using an "aghi" instruction. Using the 32-bit "ahi" is not
wrong as the stack we are operating on is an order-4 allocation which
is always aligned to 16KB. But it is more consistent to use an "aghi"
as the stack pointer is a 64-bit value.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 12325f09
...@@ -156,8 +156,8 @@ static void bpf_jit_prologue(struct bpf_jit *jit) ...@@ -156,8 +156,8 @@ static void bpf_jit_prologue(struct bpf_jit *jit)
EMIT6(0xeb8ff058, 0x0024); EMIT6(0xeb8ff058, 0x0024);
/* lgr %r14,%r15 */ /* lgr %r14,%r15 */
EMIT4(0xb90400ef); EMIT4(0xb90400ef);
/* ahi %r15,<offset> */ /* aghi %r15,<offset> */
EMIT4_IMM(0xa7fa0000, (jit->seen & SEEN_MEM) ? -112 : -80); EMIT4_IMM(0xa7fb0000, (jit->seen & SEEN_MEM) ? -112 : -80);
/* stg %r14,152(%r15) */ /* stg %r14,152(%r15) */
EMIT6(0xe3e0f098, 0x0024); EMIT6(0xe3e0f098, 0x0024);
} else if ((jit->seen & SEEN_XREG) && (jit->seen & SEEN_LITERAL)) } else if ((jit->seen & SEEN_XREG) && (jit->seen & SEEN_LITERAL))
......
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