[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f27b1dfe-4ea2-5737-d3d5-21cb581d1927@solarflare.com>
Date: Tue, 26 Sep 2017 16:35:29 +0100
From: Edward Cree <ecree@...arflare.com>
To: <davem@...emloft.net>
CC: <netdev@...r.kernel.org>, <daniel@...earbox.net>,
<alexei.starovoitov@...il.com>, <ys114321@...il.com>
Subject: [PATCH v2 net-next 2/2] bpf/verifier: improve disassembly of BPF_NEG
instructions
BPF_NEG takes only one operand, unlike the bulk of BPF_ALU[64] which are
compound-assignments. So give it its own format in print_bpf_insn().
Signed-off-by: Edward Cree <ecree@...arflare.com>
---
kernel/bpf/verifier.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 3aaa3262..04e0508 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -344,6 +344,11 @@ static void print_bpf_insn(const struct bpf_verifier_env *env,
verbose("BUG_alu64_%02x\n", insn->code);
else
print_bpf_end_insn(env, insn);
+ } else if (BPF_OP(insn->code) == BPF_NEG) {
+ verbose("(%02x) r%d = %s-r%d\n",
+ insn->code, insn->dst_reg,
+ class == BPF_ALU ? "(u32) " : "",
+ insn->dst_reg);
} else if (BPF_SRC(insn->code) == BPF_X) {
verbose("(%02x) %sr%d %s %sr%d\n",
insn->code, class == BPF_ALU ? "(u32) " : "",
Powered by blists - more mailing lists