summaryrefslogtreecommitdiff
path: root/kernel/bpf/core.c
diff options
context:
space:
mode:
authorAnay Wadhera <awadhera@berkeley.edu>2021-05-20 21:55:49 -0700
committerMichael Bestas <mkbestas@lineageos.org>2022-04-19 00:49:43 +0300
commit23e6e6ae2fe1086a796e42ba907c17181daac9d0 (patch)
treefcdf98b5f292d4937833948022c5662a4402df39 /kernel/bpf/core.c
parent58c5030c405c4c26ef80c7f263555468f3c20885 (diff)
Revert "bpf: introduce BPF_JIT_ALWAYS_ON config"
This reverts commit 28c486744e6de4d882a1d853aa63d99fcba4b7a6. Change-Id: I0e65abce457093a6c05d971b750228d99d5de131
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r--kernel/bpf/core.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index c40e25e63bb0..e54ea31c5103 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -256,7 +256,6 @@ noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
}
EXPORT_SYMBOL_GPL(__bpf_call_base);
-#ifndef CONFIG_BPF_JIT_ALWAYS_ON
/**
* __bpf_prog_run - run eBPF program on a given context
* @ctx: is the data we are operating on
@@ -726,13 +725,6 @@ load_byte:
return 0;
}
-#else
-static unsigned int __bpf_prog_ret0(void *ctx, const struct bpf_insn *insn)
-{
- return 0;
-}
-#endif
-
bool bpf_prog_array_compatible(struct bpf_array *array,
const struct bpf_prog *fp)
{
@@ -779,23 +771,9 @@ static int bpf_check_tail_call(const struct bpf_prog *fp)
*/
int bpf_prog_select_runtime(struct bpf_prog *fp)
{
-#ifndef CONFIG_BPF_JIT_ALWAYS_ON
fp->bpf_func = (void *) __bpf_prog_run;
-#else
- fp->bpf_func = (void *) __bpf_prog_ret0;
-#endif
-
- /* eBPF JITs can rewrite the program in case constant
- * blinding is active. However, in case of error during
- * blinding, bpf_int_jit_compile() must always return a
- * valid program, which in this case would simply not
- * be JITed, but falls back to the interpreter.
- */
+
bpf_int_jit_compile(fp);
-#ifdef CONFIG_BPF_JIT_ALWAYS_ON
- if (!fp->jited)
- return -ENOTSUPP;
-#endif
bpf_prog_lock_ro(fp);
/* The tail call compatibility check can only be done at