All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] riscv: cover to ARCH_STACKWALK
@ 2020-11-13  6:42 Kefeng Wang
  2020-11-13  6:42 ` [PATCH 1/3] riscv: Cleanup stacktrace Kefeng Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-11-13  6:42 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv; +Cc: Kefeng Wang

Use the newer common infrastructure and simpler arch_stack_walk() interface
for stack walk.

Kefeng Wang (3):
  riscv: Cleanup stacktrace
  riscv: Make stack walk callback consistent with generic code
  riscv: Enable ARCH_STACKWALK

 arch/riscv/Kconfig                  |  1 +
 arch/riscv/include/asm/stacktrace.h | 17 ++++++++
 arch/riscv/kernel/perf_callchain.c  | 10 +----
 arch/riscv/kernel/stacktrace.c      | 62 +++++++----------------------
 4 files changed, 34 insertions(+), 56 deletions(-)
 create mode 100644 arch/riscv/include/asm/stacktrace.h

-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH 1/3] riscv: Cleanup stacktrace
  2020-11-13  6:42 [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
@ 2020-11-13  6:42 ` Kefeng Wang
  2020-11-13  6:42 ` [PATCH 2/3] riscv: Make stack walk callback consistent with generic code Kefeng Wang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-11-13  6:42 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv; +Cc: Kefeng Wang

1. add asm/stacktrace.h for walk_stackframe and struct stackframe
2. remove unnecessary blank lines in stacktrace.c
3. fix warning "no previous prototype for ‘fill_callchain’"

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/stacktrace.h | 17 +++++++++++++++++
 arch/riscv/kernel/perf_callchain.c  | 10 ++--------
 arch/riscv/kernel/stacktrace.c      |  9 ++-------
 3 files changed, 21 insertions(+), 15 deletions(-)
 create mode 100644 arch/riscv/include/asm/stacktrace.h

diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
new file mode 100644
index 000000000000..f09c1e31bde9
--- /dev/null
+++ b/arch/riscv/include/asm/stacktrace.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _ASM_RISCV_STACKTRACE_H
+#define _ASM_RISCV_STACKTRACE_H
+
+#include <linux/sched.h>
+#include <asm/ptrace.h>
+
+struct stackframe {
+	unsigned long fp;
+	unsigned long ra;
+};
+
+extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
+				    bool (*fn)(unsigned long, void *), void *arg);
+
+#endif /* _ASM_RISCV_STACKTRACE_H */
diff --git a/arch/riscv/kernel/perf_callchain.c b/arch/riscv/kernel/perf_callchain.c
index cf190197a22f..623ecd36a720 100644
--- a/arch/riscv/kernel/perf_callchain.c
+++ b/arch/riscv/kernel/perf_callchain.c
@@ -4,11 +4,7 @@
 #include <linux/perf_event.h>
 #include <linux/uaccess.h>
 
-/* Kernel callchain */
-struct stackframe {
-	unsigned long fp;
-	unsigned long ra;
-};
+#include <asm/stacktrace.h>
 
 /*
  * Get the return address for a single stackframe and return a pointer to the
@@ -74,13 +70,11 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
 		fp = user_backtrace(entry, fp, 0);
 }
 
-bool fill_callchain(unsigned long pc, void *entry)
+static bool fill_callchain(unsigned long pc, void *entry)
 {
 	return perf_callchain_store(entry, pc);
 }
 
-void notrace walk_stackframe(struct task_struct *task,
-	struct pt_regs *regs, bool (*fn)(unsigned long, void *), void *arg);
 void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
 			   struct pt_regs *regs)
 {
diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 595342910c3f..345a202c92bb 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -12,15 +12,12 @@
 #include <linux/stacktrace.h>
 #include <linux/ftrace.h>
 
+#include <asm/stacktrace.h>
+
 register unsigned long sp_in_global __asm__("sp");
 
 #ifdef CONFIG_FRAME_POINTER
 
-struct stackframe {
-	unsigned long fp;
-	unsigned long ra;
-};
-
 void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 			     bool (*fn)(unsigned long, void *), void *arg)
 {
@@ -96,7 +93,6 @@ void notrace walk_stackframe(struct task_struct *task,
 
 #endif /* CONFIG_FRAME_POINTER */
 
-
 static bool print_trace_address(unsigned long pc, void *arg)
 {
 	const char *loglvl = arg;
@@ -130,7 +126,6 @@ unsigned long get_wchan(struct task_struct *task)
 	return pc;
 }
 
-
 #ifdef CONFIG_STACKTRACE
 
 static bool __save_trace(unsigned long pc, void *arg, bool nosched)
-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH 2/3] riscv: Make stack walk callback consistent with generic code
  2020-11-13  6:42 [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
  2020-11-13  6:42 ` [PATCH 1/3] riscv: Cleanup stacktrace Kefeng Wang
@ 2020-11-13  6:42 ` Kefeng Wang
  2020-11-13  6:42 ` [PATCH 3/3] riscv: Enable ARCH_STACKWALK Kefeng Wang
  2020-11-21  3:01 ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Palmer Dabbelt
  3 siblings, 0 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-11-13  6:42 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv; +Cc: Kefeng Wang

In order to use generic arch_stack_walk() code, make stack walk
callback consistent with it.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/stacktrace.h |  2 +-
 arch/riscv/kernel/perf_callchain.c  |  2 +-
 arch/riscv/kernel/stacktrace.c      | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
index f09c1e31bde9..470a65c4ccdc 100644
--- a/arch/riscv/include/asm/stacktrace.h
+++ b/arch/riscv/include/asm/stacktrace.h
@@ -12,6 +12,6 @@ struct stackframe {
 };
 
 extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
-				    bool (*fn)(unsigned long, void *), void *arg);
+				    bool (*fn)(void *, unsigned long), void *arg);
 
 #endif /* _ASM_RISCV_STACKTRACE_H */
diff --git a/arch/riscv/kernel/perf_callchain.c b/arch/riscv/kernel/perf_callchain.c
index 623ecd36a720..0bb1854dce83 100644
--- a/arch/riscv/kernel/perf_callchain.c
+++ b/arch/riscv/kernel/perf_callchain.c
@@ -70,7 +70,7 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
 		fp = user_backtrace(entry, fp, 0);
 }
 
-static bool fill_callchain(unsigned long pc, void *entry)
+static bool fill_callchain(void *entry, unsigned long pc)
 {
 	return perf_callchain_store(entry, pc);
 }
diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 345a202c92bb..81c48144c504 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -43,7 +43,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 		unsigned long low, high;
 		struct stackframe *frame;
 
-		if (unlikely(!__kernel_text_address(pc) || fn(pc, arg)))
+		if (unlikely(!__kernel_text_address(pc) || fn(arg, pc)))
 			break;
 
 		/* Validate frame pointer */
