Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp28513img; Wed, 27 Mar 2019 16:09:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWrSDBeo4R2gotFVbxlqA0INHLLyYmx9zpy3nDoiWJHFXWrUz74eXuuoDdyoTYHl6b47Vv X-Received: by 2002:a63:c54a:: with SMTP id g10mr15016329pgd.71.1553728180159; Wed, 27 Mar 2019 16:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553728180; cv=none; d=google.com; s=arc-20160816; b=oiTDuOSC0eRG32fTG8nLLDF5qvpG6nIdMCPoqNcdeckhtOokmy6WMAqZw1QlvSqByB cSnXbBQldm9Ru1Gdkw/64g1Lq4xmNCrWEN/T6IpaG7kyxyt9os36o0h/mdQEzDIeBtYz DYrcjuwt1+Zd2tpaGw1IYK3ByyCCvqhS4WBXMYI3nKJBs0KEI79l2nOM4ubszLwxEmhW jDKegaN+PDG6Bl41Vc5ZTlp6AMWaUAWFwvg9f6bROvNDytmQL/559WLrjLnW4gRpA8Zz QlsVCwq85e3smVIwKS9R/ii751qCmpHX2ok7wDn/5ef7GfUrPV0eQjAT3cA4qaXkN4Ku zZow== 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=qmWoAyaNH8VB6ysEjKTH00B+3goL1fXYX7B/HFBhyms=; b=v3dBvGiZX+FfuLQDyzej2gNIgd4bQ3O64q3UiYh0C2/QqToeVUAzrXc6WU1iAoHbIw Xd2O9uslVWlxd+auCacYXST+ezwAbw3wBnvXMum/NfSYgW1YNDysz6pPdgJALXNWWH8A cHgnPckdJSQimsMNTI1A0H1ZIbnX0OKeIkN+r/+jEluY0PEyWt10qCohULR2SyPoU+GI AO4jDDtMMukoM/OfH2AnnFd8CQIx2JtvfUE+hYxW/JRiCg8KL39u+OcNWOhSE4IXOeUk nOXNARgEXm5Ej9JiStfjI4m34PmnBM4Xu5QywbMCFg1yBDt40OUK9ZF4usz2UYYI8rG2 IzQw== 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 a90si21209730pla.401.2019.03.27.16.09.21; Wed, 27 Mar 2019 16:09:40 -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 S1728276AbfC0XI1 (ORCPT + 99 others); Wed, 27 Mar 2019 19:08:27 -0400 Received: from mail.loongson.cn ([114.242.206.163]:49940 "EHLO mail.loongson.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbfC0XI1 (ORCPT ); Wed, 27 Mar 2019 19:08:27 -0400 Received: from localhost.localdomain (unknown [10.50.122.29]) by mail (Coremail) with SMTP id QMiowPDxRuRTApxcQGG0AA--.39177S2; Thu, 28 Mar 2019 07:08:17 +0800 (CST) From: Chong Qiao 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: Thu, 28 Mar 2019 07:08:01 +0800 Message-Id: <20190327230801.3650-1-qiaochong@loongson.cn> X-Mailer: git-send-email 2.17.0 X-CM-TRANSID: QMiowPDxRuRTApxcQGG0AA--.39177S2 X-Coremail-Antispam: 1UD129KBjvdXoW7GF4rXF1UZr4ruw43WrW8Crg_yo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 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: Chong Qiao --- 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