linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the tip tree
@ 2021-10-18  6:23 Stephen Rothwell
  2021-10-18  6:45 ` Qi Zheng
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2021-10-18  6:23 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
  Cc: Kees Cook, Qi Zheng, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 788 bytes --]

Hi all,

After merging the tip tree, today's linux-next build (x86_64 allnoconfig)
failed like this:

arch/x86/kernel/process.c: In function '__get_wchan':
arch/x86/kernel/process.c:950:2: error: implicit declaration of function 'stack_trace_save_tsk' [-Werror=implicit-function-declaration]
  950 |  stack_trace_save_tsk(p, &entry, 1, 0);
      |  ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

Caused by commit

  bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")

stack_trace_save_tsk() requires CONFIG_STACKTRACE which is not set for
this build.

I have reverted that commit, and commit

  42a20f86dc19 ("sched: Add wrapper for get_wchan() to keep task blocked")

which follows it, for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* linux-next: build failure after merge of the tip tree
  2021-10-18  6:23 linux-next: build failure after merge of the tip tree Stephen Rothwell
@ 2021-10-18  6:45 ` Qi Zheng
  2021-10-22  7:43   ` [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Qi Zheng @ 2021-10-18  6:45 UTC (permalink / raw)
  To: Stephen Rothwell, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Peter Zijlstra
  Cc: Kees Cook, Linux Kernel Mailing List, Linux Next Mailing List



On 10/18/21 2:23 PM, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the tip tree, today's linux-next build (x86_64 allnoconfig)
> failed like this:
> 
> arch/x86/kernel/process.c: In function '__get_wchan':
> arch/x86/kernel/process.c:950:2: error: implicit declaration of function 'stack_trace_save_tsk' [-Werror=implicit-function-declaration]
>    950 |  stack_trace_save_tsk(p, &entry, 1, 0);
>        |  ^~~~~~~~~~~~~~~~~~~~
> cc1: some warnings being treated as errors
> 
> Caused by commit
> 
>    bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")
> 
> stack_trace_save_tsk() requires CONFIG_STACKTRACE which is not set for
> this build.

Maybe get_wchan() can be updated to:

unsigned long get_wchan(struct task_struct *p)
{
#ifdef CONFIG_STACKTRACE
	unsigned long entry = 0;

	stack_trace_save_tsk(p, &entry, 1, 0);
	return entry;
#else /* CONFIG_STACKTRACE */
	return 0;
#endif
}

Thanks,
Qi

> 
> I have reverted that commit, and commit
> 
>    42a20f86dc19 ("sched: Add wrapper for get_wchan() to keep task blocked")
> 
> which follows it, for today.
> 

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

* [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too
  2021-10-18  6:45 ` Qi Zheng
