Thread (4 messages) flat view 4 messages, 4 authors, 2018-01-09

Re: [PATCH bpf-next] bpf: introduce BPF_JIT_ALWAYS_ON config

From: Alexei Starovoitov <hidden>
Date: 2018-01-09 02:24:19

On 1/8/18 4:02 PM, Jakub Kicinski wrote:
On Mon, 8 Jan 2018 22:59:04 +0100, Daniel Borkmann wrote:
quoted
quoted
@@ -1453,6 +1457,11 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
 	 */
 	*err = bpf_check_tail_call(fp);

+#ifdef CONFIG_BPF_JIT_ALWAYS_ON
+	if (!fp->jited)
+		*err = -ENOTSUPP;
+#endif
I think programs JITed for offload won't have fp->jited set, but
those are pretty safe from CPU bugs.  Should we set fp->jited = 1; in
bpf_prog_offload_compile()?  Just throwing "&& !bpf_prog_is_dev_bound()"
in here seems cleaner to me.
good catch. will fix in the v2.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help