@@ -63,7 +63,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 #else /* !CONFIG_FRAME_POINTER */
 
 void notrace walk_stackframe(struct task_struct *task,
-	struct pt_regs *regs, bool (*fn)(unsigned long, void *), void *arg)
+	struct pt_regs *regs, bool (*fn)(void *, unsigned long), void *arg)
 {
 	unsigned long sp, pc;
 	unsigned long *ksp;
@@ -85,7 +85,7 @@ void notrace walk_stackframe(struct task_struct *task,
 
 	ksp = (unsigned long *)sp;
 	while (!kstack_end(ksp)) {
-		if (__kernel_text_address(pc) && unlikely(fn(pc, arg)))
+		if (__kernel_text_address(pc) && unlikely(fn(arg, pc)))
 			break;
 		pc = (*ksp++) - 0x4;
 	}
@@ -107,7 +107,7 @@ void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
 }
 
-static bool save_wchan(unsigned long pc, void *arg)
+static bool save_wchan(void *arg, unsigned long pc)
 {
 	if (!in_sched_functions(pc)) {
 		unsigned long *p = arg;
@@ -143,7 +143,7 @@ static bool __save_trace(unsigned long pc, void *arg, bool nosched)
 	return (trace->nr_entries >= trace->max_entries);
 }
 
-static bool save_trace(unsigned long pc, void *arg)
+static bool save_trace(void *arg, unsigned long pc)
 {
 	return __save_trace(pc, arg, false);
 }
-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH 3/3] riscv: Enable ARCH_STACKWALK
  2020-11-13  6:42 [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
  2020-11-13  6:42 ` [PATCH 1/3] riscv: Cleanup stacktrace Kefeng Wang
  2020-11-13  6:42 ` [PATCH 2/3] riscv: Make stack walk callback consistent with generic code Kefeng Wang
@ 2020-11-13  6:42 ` Kefeng Wang
  2020-11-21  3:01 ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Palmer Dabbelt
  3 siblings, 0 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-11-13  6:42 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv; +Cc: Kefeng Wang

Convert to ARCH_STACKWALK to reduce duplicated code in stack trace.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig             |  1 +
 arch/riscv/kernel/stacktrace.c | 49 +++++++---------------------------
 2 files changed, 11 insertions(+), 39 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index dfbc1351ee62..d9da5d92e40d 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -14,6 +14,7 @@ config RISCV
 	def_bool y
 	select ARCH_CLOCKSOURCE_INIT
 	select ARCH_SUPPORTS_ATOMIC_RMW
+	select ARCH_STACKWALK
 	select ARCH_HAS_BINFMT_FLAT
 	select ARCH_HAS_DEBUG_VM_PGTABLE
 	select ARCH_HAS_DEBUG_VIRTUAL if MMU
diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 81c48144c504..48b870a685b3 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -19,7 +19,7 @@ register unsigned long sp_in_global __asm__("sp");
 #ifdef CONFIG_FRAME_POINTER
 
 void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
-			     bool (*fn)(unsigned long, void *), void *arg)
+			     bool (*fn)(void *, unsigned long), void *arg)
 {
 	unsigned long fp, sp, pc;
 
@@ -43,7 +43,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 		unsigned long low, high;
 		struct stackframe *frame;
 
-		if (unlikely(!__kernel_text_address(pc) || fn(arg, pc)))
+		if (unlikely(!__kernel_text_address(pc) || !fn(arg, pc)))
 			break;
 
 		/* Validate frame pointer */
@@ -85,7 +85,7 @@ void notrace walk_stackframe(struct task_struct *task,
 
 	ksp = (unsigned long *)sp;
 	while (!kstack_end(ksp)) {
-		if (__kernel_text_address(pc) && unlikely(fn(arg, pc)))
+		if (__kernel_text_address(pc) && unlikely(!fn(arg, pc)))
 			break;
 		pc = (*ksp++) - 0x4;
 	}
@@ -93,12 +93,12 @@ void notrace walk_stackframe(struct task_struct *task,
 
 #endif /* CONFIG_FRAME_POINTER */
 
-static bool print_trace_address(unsigned long pc, void *arg)
+static bool print_trace_address(void *arg, unsigned long pc)
 {
 	const char *loglvl = arg;
 
 	print_ip_sym(loglvl, pc);
-	return false;
+	return true;
 }
 
 void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
@@ -112,9 +112,9 @@ static bool save_wchan(void *arg, unsigned long pc)
 	if (!in_sched_functions(pc)) {
 		unsigned long *p = arg;
 		*p = pc;
-		return true;
+		return false;
 	}
-	return false;
+	return true;
 }
 
 unsigned long get_wchan(struct task_struct *task)
@@ -128,39 +128,10 @@ unsigned long get_wchan(struct task_struct *task)
 
 #ifdef CONFIG_STACKTRACE
 
-static bool __save_trace(unsigned long pc, void *arg, bool nosched)
-{
-	struct stack_trace *trace = arg;
-
-	if (unlikely(nosched && in_sched_functions(pc)))
-		return false;
-	if (unlikely(trace->skip > 0)) {
-		trace->skip--;
-		return false;
-	}
-
-	trace->entries[trace->nr_entries++] = pc;
-	return (trace->nr_entries >= trace->max_entries);
-}
-
-static bool save_trace(void *arg, unsigned long pc)
-{
-	return __save_trace(pc, arg, false);
-}
-
-/*
- * Save stack-backtrace addresses into a stack_trace buffer.
- */
-void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
-{
-	walk_stackframe(tsk, NULL, save_trace, trace);
-}
-EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
-
-void save_stack_trace(struct stack_trace *trace)
+void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie,
+		     struct task_struct *task, struct pt_regs *regs)
 {
-	save_stack_trace_tsk(NULL, trace);
+	walk_stackframe(task, regs, consume_entry, cookie);
 }
-EXPORT_SYMBOL_GPL(save_stack_trace);
 
 #endif /* CONFIG_STACKTRACE */
-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 0/3] riscv: cover to ARCH_STACKWALK
  2020-11-13  6:42 [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
                   ` (2 preceding siblings ...)
  2020-11-13  6:42 ` [PATCH 3/3] riscv: Enable ARCH_STACKWALK Kefeng Wang
@ 2020-11-21  3:01 ` Palmer Dabbelt
  2020-11-24 11:20   ` [PATCH 1/2] riscv: Add dump stack in show_regs Kefeng Wang
  2020-12-17  2:34   ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
  3 siblings, 2 replies; 21+ messages in thread
From: Palmer Dabbelt @ 2020-11-21  3:01 UTC (permalink / raw)
  To: wangkefeng.wang; +Cc: linux-riscv, aou, wangkefeng.wang, Paul Walmsley

On Thu, 12 Nov 2020 22:42:20 PST (-0800), wangkefeng.wang@huawei.com wrote:
> Use the newer common infrastructure and simpler arch_stack_walk() interface
> for stack walk.
>
> Kefeng Wang (3):
>   riscv: Cleanup stacktrace
>   riscv: Make stack walk callback consistent with generic code
>   riscv: Enable ARCH_STACKWALK
>
>  arch/riscv/Kconfig                  |  1 +
>  arch/riscv/include/asm/stacktrace.h | 17 ++++++++
>  arch/riscv/kernel/perf_callchain.c  | 10 +----
>  arch/riscv/kernel/stacktrace.c      | 62 +++++++----------------------
>  4 files changed, 34 insertions(+), 56 deletions(-)
>  create mode 100644 arch/riscv/include/asm/stacktrace.h

Thanks, these are on for-next.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH 1/2] riscv: Add dump stack in show_regs
  2020-11-21  3:01 ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Palmer Dabbelt
@ 2020-11-24 11:20   ` Kefeng Wang
  2020-11-24 11:20     ` [PATCH 2/2] riscv: Fix __show_regs printing formats Kefeng Wang
                       ` (2 more replies)
  2020-12-17  2:34   ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
  1 sibling, 3 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-11-24 11:20 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv; +Cc: Kefeng Wang

Like commit 1149aad10b1e ("arm64: Add dump_backtrace() in show_regs"),
dump the stack in riscv show_regs as common code expects.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
NOTE: The patches based on
https://patchwork.kernel.org/project/linux-riscv/list/?series=383349

 arch/riscv/include/asm/bug.h        |  1 +
 arch/riscv/include/asm/stacktrace.h |  2 ++
 arch/riscv/kernel/process.c         |  9 ++++++++-
 arch/riscv/kernel/stacktrace.c      | 10 ++++++++--
 arch/riscv/kernel/traps.c           |  3 ++-
 5 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
index d6f1ec08d97b..d3804a2f9aad 100644
--- a/arch/riscv/include/asm/bug.h
+++ b/arch/riscv/include/asm/bug.h
@@ -85,6 +85,7 @@ do {								\
 struct pt_regs;
 struct task_struct;
 
+void __show_regs(struct pt_regs *regs);
 void die(struct pt_regs *regs, const char *str);
 void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr);
 
diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
index 470a65c4ccdc..3450c1912afd 100644
--- a/arch/riscv/include/asm/stacktrace.h
+++ b/arch/riscv/include/asm/stacktrace.h
@@ -13,5 +13,7 @@ struct stackframe {
 
 extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 				    bool (*fn)(void *, unsigned long), void *arg);
+extern void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
+			   const char *loglvl);
 
 #endif /* _ASM_RISCV_STACKTRACE_H */
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index 19225ec65db6..e41b733abeaa 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -18,6 +18,7 @@
 #include <asm/unistd.h>
 #include <asm/processor.h>
 #include <asm/csr.h>
+#include <asm/stacktrace.h>
 #include <asm/string.h>
 #include <asm/switch_to.h>
 #include <asm/thread_info.h>
@@ -39,7 +40,7 @@ void arch_cpu_idle(void)
 	local_irq_enable();
 }
 
-void show_regs(struct pt_regs *regs)
+void __show_regs(struct pt_regs *regs)
 {
 	show_regs_print_info(KERN_DEFAULT);
 
@@ -69,6 +70,12 @@ void show_regs(struct pt_regs *regs)
 	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
 		regs->status, regs->badaddr, regs->cause);
 }
+void show_regs(struct pt_regs *regs)
+{
+	__show_regs(regs);
+	if (!user_mode(regs))
+		dump_backtrace(regs, NULL, KERN_DEFAULT);
+}
 
 void start_thread(struct pt_regs *regs, unsigned long pc,
 	unsigned long sp)
diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 48b870a685b3..76dadf6d396b 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -101,10 +101,16 @@ static bool print_trace_address(void *arg, unsigned long pc)
 	return true;
 }
 
