BPF List
 help / color / mirror / Atom feed
* [PATCH linux-next] bpf: fix warning for crash_kexec
@ 2024-02-09 12:35 Hari Bathini
  2024-02-09 19:18 ` Stanislav Fomichev
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hari Bathini @ 2024-02-09 12:35 UTC (permalink / raw)
  To: bpf; +Cc: Kexec-ml, Baoquan He, Daniel Borkmann, Alexei Starovoitov

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/20240124051254.67105-1-bhe@redhat.com/

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
 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 4db1c658254c..e408d1115e26 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -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)
-- 
2.43.0


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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-02-09 12:35 [PATCH linux-next] bpf: fix warning for crash_kexec Hari Bathini
@ 2024-02-09 19:18 ` Stanislav Fomichev
  2024-02-10  4:51   ` Baoquan He
  2024-02-10  4:52 ` Baoquan He
  2024-03-18  6:52 ` Hari Bathini
  2 siblings, 1 reply; 9+ messages in thread
From: Stanislav Fomichev @ 2024-02-09 19:18 UTC (permalink / raw)
  To: Hari Bathini
  Cc: bpf, Kexec-ml, Baoquan He, Daniel Borkmann, Alexei Starovoitov

On 02/09, Hari Bathini wrote:
> 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.

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?

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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-02-09 19:18 ` Stanislav Fomichev
@ 2024-02-10  4:51   ` Baoquan He
  2024-02-12  8:44     ` Jiri Olsa
  0 siblings, 1 reply; 9+ messages in thread
From: Baoquan He @ 2024-02-10  4:51 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: Hari Bathini, bpf, Kexec-ml, Daniel Borkmann, Alexei Starovoitov

On 02/09/24 at 11:18am, Stanislav Fomichev wrote:
> On 02/09, Hari Bathini wrote:
> > 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.
> 
> 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?

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.


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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-02-09 12:35 [PATCH linux-next] bpf: fix warning for crash_kexec Hari Bathini
  2024-02-09 19:18 ` Stanislav Fomichev
@ 2024-02-10  4:52 ` Baoquan He
  2024-03-18  6:52 ` Hari Bathini
  2 siblings, 0 replies; 9+ messages in thread
From: Baoquan He @ 2024-02-10  4:52 UTC (permalink / raw)
  To: Hari Bathini; +Cc: bpf, Kexec-ml, akpm, Daniel Borkmann, Alexei Starovoitov

On 02/09/24 at 06:05pm, Hari Bathini wrote:
> 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/20240124051254.67105-1-bhe@redhat.com/
> 
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> ---

Good catch, thanks for fixing it.

Acked-by: Baoquan He <bhe@redhat.com>

>  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 4db1c658254c..e408d1115e26 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -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)
> -- 
> 2.43.0
> 


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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-02-10  4:51   ` Baoquan He
@ 2024-02-12  8:44     ` Jiri Olsa
  2024-02-12 16:48       ` Stanislav Fomichev
  0 siblings, 1 reply; 9+ messages in thread
From: Jiri Olsa @ 2024-02-12  8:44 UTC (permalink / raw)
  To: Baoquan He
  Cc: Stanislav Fomichev, Hari Bathini, bpf, Kexec-ml, Daniel Borkmann,
	Alexei Starovoitov

On Sat, Feb 10, 2024 at 12:51:21PM +0800, Baoquan He wrote:
> On 02/09/24 at 11:18am, Stanislav Fomichev wrote:
> > On 02/09, Hari Bathini wrote:
> > > 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.
> > 
> > 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?
> 
> 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.

makes sense, it should have fixes tag:

Fixes: 29fd9ae62910 ("crash: split crash dumping code out from kexec_core.c")

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-02-12  8:44     ` Jiri Olsa
@ 2024-02-12 16:48       ` Stanislav Fomichev
  0 siblings, 0 replies; 9+ messages in thread
From: Stanislav Fomichev @ 2024-02-12 16:48 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Baoquan He, Hari Bathini, bpf, Kexec-ml, Daniel Borkmann,
	Alexei Starovoitov

