summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-08-04 11:18:01 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-04 11:18:01 -0700
commit7a97325191eecd1343c819291bce48fe0024f7dd (patch)
tree2c279740a51b4998df490a261825494ddffa210f
parent1aff0c3402fbda8c629b12f5490977717cc0e2ab (diff)
parentbad1926dd2f60bbb4af5223ace3a7b34a0219a66 (diff)
downloadlinux-7a97325191eecd1343c819291bce48fe0024f7dd.tar.gz
linux-7a97325191eecd1343c819291bce48fe0024f7dd.tar.bz2
linux-7a97325191eecd1343c819291bce48fe0024f7dd.zip
Merge branch 's390-bpf-jit-fixes'
Daniel Borkmann says: ==================== Two BPF fixes for s390 Found while testing some other work touching JITs. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/s390/net/bpf_jit_comp.c3
-rw-r--r--tools/build/feature/test-bpf.c2
-rw-r--r--tools/lib/bpf/bpf.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 01c6fbc3e85b..1803797fc885 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -1253,7 +1253,8 @@ static int bpf_jit_prog(struct bpf_jit *jit, struct bpf_prog *fp)
insn_count = bpf_jit_insn(jit, fp, i);
if (insn_count < 0)
return -1;
- jit->addrs[i + 1] = jit->prg; /* Next instruction address */
+ /* Next instruction address */
+ jit->addrs[i + insn_count] = jit->prg;
}
bpf_jit_epilogue(jit);
diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
index 7598361ef1f1..da2172ff9662 100644
--- a/tools/build/feature/test-bpf.c
+++ b/tools/build/feature/test-bpf.c
@@ -11,6 +11,8 @@
# define __NR_bpf 280
# elif defined(__sparc__)
# define __NR_bpf 349
+# elif defined(__s390__)
+# define __NR_bpf 351
# else
# error __NR_bpf not defined. libbpf does not support your arch.
# endif
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 256f571f2ab5..e5bbb090bf88 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -39,6 +39,8 @@
# define __NR_bpf 280
# elif defined(__sparc__)
# define __NR_bpf 349
+# elif defined(__s390__)
+# define __NR_bpf 351
# else
# error __NR_bpf not defined. libbpf does not support your arch.
# endif