+void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
+		    const char *loglvl)
+{
+	pr_cont("%sCall Trace:\n", loglvl);
+	walk_stackframe(task, regs, print_trace_address, (void *)loglvl);
+}
+
 void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
-	pr_cont("Call Trace:\n");
-	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
+	dump_backtrace(NULL, task, loglvl);
 }
 
 static bool save_wchan(void *arg, unsigned long pc)
diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
index ad14f4466d92..570eb078b1e1 100644
--- a/arch/riscv/kernel/traps.c
+++ b/arch/riscv/kernel/traps.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/irq.h>
 
+#include <asm/bug.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/csr.h>
@@ -66,7 +67,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr)
 			tsk->comm, task_pid_nr(tsk), signo, code, addr);
 		print_vma_addr(KERN_CONT " in ", instruction_pointer(regs));
 		pr_cont("\n");
-		show_regs(regs);
+		__show_regs(regs);
 	}
 
 	force_sig_fault(signo, code, (void __user *)addr);
-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH 2/2] riscv: Fix __show_regs printing formats
  2020-11-24 11:20   ` [PATCH 1/2] riscv: Add dump stack in show_regs Kefeng Wang
@ 2020-11-24 11:20     ` Kefeng Wang
  2020-11-25 22:58       ` Atish Patra
  2020-11-26 13:33       ` [PATCH v2] riscv: Using printk directly in __show_regs Kefeng Wang
  2020-11-25 23:04     ` [PATCH 1/2] riscv: Add dump stack in show_regs Atish Patra
  2020-12-14 11:52     ` Kefeng Wang
  2 siblings, 2 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-11-24 11:20 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv; +Cc: Kefeng Wang

Using printk directly and align the printing formats.

Before:
epc: ffffffe0008dc23a ra : ffffffe0008dc238 sp : ffffffe081ddbd80 gp : ffffffe0010e2c70 tp : ffffffe0800d47c0 t0 : ffffffe001018620
 t1 : 0000000000000064 t2 : 000000000000000a s0 : ffffffe081ddbda0 s1 : 0000000000000270 a0 : 000000000000002e a1 : ffffffe000baaf90
 a2 : 0000000000000010 a3 : 0000000000000001 a4 : 1db93e333d1e1200 a5 : 1db93e333d1e1200 a6 : 0000000000000030 a7 : ffffffffffffffff
 s2 : 0000000000000000 s3 : ffffffe000b9ac80 s4 : ffffffe081d9f000 s5 : 0000000000000048 s6 : 000000000000000c s7 : ffffffe081ddbe80
 s8 : 0000000000000000 s9 : 00000000000b1688 s10: 0000000000099dc8 s11: 0000003fffbd9fa2 t3 : 1db93e333d1e1200 t4 : 0000000000000002
 t5 : 0000003ff778eac8 t6 : ffffffe081ddbac8status: 0000000000000120 badaddr: 0000000000000000 cause: 000000000000000d

