Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5415303img; Wed, 27 Mar 2019 08:08:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLSuar4FdHEcF/Qm+78I4GduaY6EPwYUIX+oo/VwrmPft0MVXseu+7/oYqlZW9bDI+Q8fs X-Received: by 2002:a65:4343:: with SMTP id k3mr16210686pgq.384.1553699280982; Wed, 27 Mar 2019 08:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553699280; cv=none; d=google.com; s=arc-20160816; b=hR9pVOnh9LY3r7XLbm45gcQEbTv71mMc3eaBWKPUb5mxs9ez6eDklIlEbXuqtVHmYS xiQrmx3ZgSNJMuq798MZOnZ3lKRGEa45WWIRHnolLDcl1tVLmgDIgilp7EdLbRL5jgbg 73CKxUGzESR1wAIaNBaaB4Jl91inHVHwIeLzA3/UodQ0TBEudbmQ88DSdcpTGSBBchIP m9+s71Ptfa46CyJgGUKsMA1zXyWqbIlSrvVB0IxNv/irrGU77TsctvvI8yHLOU2Jeo9t 0gJ2Yz3Ii269CqAiWpB49jJeIGwqfbAwaZLkCs0RlSVIIK7s1i4Mj3Bi7MpDe8SF2Sun znng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Qru0yit33Go1lUpzjZA3S5mb/yGZV4f+l2lu1Q1i1O8=; b=T1TMi9Gko1BIFl8TF15F+9h/Z71DTSlMgrEBQVvu/81MK34yt8soTY/0v1LdlUn/CN z4+6O7HHwnNpu3vF5GhqnkxmMXUyA8MQ8MO4lXlR68GaAvSNXseSgbvEL3tOo+wp/2tN 1WtSGdZ2rsjG/jcfpoTOJpdq5M/LWznCn8dgW50AuJ1gfF6CWHc6SJ9sXIyqugU7lbrE sczRT7DLHl3ay5ySqzKMAC6nQe2T4mpnwBJRlieTHtJqVSRGqc+VBQYY2hMxhriczY0w HGc8znIYXN/RofS23wTjol9mLabW/S/6LkClzGRNtDxatY51qEBIvsr0jOexRCEonsQb nNjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si18530545pgc.365.2019.03.27.08.07.45; Wed, 27 Mar 2019 08:08:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729333AbfC0PGY (ORCPT + 99 others); Wed, 27 Mar 2019 11:06:24 -0400 Received: from mail.loongson.cn ([114.242.206.163]:44904 "EHLO mail.loongson.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725764AbfC0PGX (ORCPT ); Wed, 27 Mar 2019 11:06:23 -0400 Received: from localhost.localdomain (unknown [10.50.122.29]) by mail (Coremail) with SMTP id QMiowPDxqb5RkZtcWTG0AA--.23195S2; Wed, 27 Mar 2019 23:06:07 +0800 (CST) From: qiaochong To: Ralf Baechle , Paul Burton , James Hogan , Daniel Thompson , Douglas Anderson , Will Deacon , Christophe Leroy Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, QiaoChong Subject: [PATCH] MIPS: KGDB: fix kgdb support for SMP platforms. Date: Wed, 27 Mar 2019 23:05:51 +0800 Message-Id: <20190327150551.12851-1-qiaochong@loongson.cn> X-Mailer: git-send-email 2.17.0 X-CM-TRANSID: QMiowPDxqb5RkZtcWTG0AA--.23195S2 X-Coremail-Antispam: 1UD129KBjvdXoW7GF4rXF1UZrWrXFW7tw15CFg_yo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orr0wxvrqhubq/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include +#include 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