Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v2] bpf: fix warning for crash_kexec
@ 2024-03-19  8:01 Hari Bathini
  2024-03-19 22:56 ` Andrii Nakryiko
  0 siblings, 1 reply; 4+ messages in thread
From: Hari Bathini @ 2024-03-19  8:01 UTC (permalink / raw)
  To: bpf
  Cc: Daniel Borkmann, Andrii Nakryiko, Yonghong Song,
	Alexei Starovoitov, Kexec-ml, Baoquan He, Andrew Morton,
	Jiri Olsa, Stanislav Fomichev

With [1], crash dump specific code is moved out of CONFIG_KEXEC_CORE
and placed under CONFIG_CRASH_DUMP, where it is more appropriate.
And since CONFIG_KEXEC & !CONFIG_CRASH_DUMP build option is supported
with that, it 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/20240124051254.67105-1-bhe@redhat.com/

Acked-by: Baoquan He <bhe@redhat.com>
Fixes: 29fd9ae62910 ("crash: split crash dumping code out from kexec_core.c")
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---

Changes in v2:
* Updated changelog.
* Added Fixes and Acked-by tags.


 kernel/bpf/helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index a89587859571..449b9a5d3fe3 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -2548,7 +2548,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)
-- 
2.44.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next v2] bpf: fix warning for crash_kexec
  2024-03-19  8:01 [PATCH bpf-next v2] bpf: fix warning for crash_kexec Hari Bathini
@ 2024-03-19 22:56 ` Andrii Nakryiko
  2024-03-21 23:30   ` Yonghong Song
  2024-03-22  5:55   ` Hari Bathini
  0 siblings, 2 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2024-03-19 22:56 UTC (permalink / raw)
  To: Hari Bathini
  Cc: bpf, Daniel Borkmann, Andrii Nakryiko, Yonghong Song,
	Alexei Starovoitov, Kexec-ml, Baoquan He, Andrew Morton,
	Jiri Olsa, Stanislav Fomichev

On Tue, Mar 19, 2024 at 1:02 AM Hari Bathini <hbathini@linux.ibm.com> wrote:
>
> With [1], crash dump specific code is moved out of CONFIG_KEXEC_CORE
> and placed under CONFIG_CRASH_DUMP, where it is more appropriate.
> And since CONFIG_KEXEC & !CONFIG_CRASH_DUMP build option is supported
> with that, it 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/20240124051254.67105-1-bhe@redhat.com/
>
> Acked-by: Baoquan He <bhe@redhat.com>
> Fixes: 29fd9ae62910 ("crash: split crash dumping code out from kexec_core.c")

I don't think either bpf or bpf-next have this commit just yet, so
landing it in the bpf/bpf-next tree doesn't make much sense. It
probably would be best to land it through the tree which does the
CONFIG_KEXEC_CORE -> CONFIG_CRASH_DUMP change in kernel/Makefile.

pw-bot: cr

