]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.15/mips-kgdb-fix-kgdb-support-for-smp-platforms.patch
Linux 4.19.42
[thirdparty/kernel/stable-queue.git] / releases / 5.0.15 / mips-kgdb-fix-kgdb-support-for-smp-platforms.patch
1 From aff39bcb7b93a2fc3db9dda7e641683b8a1ff33a Mon Sep 17 00:00:00 2001
2 From: Chong Qiao <qiaochong@loongson.cn>
3 Date: Thu, 28 Mar 2019 07:08:01 +0800
4 Subject: MIPS: KGDB: fix kgdb support for SMP platforms.
5
6 [ Upstream commit ab8a6d821179ab9bea1a9179f535ccba6330c1ed ]
7
8 KGDB_call_nmi_hook is called by other cpu through smp call.
9 MIPS smp call is processed in ipi irq handler and regs is saved in
10 handle_int.
11 So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
12 to kgdb_cpu_enter.
13
14 Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
15 Reviewed-by: Douglas Anderson <dianders@chromium.org>
16 Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
17 Signed-off-by: Paul Burton <paul.burton@mips.com>
18 Cc: Ralf Baechle <ralf@linux-mips.org>
19 Cc: James Hogan <jhogan@kernel.org>
20 Cc: Will Deacon <will.deacon@arm.com>
21 Cc: Christophe Leroy <christophe.leroy@c-s.fr>
22 Cc: linux-mips@vger.kernel.org
23 Cc: linux-kernel@vger.kernel.org
24 Cc: QiaoChong <qiaochong@loongson.cn>
25 Signed-off-by: Sasha Levin <sashal@kernel.org>
26 ---
27 arch/mips/kernel/kgdb.c | 3 ++-
28 1 file changed, 2 insertions(+), 1 deletion(-)
29
30 diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
31 index 149100e1bc7c4..90f37626100fe 100644
32 --- a/arch/mips/kernel/kgdb.c
33 +++ b/arch/mips/kernel/kgdb.c
34 @@ -33,6 +33,7 @@
35 #include <asm/processor.h>
36 #include <asm/sigcontext.h>
37 #include <linux/uaccess.h>
38 +#include <asm/irq_regs.h>
39
40 static struct hard_trap_info {
41 unsigned char tt; /* Trap type code for MIPS R3xxx and R4xxx */
42 @@ -214,7 +215,7 @@ void kgdb_call_nmi_hook(void *ignored)
43 old_fs = get_fs();
44 set_fs(get_ds());
45
46 - kgdb_nmicallback(raw_smp_processor_id(), NULL);
47 + kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
48
49 set_fs(old_fs);
50 }
51 --
52 2.20.1
53