|
@@ -767,6 +767,7 @@ noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(__bpf_call_base);
|
|
EXPORT_SYMBOL_GPL(__bpf_call_base);
|
|
|
|
|
|
|
|
+#ifndef CONFIG_BPF_JIT_ALWAYS_ON
|
|
/**
|
|
/**
|
|
* __bpf_prog_run - run eBPF program on a given context
|
|
* __bpf_prog_run - run eBPF program on a given context
|
|
* @ctx: is the data we are operating on
|
|
* @ctx: is the data we are operating on
|
|
@@ -1317,6 +1318,14 @@ EVAL6(PROG_NAME_LIST, 224, 256, 288, 320, 352, 384)
|
|
EVAL4(PROG_NAME_LIST, 416, 448, 480, 512)
|
|
EVAL4(PROG_NAME_LIST, 416, 448, 480, 512)
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+#else
|
|
|
|
+static unsigned int __bpf_prog_ret0(const void *ctx,
|
|
|
|
+ const struct bpf_insn *insn)
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
bool bpf_prog_array_compatible(struct bpf_array *array,
|
|
bool bpf_prog_array_compatible(struct bpf_array *array,
|
|
const struct bpf_prog *fp)
|
|
const struct bpf_prog *fp)
|
|
{
|
|
{
|
|
@@ -1364,9 +1373,13 @@ static int bpf_check_tail_call(const struct bpf_prog *fp)
|
|
*/
|
|
*/
|
|
struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
|
|
struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
|
|
{
|
|
{
|
|
|
|
+#ifndef CONFIG_BPF_JIT_ALWAYS_ON
|
|
u32 stack_depth = max_t(u32, fp->aux->stack_depth, 1);
|
|
u32 stack_depth = max_t(u32, fp->aux->stack_depth, 1);
|
|
|
|
|
|
fp->bpf_func = interpreters[(round_up(stack_depth, 32) / 32) - 1];
|
|
fp->bpf_func = interpreters[(round_up(stack_depth, 32) / 32) - 1];
|
|
|
|
+#else
|
|
|
|
+ fp->bpf_func = __bpf_prog_ret0;
|
|
|
|
+#endif
|
|
|
|
|
|
/* eBPF JITs can rewrite the program in case constant
|
|
/* eBPF JITs can rewrite the program in case constant
|
|
* blinding is active. However, in case of error during
|
|
* blinding is active. However, in case of error during
|
|
@@ -1376,6 +1389,12 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
|
|
*/
|
|
*/
|
|
if (!bpf_prog_is_dev_bound(fp->aux)) {
|
|
if (!bpf_prog_is_dev_bound(fp->aux)) {
|
|
fp = bpf_int_jit_compile(fp);
|
|
fp = bpf_int_jit_compile(fp);
|
|
|
|
+#ifdef CONFIG_BPF_JIT_ALWAYS_ON
|
|
|
|
+ if (!fp->jited) {
|
|
|
|
+ *err = -ENOTSUPP;
|
|
|
|
+ return fp;
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
} else {
|
|
} else {
|
|
*err = bpf_prog_offload_compile(fp);
|
|
*err = bpf_prog_offload_compile(fp);
|
|
if (*err)
|
|
if (*err)
|