mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] RISC-V: stacktrace: Declare sp_in_global outside ifdef
@ 2020-04-13 16:12 Guenter Roeck
  2020-04-21 17:54 ` Palmer Dabbelt
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2020-04-13 16:12 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Albert Ou, Paul Walmsley, linux-riscv, linux-kernel,
	Guenter Roeck, Palmer Dabbelt

riscv:allnoconfig and riscv:tinyconfig fail to compile.

arch/riscv/kernel/stacktrace.c: In function 'walk_stackframe':
arch/riscv/kernel/stacktrace.c:78:8: error: 'sp_in_global' undeclared

sp_in_global is declared inside CONFIG_FRAME_POINTER but used outside
of it.

Fixes: 52e7c52d2ded ("RISC-V: Stop relying on GCC's register allocator's hueristics")
Cc: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Apologies for the noise if this has already been fixed somewhere.

 arch/riscv/kernel/stacktrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 02087fe539c6..6c854875ac74 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -12,6 +12,8 @@
 #include <linux/stacktrace.h>
 #include <linux/ftrace.h>
 
+register unsigned long sp_in_global __asm__("sp");
+
 #ifdef CONFIG_FRAME_POINTER
 
 struct stackframe {
@@ -19,8 +21,6 @@ struct stackframe {
 	unsigned long ra;
 };
 
-register unsigned long sp_in_global __asm__("sp");
-
 void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 			     bool (*fn)(unsigned long, void *), void *arg)
 {
-- 
2.17.1


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

* Re: [PATCH] RISC-V: stacktrace: Declare sp_in_global outside ifdef
  2020-04-13 16:12 [PATCH] RISC-V: stacktrace: Declare sp_in_global outside ifdef Guenter Roeck
@ 2020-04-21 17:54 ` Palmer Dabbelt
  0 siblings, 0 replies; 2+ messages in thread
From: Palmer Dabbelt @ 2020-04-21 17:54 UTC (permalink / raw)
  To: linux; +Cc: aou, Paul Walmsley, linux-riscv, linux-kernel, linux

On Mon, 13 Apr 2020 09:12:34 PDT (-0700), linux@roeck-us.net wrote:
> riscv:allnoconfig and riscv:tinyconfig fail to compile.
>
> arch/riscv/kernel/stacktrace.c: In function 'walk_stackframe':
> arch/riscv/kernel/stacktrace.c:78:8: error: 'sp_in_global' undeclared
>
> sp_in_global is declared inside CONFIG_FRAME_POINTER but used outside
> of it.
>
> Fixes: 52e7c52d2ded ("RISC-V: Stop relying on GCC's register allocator's hueristics")
> Cc: Palmer Dabbelt <palmerdabbelt@google.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Apologies for the noise if this has already been fixed somewhere.
>
>  arch/riscv/kernel/stacktrace.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
> index 02087fe539c6..6c854875ac74 100644
> --- a/arch/riscv/kernel/stacktrace.c
> +++ b/arch/riscv/kernel/stacktrace.c
> @@ -12,6 +12,8 @@
>  #include <linux/stacktrace.h>
>  #include <linux/ftrace.h>
>
> +register unsigned long sp_in_global __asm__("sp");
> +
>  #ifdef CONFIG_FRAME_POINTER
>
>  struct stackframe {
> @@ -19,8 +21,6 @@ struct stackframe {
>  	unsigned long ra;
>  };
>
> -register unsigned long sp_in_global __asm__("sp");
> -
>  void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
>  			     bool (*fn)(unsigned long, void *), void *arg)
>  {

Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>

Thanks.  This is on fixes.

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

end of thread, other threads:[~2020-04-21 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 16:12 [PATCH] RISC-V: stacktrace: Declare sp_in_global outside ifdef Guenter Roeck
2020-04-21 17:54 ` Palmer Dabbelt

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

all inboxes | Powered by JetHome®