All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Remove the deprecated ABI implementation
@ 2018-08-20  2:15 Zong Li
  2018-08-20  2:15 ` [PATCH 1/2] nds32: " Zong Li
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zong Li @ 2018-08-20  2:15 UTC (permalink / raw)
  To: green.hu, linux-kernel; +Cc: zongbox, greentime, Zong Li

This patches remove the implementation of NDS32_ABI_2 and
replace the magic number of offset of lp on stack.

In stacktrace.c, we dump the stack without considering the old
ABI, it should be consistent in traps.c.

Zong Li (2):
  nds32: Remove the deprecated ABI implementation
  nds32: Add macro definition for offset of lp register on stack

 arch/nds32/include/asm/nds32.h | 1 +
 arch/nds32/kernel/stacktrace.c | 2 +-
 arch/nds32/kernel/traps.c      | 7 +------
 3 files changed, 3 insertions(+), 7 deletions(-)

-- 
2.7.4


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

* [PATCH 1/2] nds32: Remove the deprecated ABI implementation
  2018-08-20  2:15 [PATCH 0/2] Remove the deprecated ABI implementation Zong Li
@ 2018-08-20  2:15 ` Zong Li
  2018-08-20  2:15 ` [PATCH 2/2] nds32: Add macro definition for offset of lp register on stack Zong Li
  2018-08-21  7:02 ` [PATCH 0/2] Remove the deprecated ABI implementation Greentime Hu
  2 siblings, 0 replies; 4+ messages in thread
From: Zong Li @ 2018-08-20  2:15 UTC (permalink / raw)
  To: green.hu, linux-kernel; +Cc: zongbox, greentime, Zong Li

We are not using NDS32 ABI 2 for now, just remove the preprocessor
directives __NDS32_ABI_2.

Signed-off-by: Zong Li <zong@andestech.com>
---
 arch/nds32/kernel/traps.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c
index 7684c8f..f432310 100644
--- a/arch/nds32/kernel/traps.c
+++ b/arch/nds32/kernel/traps.c
@@ -117,13 +117,8 @@ static void __dump(struct task_struct *tsk, unsigned long *base_reg)
 		       !((unsigned long)base_reg & 0x3) &&
 		       ((unsigned long)base_reg >= TASK_SIZE)) {
 			unsigned long next_fp;
-#if !defined(__NDS32_ABI_2)
-			ret_addr = base_reg[0];
-			next_fp = base_reg[1];
-#else
 			ret_addr = base_reg[-1];
 			next_fp = base_reg[FP_OFFSET];
-#endif
 			if (__kernel_text_address(ret_addr)) {
 
 				ret_addr = ftrace_graph_ret_addr(
-- 
2.7.4


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

* [PATCH 2/2] nds32: Add macro definition for offset of lp register on stack
  2018-08-20  2:15 [PATCH 0/2] Remove the deprecated ABI implementation Zong Li
  2018-08-20  2:15 ` [PATCH 1/2] nds32: " Zong Li
@ 2018-08-20  2:15 ` Zong Li
  2018-08-21  7:02 ` [PATCH 0/2] Remove the deprecated ABI implementation Greentime Hu
  2 siblings, 0 replies; 4+ messages in thread
From: Zong Li @ 2018-08-20  2:15 UTC (permalink / raw)
  To: green.hu, linux-kernel; +Cc: zongbox, greentime, Zong Li

Use macro to replace the magic number.

Signed-off-by: Zong Li <zong@andestech.com>
---
 arch/nds32/include/asm/nds32.h | 1 +
 arch/nds32/kernel/stacktrace.c | 2 +-
 arch/nds32/kernel/traps.c      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/nds32/include/asm/nds32.h b/arch/nds32/include/asm/nds32.h
index 19b1939..68c3815 100644
--- a/arch/nds32/include/asm/nds32.h
+++ b/arch/nds32/include/asm/nds32.h
@@ -17,6 +17,7 @@
 #else
 #define FP_OFFSET (-2)
 #endif
+#define LP_OFFSET (-1)
 
 extern void __init early_trap_init(void);
 static inline void GIE_ENABLE(void)
diff --git a/arch/nds32/kernel/stacktrace.c b/arch/nds32/kernel/stacktrace.c
index 36bc870..d974c0c 100644
--- a/arch/nds32/kernel/stacktrace.c
+++ b/arch/nds32/kernel/stacktrace.c
@@ -31,7 +31,7 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
 	       && (fpn >= (unsigned long *)TASK_SIZE)) {
 		unsigned long lpp, fpp;
 
-		lpp = fpn[-1];
+		lpp = fpn[LP_OFFSET];
 		fpp = fpn[FP_OFFSET];
 		if (!__kernel_text_address(lpp))
 			break;
diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c
index f432310..b0b85b7 100644
--- a/arch/nds32/kernel/traps.c
+++ b/arch/nds32/kernel/traps.c
@@ -117,7 +117,7 @@ static void __dump(struct task_struct *tsk, unsigned long *base_reg)
 		       !((unsigned long)base_reg & 0x3) &&
 		       ((unsigned long)base_reg >= TASK_SIZE)) {
 			unsigned long next_fp;
-			ret_addr = base_reg[-1];
+			ret_addr = base_reg[LP_OFFSET];
 			next_fp = base_reg[FP_OFFSET];
 			if (__kernel_text_address(ret_addr)) {
 
-- 
2.7.4


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

* Re: [PATCH 0/2] Remove the deprecated ABI implementation
  2018-08-20  2:15 [PATCH 0/2] Remove the deprecated ABI implementation Zong Li
  2018-08-20  2:15 ` [PATCH 1/2] nds32: " Zong Li
  2018-08-20  2:15 ` [PATCH 2/2] nds32: Add macro definition for offset of lp register on stack Zong Li
@ 2018-08-21  7:02 ` Greentime Hu
  2 siblings, 0 replies; 4+ messages in thread
From: Greentime Hu @ 2018-08-21  7:02 UTC (permalink / raw)
  To: Zong Li; +Cc: Linux Kernel Mailing List, Zong Li, Greentime

Zong Li <zong@andestech.com> 於 2018年8月20日 週一 上午10:15寫道:
>
> This patches remove the implementation of NDS32_ABI_2 and
> replace the magic number of offset of lp on stack.
>
> In stacktrace.c, we dump the stack without considering the old
> ABI, it should be consistent in traps.c.
>
> Zong Li (2):
>   nds32: Remove the deprecated ABI implementation
>   nds32: Add macro definition for offset of lp register on stack
>
>  arch/nds32/include/asm/nds32.h | 1 +
>  arch/nds32/kernel/stacktrace.c | 2 +-
>  arch/nds32/kernel/traps.c      | 7 +------
>  3 files changed, 3 insertions(+), 7 deletions(-)

Acked-by: Greentime Hu <greentime@andestech.com>

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

end of thread, other threads:[~2018-08-21  7:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-20  2:15 [PATCH 0/2] Remove the deprecated ABI implementation Zong Li
2018-08-20  2:15 ` [PATCH 1/2] nds32: " Zong Li
2018-08-20  2:15 ` [PATCH 2/2] nds32: Add macro definition for offset of lp register on stack Zong Li
2018-08-21  7:02 ` [PATCH 0/2] Remove the deprecated ABI implementation Greentime Hu

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.