Skip to contentSkip to conversation

s390/bpf: Use bcr 0,%0 as tail call nop filler

PATCH Applied Ilya Leoshkevich 2 participants 2 messages Jun 2, 2020

Subsystems (3)
lore
Share & tools
lore

Ilya Leoshkevich

author maintainer
#0 lore raw

PATCH 1/1 s390/bpf: Use bcr 0,%0 as tail call nop filler

Currently used 0x0000 filler confuses bfd disassembler, making bpftool prog dump xlated output nearly useless. Fix by using a real instruction.

---
 arch/s390/net/bpf_jit_comp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/s390/net/bpf_jit_comp.c +2 -1
index 0f37a1b635f8..f4242b894cf2 100644
@@ -503,7 +503,8 @@ static void bpf_jit_prologue(struct bpf_jit *jit, u32 stack_depth)
 	} else {
 		/* j tail_call_start: NOP if no tail calls are used */
 		EMIT4_PCREL(0xa7f40000, 6);
-		_EMIT2(0);
+		/* bcr 0,%0 */
+		EMIT2(0x0700, 0, REG_0);
 	}
 	/* Tail calls have to skip above initialization */
 	jit->tail_call_start = jit->prg;
Signature · 1 line
2.25.4
maintainer Applied
#1 lore raw
Quoted 4 lines · Ilya Leoshkevich

Currently used 0x0000 filler confuses bfd disassembler, making bpftool prog dump xlated output nearly useless. Fix by using a real instruction.

Applied, thanks!