linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	netdev@vger.kernel.org
Cc: Matt Evans <matt@ozlabs.org>,
	Denis Kirjanov <kda@linux-powerpc.org>,
	Paul Mackerras <paulus@samba.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"David S. Miller" <davem@davemloft.net>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Subject: Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF
Date: Wed, 22 Jun 2016 20:37:43 +1000	[thread overview]
Message-ID: <1466591863.29871.1.camel@ellerman.id.au> (raw)
In-Reply-To: <908d3552b5eb240b28f70aee7c4c86e2b600aa02.1465304785.git.naveen.n.rao@linux.vnet.ibm.com>

On Tue, 2016-06-07 at 19:02 +0530, Naveen N. Rao wrote:

> PPC64 eBPF JIT compiler.
> 
> Enable with:
> echo 1 > /proc/sys/net/core/bpf_jit_enable
> or
> echo 2 > /proc/sys/net/core/bpf_jit_enable
> 
> ... to see the generated JIT code. This can further be processed with
> tools/net/bpf_jit_disasm.
> 
> With CONFIG_TEST_BPF=m and 'modprobe test_bpf':
> test_bpf: Summary: 305 PASSED, 0 FAILED, [297/297 JIT'ed]
> 
> ... on both ppc64 BE and LE.
> 
> The details of the approach are documented through various comments in
> the code.

This is crashing for me on a Cell machine, not sure why at a glance:


test_bpf: #250 JMP_JSET_X: if (0x3 & 0xffffffff) return 1 jited:1 14 PASS
test_bpf: #251 JMP_JA: Jump, gap, jump, ... jited:1 15 PASS
test_bpf: #252 BPF_MAXINSNS: Maximum possible literals 
Unable to handle kernel paging request for data at address 0xd000000007b20000
Faulting instruction address: 0xc000000000667b6c
cpu 0x0: Vector: 300 (Data Access) at [c0000007f83bf3a0]
    pc: c000000000667b6c: .flush_icache_range+0x3c/0x84
    lr: c000000000082354: .bpf_int_jit_compile+0x1fc/0x2c8
    sp: c0000007f83bf620
   msr: 900000000200b032
   dar: d000000007b20000
 dsisr: 40000000
  current = 0xc0000007f8249580
  paca    = 0xc00000000fff0000	 softe: 0	 irq_happened: 0x01
    pid   = 1822, comm = insmod
Linux version 4.7.0-rc3-00061-g007c99b9d8c1 (michael@ka3.ozlabs.ibm.com) (gcc version 6.1.0 (GCC) ) #3 SMP Wed Jun 22 19:22:23 AEST 2016
enter ? for help
[link register   ] c000000000082354 .bpf_int_jit_compile+0x1fc/0x2c8
[c0000007f83bf620] c0000000000822fc .bpf_int_jit_compile+0x1a4/0x2c8 (unreliable)
[c0000007f83bf700] c00000000013cda4 .bpf_prog_select_runtime+0x24/0x108
[c0000007f83bf780] c000000000548918 .bpf_prepare_filter+0x9b0/0x9e8
[c0000007f83bf830] c0000000005489d4 .bpf_prog_create+0x84/0xd0
[c0000007f83bf8c0] d000000003b21158 .test_bpf_init+0x28c/0x83c [test_bpf]
[c0000007f83bfa00] c00000000000a7b4 .do_one_initcall+0x5c/0x1c0
[c0000007f83bfae0] c000000000669058 .do_init_module+0x80/0x21c
[c0000007f83bfb80] c00000000011e3a0 .load_module+0x2028/0x23a8
[c0000007f83bfd20] c00000000011e898 .SyS_init_module+0x178/0x1b0
[c0000007f83bfe30] c000000000009220 system_call+0x38/0x110
--- Exception: c01 (System Call) at 000000000ff5e0c4
SP (ffde0960) is in userspace
0:mon> r
R00 = 000000000000c01c   R16 = 0000000000000000
R01 = c0000007f83bf620   R17 = 00000000024000c0
R02 = c00000000094ce00   R18 = 0000000000000000
R03 = d000000007b10000   R19 = d000000003c32df0
R04 = d000000007b40338   R20 = c00000000072b488
R05 = 000000000000007f   R21 = d000000007b10000
R06 = d000000007b20000   R22 = c00000000098184c
R07 = 0000000000000080   R23 = 0000000000000000
R08 = 0000000000000607   R24 = 00000000000300e0
R09 = 0000000000000007   R25 = 000000000000c020
R10 = c000000000861ee0   R26 = d000000007b10270
R11 = c0000000006755f8   R27 = c0000007fe0e0000
R12 = d000000007b10270   R28 = 0000000000002003
R13 = c00000000fff0000   R29 = c0000007f83bf690
R14 = d000000003c32d61   R30 = 0000000000000003
R15 = 0000000000000000   R31 = d000000007ae0000
pc  = c000000000667b6c .flush_icache_range+0x3c/0x84
lr  = c000000000082354 .bpf_int_jit_compile+0x1fc/0x2c8
msr = 900000000200b032   cr  = 44000248
ctr = 0000000000000407   xer = 0000000020000000   trap =  300
dar = d000000007b20000   dsisr = 40000000
0:mon> S
msr  = 9000000000001032  sprg0= 0000000000008001
pvr  = 0000000000703000  sprg1= c00000000fff0000
dec  = 000000009f2d8ba4  sprg2= c00000000fff0000
sp   = c0000007f83bed30  sprg3= 0000000000000000
toc  = c00000000094ce00  dar  = d000000007b20000
0:mon> u
SLB contents of cpu 0x0
00 c000000008000000 0000af32f5079500 256M ESID=c00000000  VSID=    af32f5079 LLP:100 
01 d000000008000000 0000836935091510 256M ESID=d00000000  VSID=    836935091 LLP:110 
02 c0000007f8000000 0000b52186c20500 256M ESID=c0000007f  VSID=    b52186c20 LLP:100 
03 c0000003f0000000 0000b224435e0500
04 c0000007f0000000 0000b52186c20500
05 c0000003f0000000 0000b224435e0500
06 c0000007f0000000 0000b52186c20500
07 c0000003f0000000 0000b224435e0500
08 c0000007f0000000 0000b52186c20500
09 c0000003f0000000 0000b224435e0500
10 c0000007f0000000 0000b52186c20500
11 c0000003f0000000 0000b224435e0500
12 c0000007f0000000 0000b52186c20500
13 c0000003f0000000 0000b224435e0500
14 c0000007f0000000 0000b52186c20500
15 c0000003f0000000 0000b224435e0500
16 c0000007f0000000 0000b52186c20500
17 c000000078000000 0000af86a8668500 256M ESID=c00000007  VSID=    af86a8668 LLP:100 
18 c0000003f0000000 0000b224435e0500
19 c0000007f0000000 0000b52186c20500
20 c0000003f0000000 0000b224435e0500
21 c0000007f0000000 0000b52186c20500
22 c0000003f0000000 0000b224435e0500
23 c0000007f0000000 0000b52186c20500
24 c0000003f0000000 0000b224435e0500
25 c0000007f0000000 0000b52186c20500
26 c0000003f0000000 0000b224435e0500
27 c0000007f0000000 0000b52186c20500
28 c0000003f0000000 0000b224435e0500
29 c0000007f0000000 0000b52186c20500
30 c0000003f0000000 0000b224435e0500
31 c0000007f0000000 0000b52186c20500
32 c0000003f0000000 0000b224435e0500
33 c0000007f0000000 0000b52186c20500
34 c0000003f0000000 0000b224435e0500
35 c0000007f0000000 0000b52186c20500
36 c0000003f0000000 0000b224435e0500
37 c0000007f0000000 0000b52186c20500
38 c0000003f0000000 0000b224435e0500
39 c0000007f0000000 0000b52186c20500
40 c0000003f0000000 0000b224435e0500
41 c0000007f0000000 0000b52186c20500
42 c0000003f0000000 0000b224435e0500
43 c0000007f0000000 0000b52186c20500
44 c0000003f0000000 0000b224435e0500
45 c0000007f0000000 0000b52186c20500
46 c0000003f0000000 0000b224435e0500
47 c0000007f0000000 0000b52186c20500
48 c0000003f0000000 0000b224435e0500
49 d000080088000000 00007e4fa575c510 256M ESID=d00008008  VSID=    7e4fa575c LLP:110 
50 c0000007f0000000 0000b52186c20500
51 c0000003f0000000 0000b224435e0500
52 c0000007f0000000 0000b52186c20500
53 c0000003f0000000 0000b224435e0500
54 c0000007f0000000 0000b52186c20500
55 c0000003f0000000 0000b224435e0500
56 c0000007f0000000 0000b52186c20500
57 c0000003f8000000 0000b224435e0500 256M ESID=c0000003f  VSID=    b224435e0 LLP:100 
58 f000000008000000 00002bd5b50c1500 256M ESID=f00000000  VSID=    2bd5b50c1 LLP:100 
59 c0000007f0000000 0000b52186c20500
60 c0000003f0000000 0000b224435e0500
61 c0000007f0000000 0000b52186c20500
62 c0000003f0000000 0000b224435e0500
63 c0000007f0000000 0000b52186c20500
0:mon> 



cheers

  parent reply	other threads:[~2016-06-22 10:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 13:32 [PATCH 0/6] eBPF JIT for PPC64 Naveen N. Rao
2016-06-07 13:32 ` [PATCH 1/6] ppc: bpf/jit: Fix/enhance 32-bit Load Immediate implementation Naveen N. Rao
2016-06-07 13:32 ` [PATCH 2/6] ppc: bpf/jit: Optimize 64-bit Immediate loads Naveen N. Rao
2016-06-07 13:32 ` [PATCH 3/6] ppc: bpf/jit: Introduce rotate immediate instructions Naveen N. Rao
2016-06-07 13:32 ` [PATCH 4/6] ppc: bpf/jit: A few cleanups Naveen N. Rao
2016-06-07 13:32 ` [PATCH 5/6] ppc: bpf/jit: Isolate classic BPF JIT specifics into a separate header Naveen N. Rao
2016-06-07 13:32 ` [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF Naveen N. Rao
2016-06-07 22:56   ` Alexei Starovoitov
2016-06-08 17:17     ` Naveen N. Rao
2016-06-09  3:19   ` Nilay Vaish
2016-06-09  6:07     ` Naveen N. Rao
2016-06-17 12:53   ` [6/6] " Michael Ellerman
2016-06-17 13:00     ` [PATCH] ppc: Fix BPF JIT for ABIv2 Thadeu Lima de Souza Cascardo
2016-06-19 17:49       ` Naveen N. Rao
2016-06-20 18:56         ` Thadeu Lima de Souza Cascardo
2016-06-21  8:58           ` Naveen N. Rao
2016-06-21 11:15             ` Michael Ellerman
2016-06-21 14:47               ` Thadeu Lima de Souza Cascardo
2016-06-21 15:45                 ` Alexei Starovoitov
2016-06-22  4:06                   ` Michael Ellerman
2016-06-22  7:12                 ` Naveen N. Rao
2016-06-22 14:57                   ` Naveen N. Rao
2016-06-22  5:20             ` Michael Ellerman
2016-06-22  5:18       ` Michael Ellerman
2016-06-19 17:36     ` [6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF Naveen N. Rao
2016-06-20 23:38       ` Michael Ellerman
2016-06-21  6:58         ` Naveen N. Rao
2016-06-21 11:04           ` Michael Ellerman
2016-06-22  7:06             ` Naveen N. Rao
2016-06-22 10:37   ` Michael Ellerman [this message]
2016-06-22 12:32     ` [PATCH 6/6] " Naveen N. Rao
2016-06-11  5:47 ` [PATCH 0/6] eBPF JIT for PPC64 David Miller
2016-06-13  5:40   ` Naveen N. Rao
2016-06-18  4:57     ` mpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466591863.29871.1.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=ananth@in.ibm.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kda@linux-powerpc.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matt@ozlabs.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).