Skip to content

Commit dee72f8

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Alexei Starovoitov says: ==================== pull-request: bpf-next 2020-07-21 The following pull-request contains BPF updates for your *net-next* tree. We've added 46 non-merge commits during the last 6 day(s) which contain a total of 68 files changed, 4929 insertions(+), 526 deletions(-). The main changes are: 1) Run BPF program on socket lookup, from Jakub. 2) Introduce cpumap, from Lorenzo. 3) s390 JIT fixes, from Ilya. 4) teach riscv JIT to emit compressed insns, from Luke. 5) use build time computed BTF ids in bpf iter, from Yonghong. ==================== Purely independent overlapping changes in both filter.h and xdp.h Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents fa56a98 + 9165e1d commit dee72f8

68 files changed

Lines changed: 4930 additions & 526 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/riscv/net/bpf_jit.h‎

Lines changed: 480 additions & 3 deletions
Large diffs are not rendered by default.

‎arch/riscv/net/bpf_jit_comp32.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ static int emit_branch_r64(const s8 *src1, const s8 *src2, s32 rvoff,
644644

645645
e = ctx->ninsns;
646646
/* Adjust for extra insns. */
647-
rvoff -= (e - s) << 2;
647+
rvoff -= ninsns_rvoff(e - s);
648648
emit_jump_and_link(RV_REG_ZERO, rvoff, true, ctx);
649649
return 0;
650650
}
@@ -713,7 +713,7 @@ static int emit_bcc(u8 op, u8 rd, u8 rs, int rvoff, struct rv_jit_context *ctx)
713713
if (far) {
714714
e = ctx->ninsns;
715715
/* Adjust for extra insns. */
716-
rvoff -= (e - s) << 2;
716+
rvoff -= ninsns_rvoff(e - s);
717717
emit_jump_and_link(RV_REG_ZERO, rvoff, true, ctx);
718718
}
719719
return 0;
@@ -731,7 +731,7 @@ static int emit_branch_r32(const s8 *src1, const s8 *src2, s32 rvoff,
731731

732732
e = ctx->ninsns;
733733
/* Adjust for extra insns. */
734-
rvoff -= (e - s) << 2;
734+
rvoff -= ninsns_rvoff(e - s);
735735

736736
if (emit_bcc(op, lo(rs1), lo(rs2), rvoff, ctx))
737737
return -1;
@@ -795,7 +795,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx)
795795
* if (index >= max_entries)
796796
* goto out;
797797
*/
798-
off = (tc_ninsn - (ctx->ninsns - start_insn)) << 2;
798+
off = ninsns_rvoff(tc_ninsn - (ctx->ninsns - start_insn));
799799
emit_bcc(BPF_JGE, lo(idx_reg), RV_REG_T1, off, ctx);
800800

801801
/*
@@ -804,7 +804,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx)
804804
* goto out;
805805
*/
806806
emit(rv_addi(RV_REG_T1, RV_REG_TCC, -1), ctx);
807-
off = (tc_ninsn - (ctx->ninsns - start_insn)) << 2;
807+
off = ninsns_rvoff(tc_ninsn - (ctx->ninsns - start_insn));
808808
emit_bcc(BPF_JSLT, RV_REG_TCC, RV_REG_ZERO, off, ctx);
809809

810810
/*
@@ -818,7 +818,7 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx)
818818
if (is_12b_check(off, insn))
819819
return -1;
820820
emit(rv_lw(RV_REG_T0, off, RV_REG_T0), ctx);
821-
off = (tc_ninsn - (ctx->ninsns - start_insn)) << 2;
821+
off = ninsns_rvoff(tc_ninsn - (ctx->ninsns - start_insn));
822822
emit_bcc(BPF_JEQ, RV_REG_T0, RV_REG_ZERO, off, ctx);
823823

824824
/*
@@ -1214,7 +1214,7 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
12141214
emit_imm32(tmp2, imm, ctx);
12151215
src = tmp2;
12161216
e = ctx->ninsns;
1217-
rvoff -= (e - s) << 2;
1217+
rvoff -= ninsns_rvoff(e - s);
12181218
}
12191219

12201220
if (is64)

0 commit comments

Comments
 (0)