diff mbox series

[bpf-next] bpf: support bpf_jit_enable=2 for CONFIG_BPF_JIT_ALWAYS_ON

Message ID 20211231153550.3807430-1-houtao1@huawei.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series [bpf-next] bpf: support bpf_jit_enable=2 for CONFIG_BPF_JIT_ALWAYS_ON | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers warning 5 maintainers not CCed: kpsingh@kernel.org john.fastabend@gmail.com songliubraving@fb.com dvyukov@google.com masahiroy@kernel.org
netdev/build_clang success Errors and warnings before: 20 this patch: 20
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next success VM_Test
bpf/vmtest-bpf-next-PR success PR summary

Commit Message

Hou Tao Dec. 31, 2021, 3:35 p.m. UTC
bpf_jit_enable=2 is used to dump the jited images for debug purpose,
however if CONFIG_BPF_JIT_ALWAYS_ON is enabled, its value is fixed
as one and can not be changed. So make the debug switch work again.

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 net/core/sysctl_net_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexei Starovoitov Dec. 31, 2021, 4:32 p.m. UTC | #1
On Fri, Dec 31, 2021 at 7:20 AM Hou Tao <houtao1@huawei.com> wrote:
>
> bpf_jit_enable=2 is used to dump the jited images for debug purpose,
> however if CONFIG_BPF_JIT_ALWAYS_ON is enabled, its value is fixed
> as one and can not be changed. So make the debug switch work again.
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>

That was discussed in the past:
https://lore.kernel.org/bpf/20210326124030.1138964-1-Jianlin.Lv@arm.com/
The old point stands.
diff mbox series

Patch

diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 7b4d485aac7a..20e44427afa8 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -387,7 +387,7 @@  static struct ctl_table net_core_table[] = {
 		.proc_handler	= proc_dointvec_minmax_bpf_enable,
 # ifdef CONFIG_BPF_JIT_ALWAYS_ON
 		.extra1		= SYSCTL_ONE,
-		.extra2		= SYSCTL_ONE,
+		.extra2		= &two,
 # else
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= &two,