mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
bpf: disasm: add support for BPF_JMP|BPF_JA|BPF_X
Add support for indirect jump instruction. Example output from bpftool: 0: (79) r3 = *(u64 *)(r1 +0) 1: (25) if r3 > 0x4 goto pc+666 2: (67) r3 <<= 3 3: (18) r1 = 0xffffbeefspameggs 5: (0f) r1 += r3 6: (79) r1 = *(u64 *)(r1 +0) 7: (0d) gotox r1 Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20251105090410.1250500-10-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
493d9e0d60
commit
bc414d3583
1 changed files with 3 additions and 0 deletions
|
|
@ -358,6 +358,9 @@ void print_bpf_insn(const struct bpf_insn_cbs *cbs,
|
|||
} else if (insn->code == (BPF_JMP | BPF_JA)) {
|
||||
verbose(cbs->private_data, "(%02x) goto pc%+d\n",
|
||||
insn->code, insn->off);
|
||||
} else if (insn->code == (BPF_JMP | BPF_JA | BPF_X)) {
|
||||
verbose(cbs->private_data, "(%02x) gotox r%d\n",
|
||||
insn->code, insn->dst_reg);
|
||||
} else if (insn->code == (BPF_JMP | BPF_JCOND) &&
|
||||
insn->src_reg == BPF_MAY_GOTO) {
|
||||
verbose(cbs->private_data, "(%02x) may_goto pc%+d\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue