diff mbox series

MIPS: KGDB: fix kgdb support for SMP platforms.

Message ID 20190327230801.3650-1-qiaochong@loongson.cn (mailing list archive)
State Mainlined
Commit ab8a6d821179ab9bea1a9179f535ccba6330c1ed
Headers show
Series MIPS: KGDB: fix kgdb support for SMP platforms. | expand

Commit Message

qiaochong March 27, 2019, 11:08 p.m. UTC
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(-)

Comments

Doug Anderson March 27, 2019, 11:15 p.m. UTC | #1
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
Daniel Thompson March 28, 2019, 7:06 a.m. UTC | #2
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
> 
>
Paul Burton March 28, 2019, 6:36 p.m. UTC | #3
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. ]
diff mbox series

Patch

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);
 }