On 02/12, Jiri Olsa wrote:
> On Sat, Feb 10, 2024 at 12:51:21PM +0800, Baoquan He wrote:
> > On 02/09/24 at 11:18am, Stanislav Fomichev wrote:
> > > On 02/09, Hari Bathini wrote:
> > > > 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.
> > > 
> > > 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?
> > 
> > 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.
> 
> makes sense, it should have fixes tag:
> 
> Fixes: 29fd9ae62910 ("crash: split crash dumping code out from kexec_core.c")
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>

+1, would've been nice to have more details in the commit description :-)

Acked-by: Stanislav Fomichev <sdf@google.com>

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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-02-09 12:35 [PATCH linux-next] bpf: fix warning for crash_kexec Hari Bathini
  2024-02-09 19:18 ` Stanislav Fomichev
  2024-02-10  4:52 ` Baoquan He
@ 2024-03-18  6:52 ` Hari Bathini
  2024-03-18 16:13   ` Yonghong Song
  2 siblings, 1 reply; 9+ messages in thread
From: Hari Bathini @ 2024-03-18  6:52 UTC (permalink / raw)
  To: bpf
  Cc: Kexec-ml, Baoquan He, Daniel Borkmann, Alexei Starovoitov,
	Andrii Nakryiko, Andrew Morton

Just checking on whether this will go via bpf or mm tree?

On 09/02/24 6:05 pm, Hari Bathini wrote:
> 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/20240124051254.67105-1-bhe@redhat.com/
> 
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> ---
>   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 4db1c658254c..e408d1115e26 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -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)

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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-03-18  6:52 ` Hari Bathini
@ 2024-03-18 16:13   ` Yonghong Song
  2024-03-19  8:06     ` Hari Bathini
  0 siblings, 1 reply; 9+ messages in thread
From: Yonghong Song @ 2024-03-18 16:13 UTC (permalink / raw)
  To: Hari Bathini, bpf
  Cc: Kexec-ml, Baoquan He, Daniel Borkmann, Alexei Starovoitov,
	Andrii Nakryiko, Andrew Morton


On 3/17/24 11:52 PM, Hari Bathini wrote:
> 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.

>
> On 09/02/24 6:05 pm, Hari Bathini wrote:
>> 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/20240124051254.67105-1-bhe@redhat.com/
>>
>> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
>> ---
>>   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 4db1c658254c..e408d1115e26 100644
>> --- a/kernel/bpf/helpers.c
>> +++ b/kernel/bpf/helpers.c
>> @@ -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)
>

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

* Re: [PATCH linux-next] bpf: fix warning for crash_kexec
  2024-03-18 16:13   ` Yonghong Song
@ 2024-03-19  8:06     ` Hari Bathini
  0 siblings, 0 replies; 9+ messages in thread
From: Hari Bathini @ 2024-03-19  8:06 UTC (permalink / raw)
  To: Yonghong Song, bpf
  Cc: Kexec-ml, Baoquan He, Daniel Borkmann, Alexei Starovoitov,
	Andrii Nakryiko, Andrew Morton



On 18/03/24 9:43 pm, Yonghong Song wrote:
> 
> On 3/17/24 11:52 PM, Hari Bathini wrote:
>> 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.

OK. Sent V2 with tags added and changelog updated:

 
https://lore.kernel.org/all/20240319080152.36987-1-hbathini@linux.ibm.com/

> 
>>
>> On 09/02/24 6:05 pm, Hari Bathini wrote:
>>> 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/20240124051254.67105-1-bhe@redhat.com/
>>>
>>> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
>>> ---
>>>   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 4db1c658254c..e408d1115e26 100644
>>> --- a/kernel/bpf/helpers.c
>>> +++ b/kernel/bpf/helpers.c
>>> @@ -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)
>>

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

end of thread, other threads:[~2024-03-19  8:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-09 12:35 [PATCH linux-next] bpf: fix warning for crash_kexec Hari Bathini
2024-02-09 19:18 ` Stanislav Fomichev
2024-02-10  4:51   ` Baoquan He
2024-02-12  8:44     ` Jiri Olsa
2024-02-12 16:48       ` Stanislav Fomichev
2024-02-10  4:52 ` Baoquan He
2024-03-18  6:52 ` Hari Bathini
2024-03-18 16:13   ` Yonghong Song
2024-03-19  8:06     ` Hari Bathini

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