bpf: fix warning for crash_kexec
Subsystems (3)
PATCH 1/1 bpf: fix warning for crash_kexec
With [1], CONFIG_KEXEC & !CONFIG_CRASH_DUMP is supported but that led to the below warning:
"WARN: resolve_btfids: unresolved symbol crash_kexec"
Fix it by using the appropriate #ifdef.
[1] https://lore.kernel.org/all/[email protected]/
--- kernel/bpf/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/helpers.c +1 -1
@@ -2545,7 +2545,7 @@ __bpf_kfunc void bpf_throw(u64 cookie)__bpf_kfunc_end_defs (); BTF_KFUNCS_START(generic_btf_ids) -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_CRASH_DUMP BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE)#endif BTF_ID_FLAGS (func, bpf_obj_new_impl,KF_ACQUIRE |KF_RET_NULL )
Signature · 1 line
2.43.0
Quoted 6 lines · Hari Bathini
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
Same question here: how did you find this particular kconfig option (CONFIG_CRASH_DUMP) to use? Looking at the code, crash_kexec is defined in kernel/kexec_core.c and it's gated by CONFIG_KEXEC_CORE. So the existing ifdef seems correct?
Quoted 4 lines · Stanislav Fomichev
Quoted 3 lines · Hari Bathini
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:
Quoted 8 lines
Quoted 3 lines
"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
Same question here: how did you find this particular kconfig option (
CONFIG_CRASH_DUMP) to use? Looking at the code,crash_kexecis defined inkernel/kexec_core.cand it's gated byCONFIG_KEXEC_CORE. So the existing ifdef seems correct?
This patch is based on the latest next tree, I have made some changes to split the crash code from kexec_core.c. If you check next/master branch, crash_kexec is not in kernel/keec_core.c any more.
Jiri Olsa
Acked-byQuoted 9 lines · Baoquan He
Quoted 8 lines · Stanislav Fomichev
Quoted 6 lines · Hari Bathini
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
Quoted 8 lines
Quoted 4 lines
Same question here: how did you find this particular kconfig option (
CONFIG_CRASH_DUMP) to use? Looking at the code,crash_kexecis defined inkernel/kexec_core.cand it's gated byCONFIG_KEXEC_CORE. So the existing ifdef seems correct?This patch is based on the latest next tree, I have made some changes to split the crash code from
kexec_core.c. If you check next/master branch,crash_kexecis not inkernel/keec_core.cany more.
makes sense, it should have fixes tag:
thanks,
jirka
Stanislav Fomichev
Acked-byQuoted 19 lines · Jiri Olsa
Quoted 9 lines · Baoquan He
Quoted 8 lines · Stanislav Fomichev
Quoted 6 lines · Hari Bathini
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
Quoted 8 lines
Quoted 4 lines
Same question here: how did you find this particular kconfig option (
CONFIG_CRASH_DUMP) to use? Looking at the code,crash_kexecis defined inkernel/kexec_core.cand it's gated byCONFIG_KEXEC_CORE. So the existing ifdef seems correct?This patch is based on the latest next tree, I have made some changes to split the crash code from
kexec_core.c. If you check next/master branch,crash_kexecis not inkernel/keec_core.cany more.
Quoted 5 lines
makes sense, it should have fixes tag:
Fixes 29fd9ae62910 ("crash: split crash dumping code out from kexec_core.c")Acked-by Jiri Olsa <[email protected]>
+1, would've been nice to have more details in the commit description :-)
Quoted 11 lines · Hari Bathini
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
[1] https://lore.kernel.org/all/[email protected]/
Signed-off-by Hari Bathini <[email protected]>---
Good catch, thanks for fixing it.
Quoted 19 lines
kernel/bpf/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/bpf/helpers.c +1
-1@@ -2545,7 +2545,7 @@ __bpf_kfunc void bpf_throw(u64 cookie)__bpf_kfunc_end_defs (); BTF_KFUNCS_START(generic_btf_ids) -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_CRASH_DUMP BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE)#endif BTF_ID_FLAGS (func, bpf_obj_new_impl,KF_ACQUIRE |KF_RET_NULL )Signature · 1 line
2.43.0
Just checking on whether this will go via bpf or mm tree?
Quoted 27 lines · Hari Bathini
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
[1] https://lore.kernel.org/all/[email protected]/
Signed-off-by Hari Bathini <[email protected]>--- kernel/bpf/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/bpf/helpers.c +1
-1@@ -2545,7 +2545,7 @@ __bpf_kfunc void bpf_throw(u64 cookie)__bpf_kfunc_end_defs (); BTF_KFUNCS_START(generic_btf_ids) -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_CRASH_DUMP BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE)#endif BTF_ID_FLAGS (func, bpf_obj_new_impl,KF_ACQUIRE |KF_RET_NULL )
Yonghong Song
reviewerQuoted 1 line · Hari Bathini
Just checking on whether this will go via bpf or mm tree?
Sending to bpf-next should be okay.
Could you resubmit the patch as CONFIG_CRASH_DUMP probably not available to bpf-next when you initially submitted the patch.
Quoted 29 lines · Hari Bathini
Quoted 26 lines
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
[1] https://lore.kernel.org/all/[email protected]/
Signed-off-by Hari Bathini <[email protected]>---
kernel/bpf/helpers.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)kernel/bpf/helpers.c +1
-1@@ -2545,7 +2545,7 @@ __bpf_kfunc void bpf_throw(u64 cookie) __bpf_kfunc_end_defs(); BTF_KFUNCS_START(generic_btf_ids) -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_CRASH_DUMP BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE) #endif BTF_ID_FLAGS(func, bpf_obj_new_impl, KF_ACQUIRE | KF_RET_NULL)
Quoted 7 lines · Yonghong Song
Quoted 1 line · Hari Bathini
Just checking on whether this will go via bpf or mm tree?
Sending to bpf-next should be okay.
Could you resubmit the patch asCONFIG_CRASH_DUMPprobably not available to bpf-next when you initially submitted the patch.
OK. Sent V2 with tags added and changelog updated:
https://lore.kernel.org/all/[email protected]/
Quoted 30 lines
Quoted 30 lines · Hari Bathini
Quoted 26 lines
With [1],
CONFIG_KEXEC& !CONFIG_CRASH_DUMP is supported but that led to the below warning:"WARN:
resolve_btfids: unresolved symbolcrash_kexec"Fix it by using the appropriate #ifdef.
[1] https://lore.kernel.org/all/[email protected]/
Signed-off-by Hari Bathini <[email protected]>---
kernel/bpf/helpers.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)kernel/bpf/helpers.c +1
-1@@ -2545,7 +2545,7 @@ __bpf_kfunc void bpf_throw(u64 cookie) __bpf_kfunc_end_defs(); BTF_KFUNCS_START(generic_btf_ids) -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_CRASH_DUMP BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE) #endif BTF_ID_FLAGS(func, bpf_obj_new_impl, KF_ACQUIRE | KF_RET_NULL)