diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-07-30 12:42:47 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-30 11:13:20 -0700 |
commit | 7b36f92934e40d1ee24e5617ddedb852e10086ca (patch) | |
tree | 13d386f67becd762c92ce75ae4277ab36bf500f9 /arch/s390/net | |
parent | 4962fa10f30d7b563f38467feeae10314b166c77 (diff) | |
download | linux-7b36f92934e40d1ee24e5617ddedb852e10086ca.tar.bz2 |
bpf: provide helper that indicates eBPF was migrated
During recent discussions we had with Michael, we found that it would
be useful to have an indicator that tells the JIT that an eBPF program
had been migrated from classic instructions into eBPF instructions, as
only in that case A and X need to be cleared in the prologue. Such eBPF
programs do not set a particular type, but all have BPF_PROG_TYPE_UNSPEC.
Thus, introduce a small helper for cde66c2d88da ("s390/bpf: Only clear
A and X for converted BPF programs") and possibly others in future.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/s390/net')
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index bbbac6da37af..9f4bbc09bf07 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -1245,7 +1245,7 @@ static int bpf_jit_prog(struct bpf_jit *jit, struct bpf_prog *fp) jit->lit = jit->lit_start; jit->prg = 0; - bpf_jit_prologue(jit, fp->type == BPF_PROG_TYPE_UNSPEC); + bpf_jit_prologue(jit, bpf_prog_was_classic(fp)); for (i = 0; i < fp->len; i += insn_count) { insn_count = bpf_jit_insn(jit, fp, i); if (insn_count < 0) |