@ 2021-10-22  7:43   ` Ingo Molnar
  2021-10-22 11:38     ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2021-10-22  7:43 UTC (permalink / raw)
  To: Qi Zheng
  Cc: Stephen Rothwell, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Peter Zijlstra, Kees Cook, Linux Kernel Mailing List,
	Linux Next Mailing List


* Qi Zheng <zhengqi.arch@bytedance.com> wrote:

> 
> 
> On 10/18/21 2:23 PM, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the tip tree, today's linux-next build (x86_64 allnoconfig)
> > failed like this:
> > 
> > arch/x86/kernel/process.c: In function '__get_wchan':
> > arch/x86/kernel/process.c:950:2: error: implicit declaration of function 'stack_trace_save_tsk' [-Werror=implicit-function-declaration]
> >    950 |  stack_trace_save_tsk(p, &entry, 1, 0);
> >        |  ^~~~~~~~~~~~~~~~~~~~
> > cc1: some warnings being treated as errors
> > 
> > Caused by commit
> > 
> >    bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")
> > 
> > stack_trace_save_tsk() requires CONFIG_STACKTRACE which is not set for
> > this build.
> 
> Maybe get_wchan() can be updated to:
> 
> unsigned long get_wchan(struct task_struct *p)
> {
> #ifdef CONFIG_STACKTRACE
> 	unsigned long entry = 0;
> 
> 	stack_trace_save_tsk(p, &entry, 1, 0);
> 	return entry;
> #else /* CONFIG_STACKTRACE */
> 	return 0;
> #endif
> }

And repeat the same ugliness in every single function that happens to use 
the stack_trace_save_tsk() API??

The correct solution is to define stack_trace_save_tsk() in the 
!CONFIG_STACKTRACE case too, as the patch below does.

Thanks,

	Ingo

==============================>
From: Ingo Molnar <mingo@kernel.org>
Date: Fri, 22 Oct 2021 09:40:27 +0200
Subject: [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too

The following commit:

  bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")

Added stack_trace_save_tsk() use to __get_wchan(), while this method is not
unconditionally defined: it's not available in the !CONFIG_STACKTRACE case.

Give a default implementation that does nothing.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/stacktrace.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 9edecb494e9e..3ccaf599630f 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -91,8 +91,19 @@ extern void save_stack_trace_tsk(struct task_struct *tsk,
 extern int save_stack_trace_tsk_reliable(struct task_struct *tsk,
 					 struct stack_trace *trace);
 extern void save_stack_trace_user(struct stack_trace *trace);
+
 #endif /* !CONFIG_ARCH_STACKWALK */
-#endif /* CONFIG_STACKTRACE */
+
+#else /* !CONFIG_STACKTRACE: */
+static inline unsigned int
+stack_trace_save_tsk(struct task_struct *task,
+		     unsigned long *store, unsigned int size,
+		     unsigned int skipnr)
+{
+	return -ENOSYS;
+}
+
+#endif /* !CONFIG_STACKTRACE */
 
 #if defined(CONFIG_STACKTRACE) && defined(CONFIG_HAVE_RELIABLE_STACKTRACE)
 int stack_trace_save_tsk_reliable(struct task_struct *tsk, unsigned long *store,

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

* Re: [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too
  2021-10-22  7:43   ` [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too Ingo Molnar
@ 2021-10-22 11:38     ` Peter Zijlstra
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2021-10-22 11:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Qi Zheng, Stephen Rothwell, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, Kees Cook, Linux Kernel Mailing List,
	Linux Next Mailing List

On Fri, Oct 22, 2021 at 09:43:50AM +0200, Ingo Molnar wrote:
> 
> * Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> > 
> > 
> > On 10/18/21 2:23 PM, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > After merging the tip tree, today's linux-next build (x86_64 allnoconfig)
> > > failed like this:
> > > 
> > > arch/x86/kernel/process.c: In function '__get_wchan':
> > > arch/x86/kernel/process.c:950:2: error: implicit declaration of function 'stack_trace_save_tsk' [-Werror=implicit-function-declaration]
> > >    950 |  stack_trace_save_tsk(p, &entry, 1, 0);
> > >        |  ^~~~~~~~~~~~~~~~~~~~
> > > cc1: some warnings being treated as errors
> > > 
> > > Caused by commit
> > > 
> > >    bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")
> > > 
> > > stack_trace_save_tsk() requires CONFIG_STACKTRACE which is not set for
> > > this build.
> > 
> > Maybe get_wchan() can be updated to:
> > 
> > unsigned long get_wchan(struct task_struct *p)
> > {
> > #ifdef CONFIG_STACKTRACE
> > 	unsigned long entry = 0;
> > 
> > 	stack_trace_save_tsk(p, &entry, 1, 0);
> > 	return entry;
> > #else /* CONFIG_STACKTRACE */
> > 	return 0;
> > #endif
> > }
> 
> And repeat the same ugliness in every single function that happens to use 
> the stack_trace_save_tsk() API??
> 
> The correct solution is to define stack_trace_save_tsk() in the 
> !CONFIG_STACKTRACE case too, as the patch below does.

That doesn't make sense for x86. We have an unconditional unwinder
present.

I've got these, meant to post them later today:

  https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=sched/wchan

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

end of thread, other threads:[~2021-10-22 11:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18  6:23 linux-next: build failure after merge of the tip tree Stephen Rothwell
2021-10-18  6:45 ` Qi Zheng
2021-10-22  7:43   ` [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too Ingo Molnar
2021-10-22 11:38     ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).