After:
epc: ffffffe0008dc23e ra : ffffffe0008dc23c sp : ffffffe08221bd80
gp : ffffffe0010e2c70 tp : ffffffe081cb1ec0 t0 : ffffffe001018620
t1 : 0000000000000064 t2 : 000000000000000a s0 : ffffffe08221bda0
s1 : 0000000000000270 a0 : 000000000000002e a1 : ffffffe000baafb8
a2 : 0000000000000010 a3 : 0000000000000001 a4 : eee4a3de5cb81700
a5 : eee4a3de5cb81700 a6 : 0000000000000030 a7 : ffffffffffffffff
s2 : 0000000000000000 s3 : ffffffe000b9aca8 s4 : ffffffe081d52000
s5 : 0000000000000048 s6 : 000000000000000c s7 : ffffffe08221be80
s8 : 0000000000000000 s9 : 00000000000b1688 s10: 0000000000099dc8
s11: 0000003fffe33fa2 t3 : eee4a3de5cb81700 t4 : 0000000000000002
t5 : 0000003fcc454ac8 t6 : ffffffe08221bac8
status: 0000000000000120 badaddr: 0000000000000000 cause: 000000000000000d

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/kernel/process.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index e41b733abeaa..2119d49feea5 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -44,30 +44,30 @@ void __show_regs(struct pt_regs *regs)
 {
 	show_regs_print_info(KERN_DEFAULT);
 
-	pr_cont("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
+	printk("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
 		regs->epc, regs->ra, regs->sp);
-	pr_cont(" gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
+	printk("gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
 		regs->gp, regs->tp, regs->t0);
-	pr_cont(" t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
+	printk("t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
 		regs->t1, regs->t2, regs->s0);
-	pr_cont(" s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
+	printk("s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
 		regs->s1, regs->a0, regs->a1);
-	pr_cont(" a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
+	printk("a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
 		regs->a2, regs->a3, regs->a4);
-	pr_cont(" a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
+	printk("a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
 		regs->a5, regs->a6, regs->a7);
-	pr_cont(" s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
+	printk("s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
 		regs->s2, regs->s3, regs->s4);
-	pr_cont(" s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
+	printk("s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
 		regs->s5, regs->s6, regs->s7);
-	pr_cont(" s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
+	printk("s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
 		regs->s8, regs->s9, regs->s10);
-	pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
+	printk("s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
 		regs->s11, regs->t3, regs->t4);
-	pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
+	printk("t5 : " REG_FMT " t6 : " REG_FMT "\n",
 		regs->t5, regs->t6);
 
-	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
+	printk("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
 		regs->status, regs->badaddr, regs->cause);
 }
 void show_regs(struct pt_regs *regs)
-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: Fix __show_regs printing formats
  2020-11-24 11:20     ` [PATCH 2/2] riscv: Fix __show_regs printing formats Kefeng Wang
@ 2020-11-25 22:58       ` Atish Patra
  2020-11-26  1:10         ` Kefeng Wang
  2020-11-26 13:33       ` [PATCH v2] riscv: Using printk directly in __show_regs Kefeng Wang
  1 sibling, 1 reply; 21+ messages in thread
From: Atish Patra @ 2020-11-25 22:58 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: linux-riscv, Albert Ou, Palmer Dabbelt, Paul Walmsley

On Tue, Nov 24, 2020 at 3:17 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
> Using printk directly and align the printing formats.
>

Why switch to printk ? IIRC, pr_* is preferred over printk for any new code.

> Before:
> epc: ffffffe0008dc23a ra : ffffffe0008dc238 sp : ffffffe081ddbd80 gp : ffffffe0010e2c70 tp : ffffffe0800d47c0 t0 : ffffffe001018620
>  t1 : 0000000000000064 t2 : 000000000000000a s0 : ffffffe081ddbda0 s1 : 0000000000000270 a0 : 000000000000002e a1 : ffffffe000baaf90
>  a2 : 0000000000000010 a3 : 0000000000000001 a4 : 1db93e333d1e1200 a5 : 1db93e333d1e1200 a6 : 0000000000000030 a7 : ffffffffffffffff
>  s2 : 0000000000000000 s3 : ffffffe000b9ac80 s4 : ffffffe081d9f000 s5 : 0000000000000048 s6 : 000000000000000c s7 : ffffffe081ddbe80
>  s8 : 0000000000000000 s9 : 00000000000b1688 s10: 0000000000099dc8 s11: 0000003fffbd9fa2 t3 : 1db93e333d1e1200 t4 : 0000000000000002
>  t5 : 0000003ff778eac8 t6 : ffffffe081ddbac8status: 0000000000000120 badaddr: 0000000000000000 cause: 000000000000000d
>
> After:
> epc: ffffffe0008dc23e ra : ffffffe0008dc23c sp : ffffffe08221bd80
> gp : ffffffe0010e2c70 tp : ffffffe081cb1ec0 t0 : ffffffe001018620
> t1 : 0000000000000064 t2 : 000000000000000a s0 : ffffffe08221bda0
> s1 : 0000000000000270 a0 : 000000000000002e a1 : ffffffe000baafb8
> a2 : 0000000000000010 a3 : 0000000000000001 a4 : eee4a3de5cb81700
> a5 : eee4a3de5cb81700 a6 : 0000000000000030 a7 : ffffffffffffffff
> s2 : 0000000000000000 s3 : ffffffe000b9aca8 s4 : ffffffe081d52000
> s5 : 0000000000000048 s6 : 000000000000000c s7 : ffffffe08221be80
> s8 : 0000000000000000 s9 : 00000000000b1688 s10: 0000000000099dc8
> s11: 0000003fffe33fa2 t3 : eee4a3de5cb81700 t4 : 0000000000000002
> t5 : 0000003fcc454ac8 t6 : ffffffe08221bac8
> status: 0000000000000120 badaddr: 0000000000000000 cause: 000000000000000d
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/kernel/process.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
> index e41b733abeaa..2119d49feea5 100644
> --- a/arch/riscv/kernel/process.c
> +++ b/arch/riscv/kernel/process.c
> @@ -44,30 +44,30 @@ void __show_regs(struct pt_regs *regs)
>  {
>         show_regs_print_info(KERN_DEFAULT);
>
> -       pr_cont("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
> +       printk("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
>                 regs->epc, regs->ra, regs->sp);
> -       pr_cont(" gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
> +       printk("gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
>                 regs->gp, regs->tp, regs->t0);
> -       pr_cont(" t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
> +       printk("t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
>                 regs->t1, regs->t2, regs->s0);
> -       pr_cont(" s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
> +       printk("s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
>                 regs->s1, regs->a0, regs->a1);
> -       pr_cont(" a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
> +       printk("a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
>                 regs->a2, regs->a3, regs->a4);
> -       pr_cont(" a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
> +       printk("a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
>                 regs->a5, regs->a6, regs->a7);
> -       pr_cont(" s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
> +       printk("s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
>                 regs->s2, regs->s3, regs->s4);
> -       pr_cont(" s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
> +       printk("s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
>                 regs->s5, regs->s6, regs->s7);
> -       pr_cont(" s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
> +       printk("s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
>                 regs->s8, regs->s9, regs->s10);
> -       pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
> +       printk("s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
>                 regs->s11, regs->t3, regs->t4);
> -       pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
> +       printk("t5 : " REG_FMT " t6 : " REG_FMT "\n",
>                 regs->t5, regs->t6);
>
> -       pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
> +       printk("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>                 regs->status, regs->badaddr, regs->cause);
>  }
>  void show_regs(struct pt_regs *regs)
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv



-- 
Regards,
Atish

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 1/2] riscv: Add dump stack in show_regs
  2020-11-24 11:20   ` [PATCH 1/2] riscv: Add dump stack in show_regs Kefeng Wang
  2020-11-24 11:20     ` [PATCH 2/2] riscv: Fix __show_regs printing formats Kefeng Wang
@ 2020-11-25 23:04     ` Atish Patra
  2020-12-14 11:52     ` Kefeng Wang
  2 siblings, 0 replies; 21+ messages in thread
From: Atish Patra @ 2020-11-25 23:04 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: linux-riscv, Albert Ou, Palmer Dabbelt, Paul Walmsley

On Tue, Nov 24, 2020 at 3:17 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
> Like commit 1149aad10b1e ("arm64: Add dump_backtrace() in show_regs"),
> dump the stack in riscv show_regs as common code expects.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> NOTE: The patches based on
> https://patchwork.kernel.org/project/linux-riscv/list/?series=383349
>
>  arch/riscv/include/asm/bug.h        |  1 +
>  arch/riscv/include/asm/stacktrace.h |  2 ++
>  arch/riscv/kernel/process.c         |  9 ++++++++-
>  arch/riscv/kernel/stacktrace.c      | 10 ++++++++--
>  arch/riscv/kernel/traps.c           |  3 ++-
>  5 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
> index d6f1ec08d97b..d3804a2f9aad 100644
> --- a/arch/riscv/include/asm/bug.h
> +++ b/arch/riscv/include/asm/bug.h
> @@ -85,6 +85,7 @@ do {                                                          \
>  struct pt_regs;
>  struct task_struct;
>
> +void __show_regs(struct pt_regs *regs);
>  void die(struct pt_regs *regs, const char *str);
>  void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr);
>
> diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
> index 470a65c4ccdc..3450c1912afd 100644
> --- a/arch/riscv/include/asm/stacktrace.h
> +++ b/arch/riscv/include/asm/stacktrace.h
> @@ -13,5 +13,7 @@ struct stackframe {
>
>  extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
>                                     bool (*fn)(void *, unsigned long), void *arg);
> +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
> +                          const char *loglvl);
>
>  #endif /* _ASM_RISCV_STACKTRACE_H */
> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
> index 19225ec65db6..e41b733abeaa 100644
> --- a/arch/riscv/kernel/process.c
> +++ b/arch/riscv/kernel/process.c
> @@ -18,6 +18,7 @@
>  #include <asm/unistd.h>
>  #include <asm/processor.h>
>  #include <asm/csr.h>
> +#include <asm/stacktrace.h>
>  #include <asm/string.h>
>  #include <asm/switch_to.h>
>  #include <asm/thread_info.h>
> @@ -39,7 +40,7 @@ void arch_cpu_idle(void)
>         local_irq_enable();
>  }
>
> -void show_regs(struct pt_regs *regs)
> +void __show_regs(struct pt_regs *regs)
>  {
>         show_regs_print_info(KERN_DEFAULT);
>
> @@ -69,6 +70,12 @@ void show_regs(struct pt_regs *regs)
>         pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>                 regs->status, regs->badaddr, regs->cause);
>  }
> +void show_regs(struct pt_regs *regs)
> +{
> +       __show_regs(regs);
> +       if (!user_mode(regs))
> +               dump_backtrace(regs, NULL, KERN_DEFAULT);
> +}
>
>  void start_thread(struct pt_regs *regs, unsigned long pc,
>         unsigned long sp)
> diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
> index 48b870a685b3..76dadf6d396b 100644
> --- a/arch/riscv/kernel/stacktrace.c
> +++ b/arch/riscv/kernel/stacktrace.c
> @@ -101,10 +101,16 @@ static bool print_trace_address(void *arg, unsigned long pc)
>         return true;
>  }
>
> +void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
> +                   const char *loglvl)
> +{
> +       pr_cont("%sCall Trace:\n", loglvl);
> +       walk_stackframe(task, regs, print_trace_address, (void *)loglvl);
> +}
> +
>  void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
>  {
> -       pr_cont("Call Trace:\n");
> -       walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
> +       dump_backtrace(NULL, task, loglvl);
>  }
>
>  static bool save_wchan(void *arg, unsigned long pc)
> diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
> index ad14f4466d92..570eb078b1e1 100644
> --- a/arch/riscv/kernel/traps.c
> +++ b/arch/riscv/kernel/traps.c
> @@ -16,6 +16,7 @@
>  #include <linux/module.h>
>  #include <linux/irq.h>
>
> +#include <asm/bug.h>
>  #include <asm/processor.h>
>  #include <asm/ptrace.h>
>  #include <asm/csr.h>
> @@ -66,7 +67,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr)
>                         tsk->comm, task_pid_nr(tsk), signo, code, addr);
>                 print_vma_addr(KERN_CONT " in ", instruction_pointer(regs));
>                 pr_cont("\n");
> -               show_regs(regs);
> +               __show_regs(regs);
>         }
>
>         force_sig_fault(signo, code, (void __user *)addr);
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

LGTM.

Reviewed-by: Atish Patra <atish.patra@wdc.com>

-- 
Regards,
Atish

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: Fix __show_regs printing formats
  2020-11-25 22:58       ` Atish Patra
@ 2020-11-26  1:10         ` Kefeng Wang
  2020-11-26 10:02           ` John Ogness
  0 siblings, 1 reply; 21+ messages in thread
From: Kefeng Wang @ 2020-11-26  1:10 UTC (permalink / raw)
  To: Atish Patra
  Cc: linux-riscv, Albert Ou, Palmer Dabbelt, John Ogness, Paul Walmsley

+ John

On 2020/11/26 6:58, Atish Patra wrote:
> On Tue, Nov 24, 2020 at 3:17 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> Using printk directly and align the printing formats.
>>
> Why switch to printk ? IIRC, pr_* is preferred over printk for any new code.

The stack output is strange,  that is why I move to printk,  and the old 
kernel looks good.

after some test, I fould first bad commit: 
[cfe2790b163acdc9c058a63bff310923e84a16b4] printk: move printk_info into 
separate array

Hi John,  there is printk-rework from you in v5.10-rc1,  could you check 
it ?

Thanks

>
>> Before:
>> epc: ffffffe0008dc23a ra : ffffffe0008dc238 sp : ffffffe081ddbd80 gp : ffffffe0010e2c70 tp : ffffffe0800d47c0 t0 : ffffffe001018620
>>   t1 : 0000000000000064 t2 : 000000000000000a s0 : ffffffe081ddbda0 s1 : 0000000000000270 a0 : 000000000000002e a1 : ffffffe000baaf90
>>   a2 : 0000000000000010 a3 : 0000000000000001 a4 : 1db93e333d1e1200 a5 : 1db93e333d1e1200 a6 : 0000000000000030 a7 : ffffffffffffffff
>>   s2 : 0000000000000000 s3 : ffffffe000b9ac80 s4 : ffffffe081d9f000 s5 : 0000000000000048 s6 : 000000000000000c s7 : ffffffe081ddbe80
>>   s8 : 0000000000000000 s9 : 00000000000b1688 s10: 0000000000099dc8 s11: 0000003fffbd9fa2 t3 : 1db93e333d1e1200 t4 : 0000000000000002
>>   t5 : 0000003ff778eac8 t6 : ffffffe081ddbac8status: 0000000000000120 badaddr: 0000000000000000 cause: 000000000000000d
>>
>> After:
>> epc: ffffffe0008dc23e ra : ffffffe0008dc23c sp : ffffffe08221bd80
>> gp : ffffffe0010e2c70 tp : ffffffe081cb1ec0 t0 : ffffffe001018620
>> t1 : 0000000000000064 t2 : 000000000000000a s0 : ffffffe08221bda0
>> s1 : 0000000000000270 a0 : 000000000000002e a1 : ffffffe000baafb8
>> a2 : 0000000000000010 a3 : 0000000000000001 a4 : eee4a3de5cb81700
>> a5 : eee4a3de5cb81700 a6 : 0000000000000030 a7 : ffffffffffffffff
>> s2 : 0000000000000000 s3 : ffffffe000b9aca8 s4 : ffffffe081d52000
>> s5 : 0000000000000048 s6 : 000000000000000c s7 : ffffffe08221be80
>> s8 : 0000000000000000 s9 : 00000000000b1688 s10: 0000000000099dc8
>> s11: 0000003fffe33fa2 t3 : eee4a3de5cb81700 t4 : 0000000000000002
>> t5 : 0000003fcc454ac8 t6 : ffffffe08221bac8
>> status: 0000000000000120 badaddr: 0000000000000000 cause: 000000000000000d
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: Fix __show_regs printing formats
  2020-11-26  1:10         ` Kefeng Wang
@ 2020-11-26 10:02           ` John Ogness
  2020-11-26 11:55             ` John Ogness
  0 siblings, 1 reply; 21+ messages in thread
From: John Ogness @ 2020-11-26 10:02 UTC (permalink / raw)
  To: Kefeng Wang, Atish Patra
  Cc: Petr Mladek, linux-riscv, Albert Ou, Palmer Dabbelt, Paul Walmsley

+Petr

On 2020-11-26, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> On 2020/11/26 6:58, Atish Patra wrote:
>> On Tue, Nov 24, 2020 at 3:17 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>>> Using printk directly and align the printing formats.
>>>
>> Why switch to printk ? IIRC, pr_* is preferred over printk for any new code.
>
> The stack output is strange, that is why I move to printk, and the old
> kernel looks good.

This is just a quick response to let you know I can reproduce the issue
and I am investigating.

@Petr: The proposed change and output difference is here [0].

John Ogness

[0] http://lists.infradead.org/pipermail/linux-riscv/2020-November/003320.html

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: Fix __show_regs printing formats
  2020-11-26 10:02           ` John Ogness
@ 2020-11-26 11:55             ` John Ogness
  2020-11-26 12:49               ` Kefeng Wang
  0 siblings, 1 reply; 21+ messages in thread
From: John Ogness @ 2020-11-26 11:55 UTC (permalink / raw)
  To: Kefeng Wang, Atish Patra
  Cc: Petr Mladek, linux-riscv, Albert Ou, Palmer Dabbelt, Paul Walmsley

On 2020-11-26, John Ogness <john.ogness@linutronix.de> wrote:
> On 2020-11-26, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> On 2020/11/26 6:58, Atish Patra wrote:
>>> On Tue, Nov 24, 2020 at 3:17 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>>>> Using printk directly and align the printing formats.
>>>>
>>> Why switch to printk ? IIRC, pr_* is preferred over printk for any new code.
>>
>> The stack output is strange, that is why I move to printk, and the old
>> kernel looks good.
>
> This is just a quick response to let you know I can reproduce the issue
> and I am investigating.
>
> @Petr: The proposed change and output difference is here [0].

This is a bug in continuous line handling. I have posted [0] a fix to
LKML.

Note that a pr_cont() message with a trailing newline will "terminate"
the continous line so that it can no longer be continued. Having a bunch
of:

    pr_cont("...\n");

lines is technically wrong. If you really want the full block to be a
single message, put the newline at the beginning of the pr_cont()
message or add some whitespace after a newline at the end. For example:

    pr_cont("\n....");
       or
    pr_cont("...\n ");

Although I would suggest making them separate printk calls. With
CONFIG_PRINTK_CALLER it is still possible to sort out simultaneous dumps
from multiple CPUs.

Thank you for reporting this!

John Ogness

[0] https://lkml.kernel.org/r/20201126114836.14750-1-john.ogness@linutronix.de

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: Fix __show_regs printing formats
  2020-11-26 11:55             ` John Ogness
@ 2020-11-26 12:49               ` Kefeng Wang
  0 siblings, 0 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-11-26 12:49 UTC (permalink / raw)
  To: John Ogness, Atish Patra
  Cc: Petr Mladek, linux-riscv, Albert Ou, Palmer Dabbelt, Paul Walmsley


On 2020/11/26 19:55, John Ogness wrote:
> On 2020-11-26, John Ogness <john.ogness@linutronix.de> wrote:
>> On 2020-11-26, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>>> On 2020/11/26 6:58, Atish Patra wrote:
>>>> On Tue, Nov 24, 2020 at 3:17 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>>>>> Using printk directly and align the printing formats.
>>>>>
>>>> Why switch to printk ? IIRC, pr_* is preferred over printk for any new code.
>>> The stack output is strange, that is why I move to printk, and the old
>>> kernel looks good.
>> This is just a quick response to let you know I can reproduce the issue
>> and I am investigating.
>>
>> @Petr: The proposed change and output difference is here [0].
> This is a bug in continuous line handling. I have posted [0] a fix to
> LKML.
Yes, it fixes the output issue.
>
> Note that a pr_cont() message with a trailing newline will "terminate"
> the continous line so that it can no longer be continued. Having a bunch
> of:
>
>      pr_cont("...\n");
>
> lines is technically wrong. If you really want the full block to be a
> single message, put the newline at the beginning of the pr_cont()
> message or add some whitespace after a newline at the end. For example:
>
>      pr_cont("\n....");
>         or
>      pr_cont("...\n ");
>
> Although I would suggest making them separate printk calls. With
> CONFIG_PRINTK_CALLER it is still possible to sort out simultaneous dumps
> from multiple CPUs.
Thanks for your explanation.  I will re-post patch with changelog refresh.
>
> Thank you for reporting this!
>
> John Ogness
>
> [0] https://lkml.kernel.org/r/20201126114836.14750-1-john.ogness@linutronix.de
> .
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH v2] riscv: Using printk directly in __show_regs
  2020-11-24 11:20     ` [PATCH 2/2] riscv: Fix __show_regs printing formats Kefeng Wang
  2020-11-25 22:58       ` Atish Patra
@ 2020-11-26 13:33       ` Kefeng Wang
  2020-12-11  1:43         ` Palmer Dabbelt
  1 sibling, 1 reply; 21+ messages in thread
From: Kefeng Wang @ 2020-11-26 13:33 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, Palmer Dabbelt
  Cc: Kefeng Wang, John Ogness

Covert bulk of pr_cont("...\n") to separate printk calls.

Note that a pr_cont() message with a trailing newline will
"terminate" the continous line so that it can no longer be
continued, also it is possible to sort out simultaneous dumps
from multiple CPUs with CONFIG_PRINTK_CALLER enabled.

And align the printing formats.

Suggested-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/kernel/process.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index e41b733abeaa..2119d49feea5 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -44,30 +44,30 @@ void __show_regs(struct pt_regs *regs)
 {
 	show_regs_print_info(KERN_DEFAULT);
 
-	pr_cont("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
+	printk("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
 		regs->epc, regs->ra, regs->sp);
-	pr_cont(" gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
+	printk("gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
 		regs->gp, regs->tp, regs->t0);
-	pr_cont(" t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
+	printk("t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
 		regs->t1, regs->t2, regs->s0);
-	pr_cont(" s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
+	printk("s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
 		regs->s1, regs->a0, regs->a1);
-	pr_cont(" a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
+	printk("a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
 		regs->a2, regs->a3, regs->a4);
-	pr_cont(" a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
+	printk("a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
 		regs->a5, regs->a6, regs->a7);
-	pr_cont(" s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
+	printk("s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
 		regs->s2, regs->s3, regs->s4);
-	pr_cont(" s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
+	printk("s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
 		regs->s5, regs->s6, regs->s7);
-	pr_cont(" s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
+	printk("s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
 		regs->s8, regs->s9, regs->s10);
-	pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
+	printk("s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
 		regs->s11, regs->t3, regs->t4);
-	pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
+	printk("t5 : " REG_FMT " t6 : " REG_FMT "\n",
 		regs->t5, regs->t6);
 
-	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
+	printk("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
 		regs->status, regs->badaddr, regs->cause);
 }
 void show_regs(struct pt_regs *regs)
-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2] riscv: Using printk directly in __show_regs
  2020-11-26 13:33       ` [PATCH v2] riscv: Using printk directly in __show_regs Kefeng Wang
@ 2020-12-11  1:43         ` Palmer Dabbelt
  2020-12-11  8:48           ` John Ogness
  0 siblings, 1 reply; 21+ messages in thread
From: Palmer Dabbelt @ 2020-12-11  1:43 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: linux-riscv, aou, wangkefeng.wang, john.ogness, Paul Walmsley

On Thu, 26 Nov 2020 05:33:38 PST (-0800), wangkefeng.wang@huawei.com wrote:
> Covert bulk of pr_cont("...\n") to separate printk calls.
>
> Note that a pr_cont() message with a trailing newline will
> "terminate" the continous line so that it can no longer be
> continued, also it is possible to sort out simultaneous dumps
> from multiple CPUs with CONFIG_PRINTK_CALLER enabled.
>
> And align the printing formats.
>
> Suggested-by: John Ogness <john.ogness@linutronix.de>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/kernel/process.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
> index e41b733abeaa..2119d49feea5 100644
> --- a/arch/riscv/kernel/process.c
> +++ b/arch/riscv/kernel/process.c
> @@ -44,30 +44,30 @@ void __show_regs(struct pt_regs *regs)
>  {
>  	show_regs_print_info(KERN_DEFAULT);
>
> -	pr_cont("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
> +	printk("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
>  		regs->epc, regs->ra, regs->sp);
> -	pr_cont(" gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
> +	printk("gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
>  		regs->gp, regs->tp, regs->t0);
> -	pr_cont(" t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
> +	printk("t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
>  		regs->t1, regs->t2, regs->s0);
> -	pr_cont(" s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
> +	printk("s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
>  		regs->s1, regs->a0, regs->a1);
> -	pr_cont(" a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
> +	printk("a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
>  		regs->a2, regs->a3, regs->a4);
> -	pr_cont(" a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
> +	printk("a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
>  		regs->a5, regs->a6, regs->a7);
> -	pr_cont(" s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
> +	printk("s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
>  		regs->s2, regs->s3, regs->s4);
> -	pr_cont(" s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
> +	printk("s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
>  		regs->s5, regs->s6, regs->s7);
> -	pr_cont(" s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
> +	printk("s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
>  		regs->s8, regs->s9, regs->s10);
> -	pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
> +	printk("s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
>  		regs->s11, regs->t3, regs->t4);
> -	pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
> +	printk("t5 : " REG_FMT " t6 : " REG_FMT "\n",
>  		regs->t5, regs->t6);
>
> -	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
> +	printk("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>  		regs->status, regs->badaddr, regs->cause);
>  }
>  void show_regs(struct pt_regs *regs)

For some reason I remember having these as printk()s originally, but I don't
see that in the git history so maybe it was from before we merged the port?  I
don't really understand the difference here, and I thought using printk()
directly wasn't recommended?

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2] riscv: Using printk directly in __show_regs
  2020-12-11  1:43         ` Palmer Dabbelt
@ 2020-12-11  8:48           ` John Ogness
  2020-12-14 11:49             ` Kefeng Wang
  0 siblings, 1 reply; 21+ messages in thread
From: John Ogness @ 2020-12-11  8:48 UTC (permalink / raw)
  To: Palmer Dabbelt, wangkefeng.wang
  Cc: linux-riscv, aou, wangkefeng.wang, Paul Walmsley

On 2020-12-10, Palmer Dabbelt <palmerdabbelt@google.com> wrote:
> On Thu, 26 Nov 2020 05:33:38 PST (-0800), wangkefeng.wang@huawei.com wrote:
>> Covert bulk of pr_cont("...\n") to separate printk calls.
>>
>> Note that a pr_cont() message with a trailing newline will
>> "terminate" the continous line so that it can no longer be
>> continued, also it is possible to sort out simultaneous dumps
>> from multiple CPUs with CONFIG_PRINTK_CALLER enabled.
>>
>> And align the printing formats.
>>
>> Suggested-by: John Ogness <john.ogness@linutronix.de>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>>  arch/riscv/kernel/process.c | 24 ++++++++++++------------
>>  1 file changed, 12 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
>> index e41b733abeaa..2119d49feea5 100644
>> --- a/arch/riscv/kernel/process.c
>> +++ b/arch/riscv/kernel/process.c
>> @@ -44,30 +44,30 @@ void __show_regs(struct pt_regs *regs)
>>  {
>>  	show_regs_print_info(KERN_DEFAULT);
>>
>> -	pr_cont("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
>> +	printk("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
>>  		regs->epc, regs->ra, regs->sp);
>> -	pr_cont(" gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
>> +	printk("gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
>>  		regs->gp, regs->tp, regs->t0);
>> -	pr_cont(" t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
>> +	printk("t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
>>  		regs->t1, regs->t2, regs->s0);
>> -	pr_cont(" s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
>> +	printk("s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
>>  		regs->s1, regs->a0, regs->a1);
>> -	pr_cont(" a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
>> +	printk("a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
>>  		regs->a2, regs->a3, regs->a4);
>> -	pr_cont(" a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
>> +	printk("a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
>>  		regs->a5, regs->a6, regs->a7);
>> -	pr_cont(" s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
>> +	printk("s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
>>  		regs->s2, regs->s3, regs->s4);
>> -	pr_cont(" s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
>> +	printk("s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
>>  		regs->s5, regs->s6, regs->s7);
>> -	pr_cont(" s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
>> +	printk("s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
>>  		regs->s8, regs->s9, regs->s10);
>> -	pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
>> +	printk("s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
>>  		regs->s11, regs->t3, regs->t4);
>> -	pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
>> +	printk("t5 : " REG_FMT " t6 : " REG_FMT "\n",
>>  		regs->t5, regs->t6);
>>
>> -	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>> +	printk("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>>  		regs->status, regs->badaddr, regs->cause);
>>  }
>>  void show_regs(struct pt_regs *regs)
>
> For some reason I remember having these as printk()s originally, but I
> don't see that in the git history so maybe it was from before we
> merged the port?  I don't really understand the difference here, and I
> thought using printk() directly wasn't recommended?

There no difference between:

   pr_cont("...\n");
      and
   printk("...\n");

except for the very first call, which will try to continue from whatever
was printed before. (But even that only makes a difference if the
previous call did not have a newline at the end.)

Note that the printk() being used does not specify the loglevel. Perhaps
it is intentional that the default loglevel (which can be specified by
the user) is used? Otherwise, if a particular loglevel _is_ desired,
then the appropriate pr_info/pr_warn/... should be used.

Also, this patch is also sneaking in some formatting changes. Previously
the columns were not aligned correctly. That spacing is also fixed
here. The spacing change _is_ a real improvement.

John Ogness

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2] riscv: Using printk directly in __show_regs
  2020-12-11  8:48           ` John Ogness
@ 2020-12-14 11:49             ` Kefeng Wang
  0 siblings, 0 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-12-14 11:49 UTC (permalink / raw)
  To: John Ogness, Palmer Dabbelt; +Cc: linux-riscv, aou, Paul Walmsley


On 2020/12/11 16:48, John Ogness wrote:
> On 2020-12-10, Palmer Dabbelt <palmerdabbelt@google.com> wrote:
>> On Thu, 26 Nov 2020 05:33:38 PST (-0800), wangkefeng.wang@huawei.com wrote:
>>> Covert bulk of pr_cont("...\n") to separate printk calls.
>>>
>>> Note that a pr_cont() message with a trailing newline will
>>> "terminate" the continous line so that it can no longer be
>>> continued, also it is possible to sort out simultaneous dumps
>>> from multiple CPUs with CONFIG_PRINTK_CALLER enabled.
>>>
>>> And align the printing formats.
>>>
>>> Suggested-by: John Ogness <john.ogness@linutronix.de>
>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>> ---
>>>   arch/riscv/kernel/process.c | 24 ++++++++++++------------
>>>   1 file changed, 12 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
>>> index e41b733abeaa..2119d49feea5 100644
>>> --- a/arch/riscv/kernel/process.c
>>> +++ b/arch/riscv/kernel/process.c
>>> @@ -44,30 +44,30 @@ void __show_regs(struct pt_regs *regs)
>>>   {
>>>   	show_regs_print_info(KERN_DEFAULT);
>>>
>>> -	pr_cont("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
>>> +	printk("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
>>>   		regs->epc, regs->ra, regs->sp);
>>> -	pr_cont(" gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
>>> +	printk("gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
>>>   		regs->gp, regs->tp, regs->t0);
>>> -	pr_cont(" t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
>>> +	printk("t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
>>>   		regs->t1, regs->t2, regs->s0);
>>> -	pr_cont(" s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
>>> +	printk("s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
>>>   		regs->s1, regs->a0, regs->a1);
>>> -	pr_cont(" a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
>>> +	printk("a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
>>>   		regs->a2, regs->a3, regs->a4);
>>> -	pr_cont(" a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
>>> +	printk("a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
>>>   		regs->a5, regs->a6, regs->a7);
>>> -	pr_cont(" s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
>>> +	printk("s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
>>>   		regs->s2, regs->s3, regs->s4);
>>> -	pr_cont(" s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
>>> +	printk("s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
>>>   		regs->s5, regs->s6, regs->s7);
>>> -	pr_cont(" s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
>>> +	printk("s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
>>>   		regs->s8, regs->s9, regs->s10);
>>> -	pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
>>> +	printk("s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
>>>   		regs->s11, regs->t3, regs->t4);
>>> -	pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
>>> +	printk("t5 : " REG_FMT " t6 : " REG_FMT "\n",
>>>   		regs->t5, regs->t6);
>>>
>>> -	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>>> +	printk("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>>>   		regs->status, regs->badaddr, regs->cause);
>>>   }
>>>   void show_regs(struct pt_regs *regs)
>> For some reason I remember having these as printk()s originally, but I
>> don't see that in the git history so maybe it was from before we
>> merged the port?  I don't really understand the difference here, and I
>> thought using printk() directly wasn't recommended?

The original reason which I changed to printk is the strange out-print, 
see v1 patch [1],

but it's found that there is a regression in v5.10 printk rework, and 
being fixed by commit

4ad9921af4f1 ("printk: finalize records with trailing newlines").

The v2 patch major change is align the printing (not a big change) and 
in case of rearrangement of

print when CONFIG_PRINTK_CALLER enabled

[1] 
https://patchwork.kernel.org/project/linux-riscv/patch/20201124112054.106960-2-wangkefeng.wang@huawei.com/


> There no difference between:
>
>     pr_cont("...\n");
>        and
>     printk("...\n");
>
> except for the very first call, which will try to continue from whatever
> was printed before. (But even that only makes a difference if the
> previous call did not have a newline at the end.)
>
> Note that the printk() being used does not specify the loglevel. Perhaps
> it is intentional that the default loglevel (which can be specified by
> the user) is used? Otherwise, if a particular loglevel _is_ desired,
> then the appropriate pr_info/pr_warn/... should be used.
>
> Also, this patch is also sneaking in some formatting changes. Previously
> the columns were not aligned correctly. That spacing is also fixed
> here. The spacing change _is_ a real improvement.
>
> John Ogness
> .
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 1/2] riscv: Add dump stack in show_regs
  2020-11-24 11:20   ` [PATCH 1/2] riscv: Add dump stack in show_regs Kefeng Wang
  2020-11-24 11:20     ` [PATCH 2/2] riscv: Fix __show_regs printing formats Kefeng Wang
  2020-11-25 23:04     ` [PATCH 1/2] riscv: Add dump stack in show_regs Atish Patra
@ 2020-12-14 11:52     ` Kefeng Wang
  2021-01-09 22:24       ` Palmer Dabbelt
  2 siblings, 1 reply; 21+ messages in thread
From: Kefeng Wang @ 2020-12-14 11:52 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, Palmer Dabbelt

hi Palmer, kindly ping...

On 2020/11/24 19:20, Kefeng Wang wrote:
> Like commit 1149aad10b1e ("arm64: Add dump_backtrace() in show_regs"),
> dump the stack in riscv show_regs as common code expects.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> NOTE: The patches based on
> https://patchwork.kernel.org/project/linux-riscv/list/?series=383349
>
>   arch/riscv/include/asm/bug.h        |  1 +
>   arch/riscv/include/asm/stacktrace.h |  2 ++
>   arch/riscv/kernel/process.c         |  9 ++++++++-
>   arch/riscv/kernel/stacktrace.c      | 10 ++++++++--
>   arch/riscv/kernel/traps.c           |  3 ++-
>   5 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
> index d6f1ec08d97b..d3804a2f9aad 100644
> --- a/arch/riscv/include/asm/bug.h
> +++ b/arch/riscv/include/asm/bug.h
> @@ -85,6 +85,7 @@ do {								\
>   struct pt_regs;
>   struct task_struct;
>   
> +void __show_regs(struct pt_regs *regs);
>   void die(struct pt_regs *regs, const char *str);
>   void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr);
>   
> diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
> index 470a65c4ccdc..3450c1912afd 100644
> --- a/arch/riscv/include/asm/stacktrace.h
> +++ b/arch/riscv/include/asm/stacktrace.h
> @@ -13,5 +13,7 @@ struct stackframe {
>   
>   extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
>   				    bool (*fn)(void *, unsigned long), void *arg);
> +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
> +			   const char *loglvl);
>   
>   #endif /* _ASM_RISCV_STACKTRACE_H */
> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
> index 19225ec65db6..e41b733abeaa 100644
> --- a/arch/riscv/kernel/process.c
> +++ b/arch/riscv/kernel/process.c
> @@ -18,6 +18,7 @@
>   #include <asm/unistd.h>
>   #include <asm/processor.h>
>   #include <asm/csr.h>
> +#include <asm/stacktrace.h>
>   #include <asm/string.h>
>   #include <asm/switch_to.h>
>   #include <asm/thread_info.h>
> @@ -39,7 +40,7 @@ void arch_cpu_idle(void)
>   	local_irq_enable();
>   }
>   
> -void show_regs(struct pt_regs *regs)
> +void __show_regs(struct pt_regs *regs)
>   {
>   	show_regs_print_info(KERN_DEFAULT);
>   
> @@ -69,6 +70,12 @@ void show_regs(struct pt_regs *regs)
>   	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>   		regs->status, regs->badaddr, regs->cause);
>   }
> +void show_regs(struct pt_regs *regs)
> +{
> +	__show_regs(regs);
> +	if (!user_mode(regs))
> +		dump_backtrace(regs, NULL, KERN_DEFAULT);
> +}
>   
>   void start_thread(struct pt_regs *regs, unsigned long pc,
>   	unsigned long sp)
> diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
> index 48b870a685b3..76dadf6d396b 100644
> --- a/arch/riscv/kernel/stacktrace.c
> +++ b/arch/riscv/kernel/stacktrace.c
> @@ -101,10 +101,16 @@ static bool print_trace_address(void *arg, unsigned long pc)
>   	return true;
>   }
>   
> +void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
> +		    const char *loglvl)
> +{
> +	pr_cont("%sCall Trace:\n", loglvl);
> +	walk_stackframe(task, regs, print_trace_address, (void *)loglvl);
> +}
> +
>   void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
>   {
> -	pr_cont("Call Trace:\n");
> -	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
> +	dump_backtrace(NULL, task, loglvl);
>   }
>   
>   static bool save_wchan(void *arg, unsigned long pc)
> diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
> index ad14f4466d92..570eb078b1e1 100644
> --- a/arch/riscv/kernel/traps.c
> +++ b/arch/riscv/kernel/traps.c
> @@ -16,6 +16,7 @@
>   #include <linux/module.h>
>   #include <linux/irq.h>
>   
> +#include <asm/bug.h>
>   #include <asm/processor.h>
>   #include <asm/ptrace.h>
>   #include <asm/csr.h>
> @@ -66,7 +67,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr)
>   			tsk->comm, task_pid_nr(tsk), signo, code, addr);
>   		print_vma_addr(KERN_CONT " in ", instruction_pointer(regs));
>   		pr_cont("\n");
> -		show_regs(regs);
> +		__show_regs(regs);
>   	}
>   
>   	force_sig_fault(signo, code, (void __user *)addr);

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 0/3] riscv: cover to ARCH_STACKWALK
  2020-11-21  3:01 ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Palmer Dabbelt
  2020-11-24 11:20   ` [PATCH 1/2] riscv: Add dump stack in show_regs Kefeng Wang
@ 2020-12-17  2:34   ` Kefeng Wang
  1 sibling, 0 replies; 21+ messages in thread
From: Kefeng Wang @ 2020-12-17  2:34 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: linux-riscv, aou, Paul Walmsley


On 2020/11/21 11:01, Palmer Dabbelt wrote:
> On Thu, 12 Nov 2020 22:42:20 PST (-0800), wangkefeng.wang@huawei.com 
> wrote:
>> Use the newer common infrastructure and simpler arch_stack_walk() 
>> interface
>> for stack walk.
>>
>> Kefeng Wang (3):
>>   riscv: Cleanup stacktrace
>>   riscv: Make stack walk callback consistent with generic code
>>   riscv: Enable ARCH_STACKWALK
>>
>>  arch/riscv/Kconfig                  |  1 +
>>  arch/riscv/include/asm/stacktrace.h | 17 ++++++++
>>  arch/riscv/kernel/perf_callchain.c  | 10 +----
>>  arch/riscv/kernel/stacktrace.c      | 62 +++++++----------------------
>>  4 files changed, 34 insertions(+), 56 deletions(-)
>>  create mode 100644 arch/riscv/include/asm/stacktrace.h
>
> Thanks, these are on for-next.


hi Palmer,  I found a extra code about deleting "__INIT",  is there a 
mistaken when merged into for- next?

see link

https://kernel.googlesource.com/pub/scm/linux/kernel/git/riscv/linux/+/5cb0080f1bfdccb56d5c225d1cd648cdb33fa9bb%5E%21/#F1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 1/2] riscv: Add dump stack in show_regs
  2020-12-14 11:52     ` Kefeng Wang
@ 2021-01-09 22:24       ` Palmer Dabbelt
  2021-01-11  3:23         ` Kefeng Wang
  0 siblings, 1 reply; 21+ messages in thread
From: Palmer Dabbelt @ 2021-01-09 22:24 UTC (permalink / raw)
  To: wangkefeng.wang; +Cc: linux-riscv, aou, Paul Walmsley

On Mon, 14 Dec 2020 03:52:19 PST (-0800), wangkefeng.wang@huawei.com wrote:
> hi Palmer, kindly ping...

Sorry, it looks like I missed this because it's all threaded together.  I'm not
really sure what you're trying to do here: you've got three patch sets in one
thread, one of which seems to be a v2 of only a single patch.

Do you mind sending out a standalone version of this?

>
> On 2020/11/24 19:20, Kefeng Wang wrote:
>> Like commit 1149aad10b1e ("arm64: Add dump_backtrace() in show_regs"),
>> dump the stack in riscv show_regs as common code expects.
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> NOTE: The patches based on
>> https://patchwork.kernel.org/project/linux-riscv/list/?series=383349
>>
>>   arch/riscv/include/asm/bug.h        |  1 +
>>   arch/riscv/include/asm/stacktrace.h |  2 ++
>>   arch/riscv/kernel/process.c         |  9 ++++++++-
>>   arch/riscv/kernel/stacktrace.c      | 10 ++++++++--
>>   arch/riscv/kernel/traps.c           |  3 ++-
>>   5 files changed, 21 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
>> index d6f1ec08d97b..d3804a2f9aad 100644
>> --- a/arch/riscv/include/asm/bug.h
>> +++ b/arch/riscv/include/asm/bug.h
>> @@ -85,6 +85,7 @@ do {								\
>>   struct pt_regs;
>>   struct task_struct;
>>
>> +void __show_regs(struct pt_regs *regs);
>>   void die(struct pt_regs *regs, const char *str);
>>   void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr);
>>
>> diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
>> index 470a65c4ccdc..3450c1912afd 100644
>> --- a/arch/riscv/include/asm/stacktrace.h
>> +++ b/arch/riscv/include/asm/stacktrace.h
>> @@ -13,5 +13,7 @@ struct stackframe {
>>
>>   extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
>>   				    bool (*fn)(void *, unsigned long), void *arg);
>> +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
>> +			   const char *loglvl);
>>
>>   #endif /* _ASM_RISCV_STACKTRACE_H */
>> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
>> index 19225ec65db6..e41b733abeaa 100644
>> --- a/arch/riscv/kernel/process.c
>> +++ b/arch/riscv/kernel/process.c
>> @@ -18,6 +18,7 @@
>>   #include <asm/unistd.h>
>>   #include <asm/processor.h>
>>   #include <asm/csr.h>
>> +#include <asm/stacktrace.h>
>>   #include <asm/string.h>
>>   #include <asm/switch_to.h>
>>   #include <asm/thread_info.h>
>> @@ -39,7 +40,7 @@ void arch_cpu_idle(void)
>>   	local_irq_enable();
>>   }
>>
>> -void show_regs(struct pt_regs *regs)
>> +void __show_regs(struct pt_regs *regs)
>>   {
>>   	show_regs_print_info(KERN_DEFAULT);
>>
>> @@ -69,6 +70,12 @@ void show_regs(struct pt_regs *regs)
>>   	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
>>   		regs->status, regs->badaddr, regs->cause);
>>   }
>> +void show_regs(struct pt_regs *regs)
>> +{
>> +	__show_regs(regs);
>> +	if (!user_mode(regs))
>> +		dump_backtrace(regs, NULL, KERN_DEFAULT);
>> +}
>>
>>   void start_thread(struct pt_regs *regs, unsigned long pc,
>>   	unsigned long sp)
>> diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
>> index 48b870a685b3..76dadf6d396b 100644
>> --- a/arch/riscv/kernel/stacktrace.c
>> +++ b/arch/riscv/kernel/stacktrace.c
>> @@ -101,10 +101,16 @@ static bool print_trace_address(void *arg, unsigned long pc)
>>   	return true;
>>   }
>>
>> +void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
>> +		    const char *loglvl)
>> +{
>> +	pr_cont("%sCall Trace:\n", loglvl);
>> +	walk_stackframe(task, regs, print_trace_address, (void *)loglvl);
>> +}
>> +
>>   void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
>>   {
>> -	pr_cont("Call Trace:\n");
>> -	walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
>> +	dump_backtrace(NULL, task, loglvl);
>>   }
>>
>>   static bool save_wchan(void *arg, unsigned long pc)
>> diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
>> index ad14f4466d92..570eb078b1e1 100644
>> --- a/arch/riscv/kernel/traps.c
>> +++ b/arch/riscv/kernel/traps.c
>> @@ -16,6 +16,7 @@
>>   #include <linux/module.h>
>>   #include <linux/irq.h>
>>
>> +#include <asm/bug.h>
>>   #include <asm/processor.h>
>>   #include <asm/ptrace.h>
>>   #include <asm/csr.h>
>> @@ -66,7 +67,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr)
>>   			tsk->comm, task_pid_nr(tsk), signo, code, addr);
>>   		print_vma_addr(KERN_CONT " in ", instruction_pointer(regs));
>>   		pr_cont("\n");
>> -		show_regs(regs);
>> +		__show_regs(regs);
>>   	}
>>
>>   	force_sig_fault(signo, code, (void __user *)addr);

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 1/2] riscv: Add dump stack in show_regs
  2021-01-09 22:24       ` Palmer Dabbelt
@ 2021-01-11  3:23         ` Kefeng Wang
  0 siblings, 0 replies; 21+ messages in thread
From: Kefeng Wang @ 2021-01-11  3:23 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: linux-riscv, aou, Paul Walmsley


On 2021/1/10 6:24, Palmer Dabbelt wrote:
> On Mon, 14 Dec 2020 03:52:19 PST (-0800), wangkefeng.wang@huawei.com 
> wrote:
>> hi Palmer, kindly ping...
>
> Sorry, it looks like I missed this because it's all threaded 
> together.  I'm not
> really sure what you're trying to do here: you've got three patch sets 
> in one
> thread, one of which seems to be a v2 of only a single patch.
> Do you mind sending out a standalone version of this?

Sure, I will rebase on the top of 5.11-rc3 and resend them.



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2021-01-11  3:24 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  6:42 [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
2020-11-13  6:42 ` [PATCH 1/3] riscv: Cleanup stacktrace Kefeng Wang
2020-11-13  6:42 ` [PATCH 2/3] riscv: Make stack walk callback consistent with generic code Kefeng Wang
2020-11-13  6:42 ` [PATCH 3/3] riscv: Enable ARCH_STACKWALK Kefeng Wang
2020-11-21  3:01 ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Palmer Dabbelt
2020-11-24 11:20   ` [PATCH 1/2] riscv: Add dump stack in show_regs Kefeng Wang
2020-11-24 11:20     ` [PATCH 2/2] riscv: Fix __show_regs printing formats Kefeng Wang
2020-11-25 22:58       ` Atish Patra
2020-11-26  1:10         ` Kefeng Wang
2020-11-26 10:02           ` John Ogness
2020-11-26 11:55             ` John Ogness
2020-11-26 12:49               ` Kefeng Wang
2020-11-26 13:33       ` [PATCH v2] riscv: Using printk directly in __show_regs Kefeng Wang
2020-12-11  1:43         ` Palmer Dabbelt
2020-12-11  8:48           ` John Ogness
2020-12-14 11:49             ` Kefeng Wang
2020-11-25 23:04     ` [PATCH 1/2] riscv: Add dump stack in show_regs Atish Patra
2020-12-14 11:52     ` Kefeng Wang
2021-01-09 22:24       ` Palmer Dabbelt
2021-01-11  3:23         ` Kefeng Wang
2020-12-17  2:34   ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.