> Acked-by: Jiri Olsa <jolsa@kernel.org>
> Acked-by: Stanislav Fomichev <sdf@google.com>
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> ---
>
> Changes in v2:
> * Updated changelog.
> * Added Fixes and Acked-by tags.
>
>
>  kernel/bpf/helpers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index a89587859571..449b9a5d3fe3 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -2548,7 +2548,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)
> --
> 2.44.0
>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next v2] bpf: fix warning for crash_kexec
  2024-03-19 22:56 ` Andrii Nakryiko
@ 2024-03-21 23:30   ` Yonghong Song
  2024-03-22  5:55   ` Hari Bathini
  1 sibling, 0 replies; 4+ messages in thread
From: Yonghong Song @ 2024-03-21 23:30 UTC (permalink / raw)
  To: Andrii Nakryiko, Hari Bathini
  Cc: bpf, Daniel Borkmann, Andrii Nakryiko, Alexei Starovoitov,
	Kexec-ml, Baoquan He, Andrew Morton, Jiri Olsa,
	Stanislav Fomichev


On 3/19/24 3:56 PM, Andrii Nakryiko wrote:
> On Tue, Mar 19, 2024 at 1:02 AM Hari Bathini <hbathini@linux.ibm.com> wrote:
>> With [1], crash dump specific code is moved out of CONFIG_KEXEC_CORE
>> and placed under CONFIG_CRASH_DUMP, where it is more appropriate.
>> And since CONFIG_KEXEC & !CONFIG_CRASH_DUMP build option is supported
>> with that, it 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/20240124051254.67105-1-bhe@redhat.com/
>>
>> Acked-by: Baoquan He <bhe@redhat.com>
>> Fixes: 29fd9ae62910 ("crash: split crash dumping code out from kexec_core.c")
> I don't think either bpf or bpf-next have this commit just yet, so
> landing it in the bpf/bpf-next tree doesn't make much sense. It
> probably would be best to land it through the tree which does the
> CONFIG_KEXEC_CORE -> CONFIG_CRASH_DUMP change in kernel/Makefile.

With bpf-next, I found the config at kernel/Kconfig.kexec:

config CRASH_DUMP
         bool "kernel crash dumps"
         depends on ARCH_SUPPORTS_CRASH_DUMP
         select CRASH_CORE
         select KEXEC_CORE
         help

...

> pw-bot: cr
>
>> Acked-by: Jiri Olsa <jolsa@kernel.org>
>> Acked-by: Stanislav Fomichev <sdf@google.com>
>> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
>> ---
>>
>> Changes in v2:
>> * Updated changelog.
>> * Added Fixes and Acked-by tags.
>>
>>
>>   kernel/bpf/helpers.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
>> index a89587859571..449b9a5d3fe3 100644
>> --- a/kernel/bpf/helpers.c
>> +++ b/kernel/bpf/helpers.c
>> @@ -2548,7 +2548,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)
>> --
>> 2.44.0
>>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next v2] bpf: fix warning for crash_kexec
  2024-03-19 22:56 ` Andrii Nakryiko
  2024-03-21 23:30   ` Yonghong Song
@ 2024-03-22  5:55   ` Hari Bathini
  1 sibling, 0 replies; 4+ messages in thread
From: Hari Bathini @ 2024-03-22  5:55 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: bpf, Daniel Borkmann, Andrii Nakryiko, Yonghong Song,
	Alexei Starovoitov, Kexec-ml, Baoquan He, Andrew Morton,
	Jiri Olsa, Stanislav Fomichev



On 20/03/24 4:26 am, Andrii Nakryiko wrote:
> On Tue, Mar 19, 2024 at 1:02 AM Hari Bathini <hbathini@linux.ibm.com> wrote:
>>
>> With [1], crash dump specific code is moved out of CONFIG_KEXEC_CORE
>> and placed under CONFIG_CRASH_DUMP, where it is more appropriate.
>> And since CONFIG_KEXEC & !CONFIG_CRASH_DUMP build option is supported
>> with that, it 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/20240124051254.67105-1-bhe@redhat.com/
>>
>> Acked-by: Baoquan He <bhe@redhat.com>
>> Fixes: 29fd9ae62910 ("crash: split crash dumping code out from kexec_core.c")
> 
> I don't think either bpf or bpf-next have this commit just yet, so
> landing it in the bpf/bpf-next tree doesn't make much sense. It
> probably would be best to land it through the tree which does the
> CONFIG_KEXEC_CORE -> CONFIG_CRASH_DUMP change in kernel/Makefile.

Yeah, [1] patches were still not in bpf-next when I sent this v2.
Andrew, can you please consider pulling this via -mm tree if that
sounds more appropriate?

Thanks
Hari


> pw-bot: cr
> 
>> Acked-by: Jiri Olsa <jolsa@kernel.org>
>> Acked-by: Stanislav Fomichev <sdf@google.com>
>> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
>> ---
>>
>> Changes in v2:
>> * Updated changelog.
>> * Added Fixes and Acked-by tags.
>>
>>
>>   kernel/bpf/helpers.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
>> index a89587859571..449b9a5d3fe3 100644
>> --- a/kernel/bpf/helpers.c
>> +++ b/kernel/bpf/helpers.c
>> @@ -2548,7 +2548,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)
>> --
>> 2.44.0
>>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-22  5:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-19  8:01 [PATCH bpf-next v2] bpf: fix warning for crash_kexec Hari Bathini
2024-03-19 22:56 ` Andrii Nakryiko
2024-03-21 23:30   ` Yonghong Song
2024-03-22  5:55   ` Hari Bathini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox