Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions arch/arm64/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
emit(A64_ASR(is64, dst, dst, imm), ctx);
break;

/* JUMP reg */
case BPF_JMP | BPF_JA | BPF_X:
emit(A64_BR(dst), ctx);
break;
/* JUMP off */
case BPF_JMP | BPF_JA:
case BPF_JMP32 | BPF_JA:
Expand Down Expand Up @@ -2231,6 +2235,13 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
for (i = 0; i <= prog->len; i++)
ctx.offset[i] *= AARCH64_INSN_SIZE;
bpf_prog_fill_jited_linfo(prog, ctx.offset + 1);
/*
* The bpf_prog_update_insn_ptrs function expects offsets to
* point to the first byte of the jitted instruction (unlike
* the bpf_prog_fill_jited_linfo above, which, for historical
* reasons, expects to point to the next instruction)
*/
bpf_prog_update_insn_ptrs(prog, ctx.offset, ctx.ro_image);
out_off:
if (!ro_header && priv_stack_ptr) {
free_percpu(priv_stack_ptr);
Expand Down
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/progs/verifier_gotox.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "bpf_misc.h"
#include "../../../include/linux/filter.h"

#ifdef __TARGET_ARCH_x86
#if defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)

#define DEFINE_SIMPLE_JUMP_TABLE_PROG(NAME, SRC_REG, OFF, IMM, OUTCOME) \
\
Expand Down Expand Up @@ -384,6 +384,6 @@ jt0_%=: \
: __clobber_all);
}

#endif /* __TARGET_ARCH_x86 */
#endif /* __TARGET_ARCH_x86 || __TARGET_ARCH_arm64 */

char _license[] SEC("license") = "GPL";
Loading