/linux/arch/loongarch/net/ |
H A D | bpf_jit.h | 204 enum loongarch_gpr rd, int jmp_offset) in cond_jmp_offset() argument 209 emit_insn(ctx, beq, rj, rd, jmp_offset); in cond_jmp_offset() 214 emit_insn(ctx, bne, rj, rd, jmp_offset); in cond_jmp_offset() 218 emit_insn(ctx, bltu, rd, rj, jmp_offset); in cond_jmp_offset() 222 emit_insn(ctx, bltu, rj, rd, jmp_offset); in cond_jmp_offset() 226 emit_insn(ctx, bgeu, rj, rd, jmp_offset); in cond_jmp_offset() 230 emit_insn(ctx, bgeu, rd, rj, jmp_offset); in cond_jmp_offset() 234 emit_insn(ctx, blt, rd, rj, jmp_offset); in cond_jmp_offset() 238 emit_insn(ctx, blt, rj, rd, jmp_offset); in cond_jmp_offset() 242 emit_insn(ctx, bge, rj, rd, jmp_offset); in cond_jmp_offset() [all …]
|
H A D | bpf_jit.c | 223 #define jmp_offset (out_offset - (cur_offset)) in emit_bpf_tail_call() macro 236 if (emit_tailcall_jmp(ctx, BPF_JGE, a2, t1, jmp_offset) < 0) in emit_bpf_tail_call() 244 if (emit_tailcall_jmp(ctx, BPF_JSLT, REG_TCC, LOONGARCH_GPR_ZERO, jmp_offset) < 0) in emit_bpf_tail_call() 256 if (emit_tailcall_jmp(ctx, BPF_JEQ, t2, LOONGARCH_GPR_ZERO, jmp_offset) < 0) in emit_bpf_tail_call() 279 #undef jmp_offset in emit_bpf_tail_call() 464 int ret, jmp_offset; in build_insn() local 811 jmp_offset = bpf2la_offset(i, off, ctx); in build_insn() 821 if (emit_cond_jmp(ctx, cond, t1, t2, jmp_offset) < 0) in build_insn() 846 jmp_offset = bpf2la_offset(i, off, ctx); in build_insn() 862 if (emit_cond_jmp(ctx, cond, t2, tm, jmp_offset) < 0) in build_insn() [all …]
|
/linux/arch/x86/net/ |
H A D | bpf_jit_comp32.c | 1579 s64 jmp_offset; in emit_kfunc_call() local 1631 jmp_offset = (u8 *)__bpf_call_base + insn->imm - end_addr; in emit_kfunc_call() 1632 if (!is_simm32(jmp_offset)) { in emit_kfunc_call() 1634 jmp_offset); in emit_kfunc_call() 1638 EMIT1_off32(0xE8, jmp_offset); in emit_kfunc_call() 1681 s64 jmp_offset; in do_jit() local 2107 jmp_offset = func - (image + addrs[i]); in do_jit() 2109 if (!imm32 || !is_simm32(jmp_offset)) { in do_jit() 2127 EMIT1_off32(0xE8, jmp_offset + 9); in do_jit() 2365 jmp_offset = addrs[i + insn->off] - addrs[i]; in do_jit() [all …]
|
H A D | bpf_jit_comp.c | 1521 s64 jmp_offset; in do_jit() local 2348 jmp_offset = addrs[i + insn->off] - addrs[i]; in do_jit() 2349 if (is_imm8_jmp_offset(jmp_offset)) { in do_jit() 2374 EMIT2(jmp_cond, jmp_offset); in do_jit() 2375 } else if (is_simm32(jmp_offset)) { in do_jit() 2376 EMIT2_off32(0x0F, jmp_cond + 0x10, jmp_offset); in do_jit() 2378 pr_err("cond_jmp gen bug %llx\n", jmp_offset); in do_jit() 2394 jmp_offset = -2; in do_jit() 2396 jmp_offset = addrs[i + insn->off] - addrs[i]; in do_jit() 2399 jmp_offset = -2; in do_jit() [all …]
|
/linux/arch/arm/net/ |
H A D | bpf_jit_32.c | 1405 #define jmp_offset (out_offset - (cur_offset) - 2) in emit_bpf_tail_call() macro 1423 _emit(ARM_COND_CS, ARM_B(jmp_offset), ctx); in emit_bpf_tail_call() 1437 _emit(ARM_COND_CS, ARM_B(jmp_offset), ctx); in emit_bpf_tail_call() 1451 _emit(ARM_COND_EQ, ARM_B(jmp_offset), ctx); in emit_bpf_tail_call() 1471 #undef jmp_offset in emit_bpf_tail_call() 1602 s32 jmp_offset; in build_insn() local 1992 jmp_offset = bpf2a32_offset(i+off, i, ctx); in build_insn() 1996 _emit(ARM_COND_NE, ARM_B(jmp_offset), ctx); in build_insn() 1999 _emit(ARM_COND_EQ, ARM_B(jmp_offset), ctx); in build_insn() 2002 _emit(ARM_COND_HI, ARM_B(jmp_offset), ctx); in build_insn() [all …]
|
/linux/arch/riscv/net/ |
H A D | bpf_jit_comp64.c | 480 int jmp_offset; in emit_atomic() local 551 jmp_offset = ninsns_rvoff(8); in emit_atomic() 552 emit(rv_bne(RV_REG_T2, r0, jmp_offset >> 1), ctx); in emit_atomic() 555 jmp_offset = ninsns_rvoff(-6); in emit_atomic() 556 emit(rv_bne(RV_REG_T3, 0, jmp_offset >> 1), ctx); in emit_atomic()
|