linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
@ 2019-03-27 13:17 qiaochong
  2019-03-27 14:37 ` Doug Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: qiaochong @ 2019-03-27 13:17 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Daniel Thompson,
	Douglas Anderson, Will Deacon, Christophe Leroy
  Cc: linux-mips, linux-kernel, QiaoChong

KGDB_call_nmi_hook is called by other cpu through smp call.
MIPS smp call is processed in ipi irq handler and regs is saved in
 handle_int.
So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
 to kgdb_cpu_enter.

Signed-off-by: qiaochong <qiaochong@loongson.cn>
---
 arch/mips/kernel/kgdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
index 6e574c02e4c3b..6c438a0fd2075 100644
--- a/arch/mips/kernel/kgdb.c
+++ b/arch/mips/kernel/kgdb.c
@@ -214,7 +214,7 @@ void kgdb_call_nmi_hook(void *ignored)
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
 
-	kgdb_nmicallback(raw_smp_processor_id(), NULL);
+	kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
 
 	set_fs(old_fs);
 }
-- 
2.17.0



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

* Re: [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
  2019-03-27 13:17 [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms qiaochong
@ 2019-03-27 14:37 ` Doug Anderson
  0 siblings, 0 replies; 9+ messages in thread
From: Doug Anderson @ 2019-03-27 14:37 UTC (permalink / raw)
  To: qiaochong
  Cc: Ralf Baechle, Paul Burton, James Hogan, Daniel Thompson,
	Will Deacon, Christophe Leroy, linux-mips, LKML, kgdb-bugreport

Hi,

On Wed, Mar 27, 2019 at 6:17 AM qiaochong <qiaochong@loongson.cn> wrote:
>
> KGDB_call_nmi_hook is called by other cpu through smp call.
> MIPS smp call is processed in ipi irq handler and regs is saved in
>  handle_int.
> So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
>  to kgdb_cpu_enter.
>
> Signed-off-by: qiaochong <qiaochong@loongson.cn>
> ---
>  arch/mips/kernel/kgdb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
> index 6e574c02e4c3b..6c438a0fd2075 100644
> --- a/arch/mips/kernel/kgdb.c
> +++ b/arch/mips/kernel/kgdb.c
> @@ -214,7 +214,7 @@ void kgdb_call_nmi_hook(void *ignored)
>         old_fs = get_fs();
>         set_fs(KERNEL_DS);
>
> -       kgdb_nmicallback(raw_smp_processor_id(), NULL);
> +       kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
>
>         set_fs(old_fs);
>  }

I'm excited to see others using kgdb!  :-)

As far as I can tell your patch is good, or at least as seems like it
will make MIPS on par with other platforms.  I always wondered why
MIPS (and ARC) didn't have the get_irq_regs() call but when I last
touched this code I left it alone since I didn't have the history for
it and had no way to test.  Since it seems like you have a way to test
this then we should do it.  Now to find someone who would do the same
for ARC.  :-P  Thus:

Reviewed-by: Douglas Anderson <dianders@chromium.org>

NOTE as pointed out in code reviews when I last touched this code,
using get_irq_regs() isn't perfect since it could plausibly return
NULL.  I created a bug in the Chromium tracker with all the details
for this at <https://crbug.com/908723>.

-Doug

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

* Re: [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
  2019-03-27 23:08 Chong Qiao
  2019-03-27 23:15 ` Doug Anderson
  2019-03-28  7:06 ` Daniel Thompson
@ 2019-03-28 18:36 ` Paul Burton
  2 siblings, 0 replies; 9+ messages in thread
From: Paul Burton @ 2019-03-28 18:36 UTC (permalink / raw)
  To: Chong Qiao
  Cc: Ralf Baechle, Paul Burton, James Hogan, Daniel Thompson,
	Douglas Anderson, Will Deacon, Christophe Leroy, linux-mips,
	linux-kernel, QiaoChong, linux-mips

Hello,

Chong Qiao wrote:
> KGDB_call_nmi_hook is called by other cpu through smp call.
> MIPS smp call is processed in ipi irq handler and regs is saved in
> handle_int.
> So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
> to kgdb_cpu_enter.
> 
> Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>

Applied to mips-fixes.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

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

* Re: [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
  2019-03-27 23:08 Chong Qiao
  2019-03-27 23:15 ` Doug Anderson
@ 2019-03-28  7:06 ` Daniel Thompson
  2019-03-28 18:36 ` Paul Burton
  2 siblings, 0 replies; 9+ messages in thread
From: Daniel Thompson @ 2019-03-28  7:06 UTC (permalink / raw)
  To: Chong Qiao
  Cc: Ralf Baechle, Paul Burton, James Hogan, Douglas Anderson,
	Will Deacon, Christophe Leroy, linux-mips, linux-kernel

On Thu, Mar 28, 2019 at 07:08:01AM +0800, Chong Qiao wrote:
> KGDB_call_nmi_hook is called by other cpu through smp call.
> MIPS smp call is processed in ipi irq handler and regs is saved in
>  handle_int.
> So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
>  to kgdb_cpu_enter.
> 
> Signed-off-by: Chong Qiao <qiaochong@loongson.cn>

Acked-by: Daniel Thompson <daniel.thompson@linaro.org>


> ---
>  arch/mips/kernel/kgdb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
> index 6e574c02e4c3b..ea781b29f7f17 100644
> --- a/arch/mips/kernel/kgdb.c
> +++ b/arch/mips/kernel/kgdb.c
> @@ -33,6 +33,7 @@
>  #include <asm/processor.h>
>  #include <asm/sigcontext.h>
>  #include <linux/uaccess.h>
> +#include <asm/irq_regs.h>
>  
>  static struct hard_trap_info {
>  	unsigned char tt;	/* Trap type code for MIPS R3xxx and R4xxx */
> @@ -214,7 +215,7 @@ void kgdb_call_nmi_hook(void *ignored)
>  	old_fs = get_fs();
>  	set_fs(KERNEL_DS);
>  
> -	kgdb_nmicallback(raw_smp_processor_id(), NULL);
> +	kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
>  
>  	set_fs(old_fs);
>  }
> -- 
> 2.17.0
> 
> 

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

* Re: [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
  2019-03-27 22:27     ` Doug Anderson
@ 2019-03-28  7:03       ` Daniel Thompson
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Thompson @ 2019-03-28  7:03 UTC (permalink / raw)
  To: Doug Anderson
  Cc: qiaochong, Ralf Baechle, Paul Burton, James Hogan, Will Deacon,
	Christophe Leroy, linux-mips, LKML

On Wed, Mar 27, 2019 at 03:27:26PM -0700, Doug Anderson wrote:
> Hi,
> 
> On Wed, Mar 27, 2019 at 3:25 PM qiaochong <qiaochong@loongson.cn> wrote:
> >
> >
> > My name  is QiaoChong, which is same to my username.
> > Qiao is my family name.
> > Thanks a lot.
> 
> I guess it will be up to whichever maintainer lands this (maybe
> Daniel?)

TBH this is mips specific so I'd expect this to get picked up by the
mips arch maintainers. I'll send in an ack in a moment though.


Daniel.


> on whether they want you to spin it.  I think folks expect to
> see a real name that is capitalized and usually a space between the
> family name and the given name.
> 
> -Doug

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

* Re: [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
  2019-03-27 23:08 Chong Qiao
@ 2019-03-27 23:15 ` Doug Anderson
  2019-03-28  7:06 ` Daniel Thompson
  2019-03-28 18:36 ` Paul Burton
  2 siblings, 0 replies; 9+ messages in thread
From: Doug Anderson @ 2019-03-27 23:15 UTC (permalink / raw)
  To: Chong Qiao
  Cc: Ralf Baechle, Paul Burton, James Hogan, Daniel Thompson,
	Will Deacon, Christophe Leroy, linux-mips, LKML

Hi,

On Wed, Mar 27, 2019 at 4:08 PM Chong Qiao <qiaochong@loongson.cn> wrote:
>
> KGDB_call_nmi_hook is called by other cpu through smp call.
> MIPS smp call is processed in ipi irq handler and regs is saved in
>  handle_int.
> So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
>  to kgdb_cpu_enter.
>
> Signed-off-by: Chong Qiao <qiaochong@loongson.cn>

Since you didn't really change any content, you could have just
carried my previous review.  In any case I'll add my tag again:

Reviewed-by: Douglas Anderson <dianders@chromium.org>

I'd also note that it's nice if you version your patches and include
version history.  If you need help you might consider using patman to
help you send upstream patches.  See:

http://git.denx.de/?p=u-boot.git;a=blob;f=tools/patman/README

...never mind that it lives in the U-Boot tree--it's great for kernel work too.

Thanks for contributing to the kernel!  :-)

-Doug

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

* [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
@ 2019-03-27 23:08 Chong Qiao
  2019-03-27 23:15 ` Doug Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Chong Qiao @ 2019-03-27 23:08 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Daniel Thompson,
	Douglas Anderson, Will Deacon, Christophe Leroy
  Cc: linux-mips, linux-kernel, QiaoChong

KGDB_call_nmi_hook is called by other cpu through smp call.
MIPS smp call is processed in ipi irq handler and regs is saved in
 handle_int.
So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
 to kgdb_cpu_enter.

Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
---
 arch/mips/kernel/kgdb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
index 6e574c02e4c3b..ea781b29f7f17 100644
--- a/arch/mips/kernel/kgdb.c
+++ b/arch/mips/kernel/kgdb.c
@@ -33,6 +33,7 @@
 #include <asm/processor.h>
 #include <asm/sigcontext.h>
 #include <linux/uaccess.h>
+#include <asm/irq_regs.h>
 
 static struct hard_trap_info {
 	unsigned char tt;	/* Trap type code for MIPS R3xxx and R4xxx */
@@ -214,7 +215,7 @@ void kgdb_call_nmi_hook(void *ignored)
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
 
-	kgdb_nmicallback(raw_smp_processor_id(), NULL);
+	kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
 
 	set_fs(old_fs);
 }
-- 
2.17.0



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

* Re: [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
  2019-03-27 15:05 qiaochong
@ 2019-03-27 16:25 ` Doug Anderson
  2019-03-27 22:25   ` qiaochong
  0 siblings, 1 reply; 9+ messages in thread
From: Doug Anderson @ 2019-03-27 16:25 UTC (permalink / raw)
  To: qiaochong
  Cc: Ralf Baechle, Paul Burton, James Hogan, Daniel Thompson,
	Will Deacon, Christophe Leroy, linux-mips, LKML

Hi,

On Wed, Mar 27, 2019 at 8:06 AM qiaochong <qiaochong@loongson.cn> wrote:
>
> KGDB_call_nmi_hook is called by other cpu through smp call.
> MIPS smp call is processed in ipi irq handler and regs is saved in
>  handle_int.
> So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
>  to kgdb_cpu_enter.
>
> Signed-off-by: qiaochong <qiaochong@loongson.cn>

Note that you might want to adjust your git settings.  Usually in the
kernel they require that a Signed-off-by have your real name, not just
your username.  You probably need to spin your patch to fix this.  You
should make sure that the authorship of the patch also has your real
name.


> ---
>  arch/mips/kernel/kgdb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
> index 6e574c02e4c3b..ea781b29f7f17 100644
> --- a/arch/mips/kernel/kgdb.c
> +++ b/arch/mips/kernel/kgdb.c
> @@ -33,6 +33,7 @@
>  #include <asm/processor.h>
>  #include <asm/sigcontext.h>
>  #include <linux/uaccess.h>
> +#include <asm/irq_regs.h>
>
>  static struct hard_trap_info {
>         unsigned char tt;       /* Trap type code for MIPS R3xxx and R4xxx */
> @@ -214,7 +215,7 @@ void kgdb_call_nmi_hook(void *ignored)
>         old_fs = get_fs();
>         set_fs(KERNEL_DS);
>
> -       kgdb_nmicallback(raw_smp_processor_id(), NULL);
> +       kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
>
>         set_fs(old_fs);
>  }

As per my reply on V1, feel free to add:

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

* [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms.
@ 2019-03-27 15:05 qiaochong
  2019-03-27 16:25 ` Doug Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: qiaochong @ 2019-03-27 15:05 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Daniel Thompson,
	Douglas Anderson, Will Deacon, Christophe Leroy
  Cc: linux-mips, linux-kernel, QiaoChong

KGDB_call_nmi_hook is called by other cpu through smp call.
MIPS smp call is processed in ipi irq handler and regs is saved in
 handle_int.
So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
 to kgdb_cpu_enter.

Signed-off-by: qiaochong <qiaochong@loongson.cn>
---
 arch/mips/kernel/kgdb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
index 6e574c02e4c3b..ea781b29f7f17 100644
--- a/arch/mips/kernel/kgdb.c
+++ b/arch/mips/kernel/kgdb.c
@@ -33,6 +33,7 @@
 #include <asm/processor.h>
 #include <asm/sigcontext.h>
 #include <linux/uaccess.h>
+#include <asm/irq_regs.h>
 
 static struct hard_trap_info {
 	unsigned char tt;	/* Trap type code for MIPS R3xxx and R4xxx */
@@ -214,7 +215,7 @@ void kgdb_call_nmi_hook(void *ignored)
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
 
-	kgdb_nmicallback(raw_smp_processor_id(), NULL);
+	kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
 
 	set_fs(old_fs);
 }
-- 
2.17.0



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

end of thread, other threads:[~2019-03-28 18:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-27 13:17 [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms qiaochong
2019-03-27 14:37 ` Doug Anderson
2019-03-27 15:05 qiaochong
2019-03-27 16:25 ` Doug Anderson
2019-03-27 22:25   ` qiaochong
2019-03-27 22:27     ` Doug Anderson
2019-03-28  7:03       ` Daniel Thompson
2019-03-27 23:08 Chong Qiao
2019-03-27 23:15 ` Doug Anderson
2019-03-28  7:06 ` Daniel Thompson
2019-03-28 18:36 ` Paul Burton

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).