On Tue, Jul 1, 2014 at 9:23 PM, Namhyung Kim namhy...@gmail.com wrote:
Hi Alexei,
On Fri, 27 Jun 2014 17:05:53 -0700, Alexei Starovoitov wrote:
BPF is used in several kernel components. This split creates logical boundary
between generic eBPF core and the rest
kernel/bpf/core.c: eBPF
On Tue, Jul 1, 2014 at 10:20 PM, Zi Shen Lim zlim@gmail.com wrote:
The JIT compiler emits A64 instructions. It supports eBPF only.
Legacy BPF is supported thanks to conversion by BPF core.
JIT is enabled in the same way as for other architectures:
echo 1
On Tue, Jul 1, 2014 at 10:05 PM, Namhyung Kim namhy...@gmail.com wrote:
Mostly questions and few nitpicks.. :)
great questions. Thank you for review! Answers below:
On Fri, 27 Jun 2014 17:06:00 -0700, Alexei Starovoitov wrote:
+/* types of values:
+ * - stored in an eBPF register
On Tue, Jul 1, 2014 at 10:32 PM, Namhyung Kim namhy...@gmail.com wrote:
On Fri, 27 Jun 2014 17:06:03 -0700, Alexei Starovoitov wrote:
User interface:
cat bpf_123 /sys/kernel/debug/tracing/__event__/filter
where 123 is an id of the eBPF program priorly loaded.
__event__ is static tracepoint
On Tue, Jul 1, 2014 at 11:39 PM, Namhyung Kim namhy...@kernel.org wrote:
On Wed, Jul 2, 2014 at 3:14 PM, Alexei Starovoitov a...@plumgrid.com wrote:
Can manipulate what at compile time? Entry records of tracepoints are
hard coded based on the event. For verifier it's easier to treat all
On Tue, Jul 1, 2014 at 10:20 PM, Zi Shen Lim zlim@gmail.com wrote:
The JIT compiler emits A64 instructions. It supports eBPF only.
Legacy BPF is supported thanks to conversion by BPF core.
JIT is enabled in the same way as for other architectures:
echo 1
On Wed, Jul 2, 2014 at 1:11 AM, David Laight david.lai...@aculab.com wrote:
From: Alexei Starovoitov
...
+#define _(OP) ({ int ret = OP; if (ret 0) return ret; })
...
+ _(get_map_info(env, map_id, map));
Nit: such macros should be removed, please.
It may surely look
On Wed, Jul 2, 2014 at 3:22 PM, Chema Gonzalez ch...@google.com wrote:
+ * - unreachable insns exist (shouldn't be a forest. program = one function)
This seems to me an unnecessary style restriction on user code.
unreachable instructions to me is a ticking time bomb of potential exploits.
On Wed, Jul 2, 2014 at 4:35 PM, Chema Gonzalez ch...@google.com wrote:
On Wed, Jul 2, 2014 at 4:04 PM, Alexei Starovoitov a...@plumgrid.com wrote:
+ reg = regs + BPF_REG_1; /* 1st arg to a function */
+ reg-ptr = PTR_TO_CTX;
Wait, doesn't this depend on doing BPF_MOV64_REG
On Wed, Jul 2, 2014 at 6:43 PM, Andy Lutomirski l...@amacapital.net wrote:
On Tue, Jul 1, 2014 at 10:33 PM, Alexei Starovoitov a...@plumgrid.com wrote:
I want to avoid string names, since they will force new 'strtab', 'symtab'
sections in the programs/maps and will uglify the user interface
() for clarity.
Signed-off-by: Zi Shen Lim zlim@gmail.com
Acked-by: Alexei Starovoitov a...@plumgrid.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please
On Thu, Jul 3, 2014 at 2:13 AM, David Laight david.lai...@aculab.com wrote:
From: Alexei Starovoitov
+#define _(OP) ({ int ret = OP; if (ret 0) return ret; })
+1 to removing the _ macro. If you want to avoid the 3 lines (is there
anything in the style guide against if ((err=OP) 0
filter_check/ - userspace correctness checker of BPF filter
examples/ - BPF filter examples in C
will be compiled by LLVM into .bpf
$cd examples
$make - compile .c into .bpf
$make check - check correctness of *.bpf
$make try - to apply netif_rcv.bpf as a tracing filter
Signed-off-by: Alexei
there.
Future deltas will be easier to review.
Thanks
Alexei Starovoitov (7):
Extended BPF core framework
Extended BPF JIT for x86-64
Extended BPF (64-bit BPF) design document
Revert x86/ptrace: Remove unused regs_get_argument_nth API
use BPF in tracing filters
LLVM BPF backend
tracing
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/bpf_jit.txt | 204 +
1 file changed, 204 insertions(+)
create mode 100644 Documentation/bpf_jit.txt
diff --git a/Documentation/bpf_jit.txt b/Documentation/bpf_jit.txt
new file mode
This reverts commit aa5add93e92019018e905146f8c3d3f8e3c08300.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/include/asm/ptrace.h |3 +++
arch/x86/kernel/ptrace.c | 24
2 files changed, 27 insertions(+)
diff --git a/arch/x86/include/asm
prototype is 'int dst_discard(struct sk_buff *skb);'
bpf_load_pointer() will try to fetch 'dev' field of 'sk_buff'
structure and will suppress page-fault if pointer is incorrect.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/ftrace_event.h |5 +
include/trace
.
Allowing zero-overhead calls between BPF filter and safe kernel functions
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/Kconfig |1 +
arch/x86/net/Makefile |1 +
arch/x86/net/bpf64_jit_comp.c | 625 +
arch
for efficient mapping to native
instructions on 64-bit CPUs
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/bpf.h| 149 +++
include/linux/bpf_jit.h| 134 ++
kernel/Makefile|1 +
kernel/bpf_jit/Makefile|3 +
kernel/bpf_jit/bpf_check.c | 1054
On Wed, Feb 5, 2014 at 4:27 PM, David Miller da...@redhat.com wrote:
From: Alexei Starovoitov a...@plumgrid.com
Date: Wed, 5 Feb 2014 16:10:00 -0800
this patch set addresses main sticking points of the previous discussion:
http://thread.gmane.org/gmane.linux.kernel/1605783
You really
or staging tree and continue working there.
Future deltas will be easier to review.
Thanks
Alexei Starovoitov (7):
Extended BPF core framework
Extended BPF JIT for x86-64
Extended BPF (64-bit BPF) design document
Revert x86/ptrace: Remove unused regs_get_argument_nth API
use BPF in tracing
filter_check/ - userspace correctness checker of BPF filter
examples/ - BPF filter examples in C
will be compiled by LLVM into .bpf
$cd examples
$make - compile .c into .bpf
$make check - check correctness of *.bpf
$make try - to apply netif_rcv.bpf as a tracing filter
Signed-off-by: Alexei
This reverts commit aa5add93e92019018e905146f8c3d3f8e3c08300.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/include/asm/ptrace.h |3 +++
arch/x86/kernel/ptrace.c | 24
2 files changed, 27 insertions(+)
diff --git a/arch/x86/include/asm
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/bpf_jit.txt | 204 +
1 file changed, 204 insertions(+)
create mode 100644 Documentation/bpf_jit.txt
diff --git a/Documentation/bpf_jit.txt b/Documentation/bpf_jit.txt
new file mode
prototype is 'int dst_discard(struct sk_buff *skb);'
bpf_load_pointer() will try to fetch 'dev' field of 'sk_buff'
structure and will suppress page-fault if pointer is incorrect.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/ftrace_event.h |5 +
include/trace
for efficient mapping to native
instructions on 64-bit CPUs
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/bpf.h| 149 +++
include/linux/bpf_jit.h| 134 ++
kernel/Makefile|1 +
kernel/bpf_jit/Makefile|3 +
kernel/bpf_jit/bpf_check.c | 1054
.
Allowing zero-overhead calls between BPF filter and safe kernel functions
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/Kconfig |1 +
arch/x86/net/Makefile |1 +
arch/x86/net/bpf64_jit_comp.c | 625 +
arch
On Thu, Feb 6, 2014 at 2:42 AM, Daniel Borkmann dbork...@redhat.com wrote:
Hi Alexei,
On 02/06/2014 02:10 AM, Alexei Starovoitov wrote:
Hi All,
this patch set addresses main sticking points of the previous discussion:
http://thread.gmane.org/gmane.linux.kernel/1605783
Main difference
On Fri, Jul 25, 2014 at 3:17 PM, Pablo Neira Ayuso pa...@netfilter.org wrote:
On Fri, Jul 25, 2014 at 10:24:29AM -0700, Alexei Starovoitov wrote:
On Fri, Jul 25, 2014 at 6:00 AM, Daniel Borkmann dbork...@redhat.com wrote:
On 07/25/2014 01:54 PM, Pablo Neira Ayuso wrote:
On Fri, Jul 25
On Mon, Jul 28, 2014 at 09:45:45AM -0700, Linus Torvalds wrote:
On Mon, Jul 28, 2014 at 5:26 AM, Frank Ch. Eigler f...@redhat.com wrote:
Please note that the data produced by -g -fvar-tracking is consumed
by tools like systemtap, perf, crash, and makes a significant
difference to the
On Mon, Jul 28, 2014 at 2:45 PM, Pablo Neira Ayuso pa...@netfilter.org wrote:
struct sk_filter_cb {
int type;
struct module *me;
void (*charge)(struct sock *sk, struct sk_filter *fp);
void (*uncharge)(struct sock *sk, struct sk_filter *fp);
charging logic was complicated, since we had to charge/uncharge a socket
multiple times while preparing a filter. Simplify it by fully preparing bpf
program (through classic-ebpf conversion and JITing) and then charge
the socket memory once.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
v2
On Tue, Jul 29, 2014 at 8:31 AM, Pablo Neira Ayuso pa...@netfilter.org wrote:
On Mon, Jul 28, 2014 at 11:29:40PM -0700, Alexei Starovoitov wrote:
Socket charging logic was complicated, since we had to charge/uncharge a
socket
multiple times while preparing a filter. Simplify it by fully
On Tue, Jul 29, 2014 at 9:42 AM, Pablo Neira Ayuso pa...@netfilter.org wrote:
On Tue, Jul 29, 2014 at 08:55:04AM -0700, Alexei Starovoitov wrote:
I don't think this is the right moment to add this, but we have to
keep in mind that something similar to this will need to be
accomodated
On Wed, Jul 30, 2014 at 8:45 AM, Frank Ch. Eigler f...@redhat.com wrote:
For the record, this is not entirely accurate as to dtrace. dtrace
delegates aggregation and most reporting to userspace. Also,
systemtap is short and deterministic even for aggregations nice
graphs, but since it
On Tue, Jul 15, 2014 at 12:32 PM, Andy Lutomirski l...@amacapital.net wrote:
For slowpath syscalls, we initialize regs-ax to -ENOSYS and stick
the syscall number into regs-orig_ax prior to any possible tracing
and syscall execution. This is user-visible ABI used by ptrace
syscall emulation
On Thu, Jul 17, 2014 at 2:19 AM, Will Deacon will.dea...@arm.com wrote:
On Wed, Jul 16, 2014 at 10:19:31PM +0100, Zi Shen Lim wrote:
Is a BUG_ON justifiable here? Is there not a nicer way to fail?
In general, it'd be nice if we returned something like -EINVAL and
have all callers handle
follow on patch exposes eBPF to user space and 'sock_filter_int' name
no longer makes sense, so rename it to 'bpf_insn'
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/net/bpf_jit_comp.c |2 +-
include/linux/filter.h | 50
-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/ftrace_event.h |5 +
include/trace/bpf_trace.h | 29 +
include/trace/ftrace.h | 10 ++
include/uapi/linux/bpf.h |5 +
kernel/trace/Kconfig |1 +
kernel/trace/Makefile
(map_id, fp - 4);
if (value)
(*(u64*)value) += 1;
- attaches this program to eth0 raw socket
- every second user space reads map[6] and map[17] to see how many
TCP and UDP packets were seen on eth0
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/.gitignore
different attributes as well.
The concept of type-lenght-value is borrowed from netlink, but netlink itself
is not applicable here, since BPF programs and maps can be used in NET-less
configurations.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/networking/filter.txt | 69
simple packet drop monitor:
- in-kernel eBPF program attaches to kfree_skb() event and records number
of packet drops at given location
- userspace iterates over the map every second and prints stats
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/Makefile |4
expose bpf_map_lookup_elem(), bpf_map_update_elem(), bpf_map_delete_elem()
map accessors to eBPF programs
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/bpf.h |5 +++
include/uapi/linux/bpf.h |3 ++
kernel/bpf/syscall.c | 85
(int fd, void *key, void *next_key);
int bpf_prog_load(enum bpf_prog_type prog_type,
const struct sock_filter_int *insns, int insn_len,
const char *license,
const struct bpf_map_fixup *fixups, int fixup_len);
Signed-off-by: Alexei Starovoitov
-by: Alexei Starovoitov a...@plumgrid.com
---
arch/alpha/include/uapi/asm/socket.h |2 +
arch/avr32/include/uapi/asm/socket.h |2 +
arch/cris/include/uapi/asm/socket.h|2 +
arch/frv/include/uapi/asm/socket.h |2 +
arch/ia64/include/uapi/asm/socket.h|2 +
arch/m32r
(__NR_bpf, BPF_PROG_LOAD, prog_type, ...)
follows in later patches
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/bpf.h | 33 +
include/linux/filter.h |9 +-
include/uapi/linux/bpf.h | 29 +
kernel/bpf/core.c|5 +-
kernel/bpf/syscall.c
done as separate commit to ease conflict resolution
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/syscalls/syscall_64.tbl |1 +
include/linux/syscalls.h |2 ++
include/uapi/asm-generic/unistd.h |4 +++-
kernel/sys_ni.c |3 +++
4
add new map type: BPF_MAP_TYPE_HASH
and its simple (not auto resizeable) hash table implementation
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/uapi/linux/bpf.h |1 +
kernel/bpf/Makefile |2 +-
kernel/bpf/hashtab.c | 371
)
returns zero or negative error
- find and delete element by key in a given map
err = bpf_map_delete_elem(int fd, void *key)
- iterate map elements (based on input key return next_key)
err = bpf_map_get_next_key(int fd, void *key, void *next_key)
- close(fd) deletes the map
Signed-off-by: Alexei
cannot go into uapi/linux/filter.h, since the names
may conflict with existing applications.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/filter.h| 294 +--
include/uapi/linux/Kbuild |1 +
include/uapi/linux/bpf.h | 303
)
Alexei Starovoitov (16):
net: filter: split filter.c into two files
bpf: update MAINTAINERS entry
net: filter: rename struct sock_filter_int into bpf_insn
net: filter: split filter.h and expose eBPF to user space
bpf: introduce
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
MAINTAINERS |7 +++
1 file changed, 7 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index ae8cd00215b2..32e24ff46da3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1912,6 +1912,13 @@ S: Supported
F: drivers/net
. The new
+ * internal format has been designed by PLUMgrid:
+ *
+ * Copyright (c) 2011 - 2014 PLUMgrid, http://plumgrid.com
+ *
+ * Authors:
+ *
+ * Jay Schulist jsch...@samba.org
+ * Alexei Starovoitov a...@plumgrid.com
+ * Daniel Borkmann dbork...@redhat.com
+ *
+ * This program
from Namhyung, Chema, Joe
- added more comments to verifier
- renamed sock_filter_int - bpf_insn
- rebased on net-next
As always all patches are available at:
git://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf master
--
Alexei Starovoitov (29):
bpf: x86: add missing 'shift by register
cannot go into uapi/linux/filter.h, since the names
may conflict with existing applications.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/filter.h| 312 +--
include/uapi/linux/Kbuild |1 +
include/uapi/linux/bpf.h | 321
strict state leads to valid bpf_exit.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
kernel/bpf/verifier.c | 134 +
1 file changed, 134 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 14a0262b101c..49374066a5bd
simple packet drop monitor:
- in-kernel eBPF program attaches to kfree_skb() event and records number
of packet drops at given location
- userspace iterates over the map every second and prints stats
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/Makefile | 12
alignment OK
#41 sometimes access memory with incorrect alignment OK
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/Makefile|3 +-
samples/bpf/test_verifier.c | 599 +++
2 files changed, 601 insertions(+), 1 deletion
check that control flow graph of eBPF program is a directed acyclic graph
check_cfg() does:
- detect loops
- detect unreachable instructions
- check that program terminates with BPF_EXIT insn
- check that all branches are within program boundary
Signed-off-by: Alexei Starovoitov
supplied buffer which can be used by humans to analyze why verifier
rejected given program
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/uapi/linux/bpf.h |4 +
kernel/bpf/syscall.c |3 +
kernel/bpf/verifier.c| 236 ++
3
latencies, syscalls, etc
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/Makefile |6 +-
samples/bpf/ex3_kern.c | 104 +
samples/bpf/ex3_user.c | 149
3 files changed, 257 insertions(+), 2
| |
Ctrl-C at any time. Kernel will auto cleanup maps and programs
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/Makefile |6 ++--
samples/bpf/ex2_kern.c | 73 +
samples/bpf/ex2_user.c | 94
);
bpf_helpers.h is a set of in-kernel helper functions available to eBPF programs
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/bpf_helpers.h | 27 ++
samples/bpf/bpf_load.c| 234 +
samples/bpf/bpf_load.h| 26 +
3
(int fd, void *key, void *next_key);
int bpf_prog_load(enum bpf_prog_type prog_type,
const struct sock_filter_int *insns, int insn_len,
const char *license);
bpf_prog_load() stores verifier log into global bpf_log_buf[] array
Signed-off-by: Alexei Starovoitov
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
kernel/trace/trace_kprobe.c | 28
1 file changed, 28 insertions(+)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 282f6e4e5539..b6db92207c99 100644
--- a/kernel/trace
] ..s3 5640.716272: __netif_receive_skb_core: skb 5d06300 dev
b9e6000
Ctrl-C at any time, kernel will auto cleanup
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
samples/bpf/Makefile | 15 +--
samples/bpf/ex1_kern.c | 27 +++
samples/bpf
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/uapi/linux/bpf.h |2 ++
kernel/trace/bpf_trace.c | 20
2 files changed, 22 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 5adaad826471..e866a2fcba8b 100644
probe_kernel_read(),
so that eBPF program can walk any kernel data structures
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
fs/btrfs/super.c |3 +
include/linux/ftrace_event.h |5 +
include/trace/bpf_trace.h | 23 +
include/trace/ftrace.h
limited printk() with %d %u %x %p modifiers only
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/uapi/linux/bpf.h |1 +
kernel/trace/bpf_trace.c | 61 ++
2 files changed, 62 insertions(+)
diff --git a/include/uapi/linux/bpf.h b
let eBPF have its own CONFIG_BPF, so that tracing and other subsystems don't
need to depend on all of NET
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/Kconfig |4
kernel/Makefile |2 +-
kernel/bpf/core.c | 12
net/Kconfig |1 +
4 files
expose bpf_map_lookup_elem(), bpf_map_update_elem(), bpf_map_delete_elem()
map accessors to eBPF programs
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/bpf.h |5
include/uapi/linux/bpf.h |3 ++
kernel/bpf/syscall.c | 68
/filter.txt and in kernel/bpf/verifier.c
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/bpf.h | 47 ++
include/uapi/linux/bpf.h |1 +
kernel/bpf/verifier.c| 1061 +-
3 files changed, 1108 insertions(+), 1 deletion
with in-kernel function pointer.
eBPF interpreter just calls the function.
In-kernel eBPF users continue to use generic BPF_CALL.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
kernel/bpf/syscall.c | 37 +
1 file changed, 37 insertions(+)
diff
() calls.
If program passes verifier, convert pseudo BPF_LD_IMM64 into generic by dropping
BPF_PSEUDO_MAP_FD flag.
Note that eBPF interpreter is generic and knows nothing about pseudo insns.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/uapi/linux/bpf.h |6 ++
kernel/bpf
stack access
- misaligned stack access
- out of range stack access
- invalid calling convention
More details in Documentation/networking/filter.txt
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/networking/filter.txt | 230 +++
include/linux
done as separate commit to ease conflict resolution
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/syscalls/syscall_32.tbl |1 +
arch/x86/syscalls/syscall_64.tbl |1 +
include/linux/syscalls.h |3 ++-
include/uapi/asm-generic/unistd.h |4 +++-
kernel
-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/networking/filter.txt | 71
include/linux/bpf.h | 42 ++
include/uapi/linux/bpf.h| 24 ++
kernel/bpf/Makefile |2 +-
kernel/bpf/syscall.c| 156
add new map type: BPF_MAP_TYPE_HASH
and its simple (not auto resizeable) hash table implementation
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/uapi/linux/bpf.h |1 +
kernel/bpf/Makefile |2 +-
kernel/bpf/hashtab.c | 372
of eBPF instructions
LICENSE - must be GPL compatible to call helper functions marked gpl_only
- unload eBPF program
close(fd)
User space example of syscall(__NR_bpf, BPF_PROG_LOAD, prog_type, ...)
follows in later patches
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux
)
returns zero or negative error
- find and delete element by key in a given map
err = bpf_map_delete_elem(int fd, void *key)
- iterate map elements (based on input key return next_key)
err = bpf_map_get_next_key(int fd, void *key, void *next_key)
- close(fd) deletes the map
Signed-off-by: Alexei
to check validity of the programs.
Later LLVM compiler is using this insn as generic load of 64-bit immediate
constant and as a load of map pointer with relocation.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/networking/filter.txt |8 +++-
arch/x86/net
'shift by register' operations are supported by eBPF interpreter, but were
accidently left out of x64 JIT compiler. Fix it and add a testcase.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/net/bpf_jit_comp.c | 42 ++
lib/test_bpf.c
On Mon, Aug 25, 2014 at 2:33 PM, Cong Wang cw...@twopensource.com wrote:
On Sun, Aug 24, 2014 at 1:21 PM, Alexei Starovoitov a...@plumgrid.com wrote:
'maps' is a generic storage of different types for sharing data between
kernel
and userspace.
The maps are accessed from user space via BPF
readability
- rebased
V5 thread:
https://lkml.org/lkml/2014/8/24/107
All patches:
git://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf master
Alexei Starovoitov (6):
net: filter: add load 64-bit immediate eBPF instruction
net: filter: split filter.h and expose eBPF to user space
bpf: introduce
to check validity of the programs.
Later LLVM compiler is using this insn as generic load of 64-bit immediate
constant and as a load of map pointer with relocation.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/networking/filter.txt |8 +++-
arch/x86/net
)
returns zero or negative error
- find and delete element by key in a given map
err = bpf_map_delete_elem(int fd, void *key)
- iterate map elements (based on input key return next_key)
err = bpf_map_get_next_key(int fd, void *key, void *next_key)
- close(fd) deletes the map
Signed-off-by: Alexei
multiple times from
eBPF program which itself is triggered by high volume of events
- in the future JIT compiler may recognize lookup() call and optimize it
further, since key_size is constant for life of eBPF program
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
Note, lib/rhashtable.c
-by: Alexei Starovoitov a...@plumgrid.com
---
Documentation/networking/filter.txt | 71
include/linux/bpf.h | 42 ++
include/uapi/linux/bpf.h| 24 ++
kernel/bpf/Makefile |2 +-
kernel/bpf/syscall.c| 156
done as separate commit to ease conflict resolution
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
arch/x86/syscalls/syscall_32.tbl |1 +
arch/x86/syscalls/syscall_64.tbl |1 +
include/linux/syscalls.h |3 ++-
include/uapi/asm-generic/unistd.h |4 +++-
kernel
cannot go into uapi/linux/filter.h, since the names
may conflict with existing applications.
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/filter.h| 312 +--
include/uapi/linux/Kbuild |1 +
include/uapi/linux/bpf.h | 321
On Mon, Aug 25, 2014 at 6:06 PM, David Miller da...@davemloft.net wrote:
From: Alexei Starovoitov a...@plumgrid.com
Date: Mon, 25 Aug 2014 18:00:53 -0700
add BPF_LD_IMM64 instruction to load 64-bit immediate value into a register.
I think you need to rethink this.
I understand that you
On Mon, Aug 25, 2014 at 6:07 PM, David Miller da...@davemloft.net wrote:
From: Alexei Starovoitov a...@plumgrid.com
Date: Mon, 25 Aug 2014 18:00:56 -0700
-
+asmlinkage long sys_bpf(int cmd, unsigned long arg2, unsigned long arg3,
+ unsigned long arg4, unsigned long arg5
On Mon, Aug 25, 2014 at 6:38 PM, Andy Lutomirski l...@amacapital.net wrote:
On Mon, Aug 25, 2014 at 6:35 PM, Alexei Starovoitov a...@plumgrid.com wrote:
On Mon, Aug 25, 2014 at 6:06 PM, David Miller da...@davemloft.net wrote:
From: Alexei Starovoitov a...@plumgrid.com
Date: Mon, 25 Aug 2014 18
On Mon, Aug 25, 2014 at 6:54 PM, Andy Lutomirski l...@amacapital.net wrote:
On Mon, Aug 25, 2014 at 6:53 PM, Alexei Starovoitov a...@plumgrid.com wrote:
On Mon, Aug 25, 2014 at 6:38 PM, Andy Lutomirski l...@amacapital.net wrote:
On Mon, Aug 25, 2014 at 6:35 PM, Alexei Starovoitov
On Mon, Aug 25, 2014 at 6:06 PM, David Miller da...@davemloft.net wrote:
Instead I would rather you look into a model like what the quake
engine uses for it's VM.
Thanks for the tip! I wasn't aware of quake vm.
I've looked through several papers and slides.
I'm surely missing something in what
On Mon, Aug 25, 2014 at 8:52 PM, Stephen Hemminger
step...@networkplumber.org wrote:
Per discussion at Kernel Summit. Every new syscall requires
a manual page and test programs. We have had too many new syscalls
that are DOA.
There is verifier testsuite that is testing eBPF verifier from
On Tue, Aug 26, 2014 at 12:45 AM, Ingo Molnar mi...@kernel.org wrote:
* Alexei Starovoitov a...@plumgrid.com wrote:
On Mon, Aug 25, 2014 at 6:07 PM, David Miller da...@davemloft.net wrote:
From: Alexei Starovoitov a...@plumgrid.com
Date: Mon, 25 Aug 2014 18:00:56 -0700
-
+asmlinkage
On Tue, Aug 26, 2014 at 1:02 AM, Ingo Molnar mi...@kernel.org wrote:
That said, I think Alexei is referring to the examples et al
from the bigger previous proposed patch set.
I mean, if all the testing already exists, it should be part of
an initial submission and such.
That's what I did.
On Tue, Aug 26, 2014 at 6:32 PM, Andy Lutomirski l...@amacapital.net wrote:
On Mon, Jul 28, 2014 at 8:38 PM, Andy Lutomirski l...@amacapital.net wrote:
This applies to:
git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git seccomp-fastpath
Gitweb:
on input key return next_key)
err = bpf(BPF_MAP_GET_NEXT_KEY, union bpf_attr *attr, u32 size)
using attr-map_fd, attr-key, attr-next_key
- close(fd) deletes the map
Signed-off-by: Alexei Starovoitov a...@plumgrid.com
---
include/linux/bpf.h |8 ++
include/uapi/linux/bpf.h | 42
201 - 300 of 4142 matches
Mail list logo