Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2037272imm; Mon, 16 Jul 2018 00:37:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd+Q4N9TwDnYw1T6WXGe7he44PeG2nbBSBF4WkjHPVVcjO9XGkcf7+MyJpZLgyRskKKi5ob X-Received: by 2002:a17:902:d716:: with SMTP id w22-v6mr15595726ply.98.1531726630059; Mon, 16 Jul 2018 00:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726630; cv=none; d=google.com; s=arc-20160816; b=Tu+wkozOJ60X8jiAPn//Gq/9WRpa2yG9bq0RnCPKxQ0XZGTrukByRrUo/XSPPmLEC7 WMszb6vw1V2rv67gd1N3dvXJnscx86+veS5BjU/rIitos8I0bAmcakz9Y3mjR2ypphYV DK6O5A9dv3OpkvO71TudYIyZ8uAgVMgkVKCfhKshWxiFKRGvsMioZqky3ek4D8KD9DZ2 QY2WG7le3tNayjmxFRJnhFsDS0RojCxSSOusZYghbm7bdb6HL/uIAezQQw69unnh4kF9 c1yWxazcedrgThvgOjZQrJFpOF6awgJE0j+LgTiiJGgbk0onpuhafPgzPY3J0eNL+jSO HqAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=68BFE8vkVn5j4AjSoy/o89c+3tPujHsu5szDnl91Sio=; b=s5ba7rJPaZL1RqTY7074g22KxIx8pOB3HMZQIWuN91X5nHaBRc+MLsczdvlQ3IO9HM s8eYI4LsIaSu4m9qQGqbwmOWwhZfzOpJ6N/qOIBqqJIesIHwfoCm293ELVIDUEWsp7UY KwZa3iSTnA4KXQgJuFc4hSTSQ/nC0QzuqV6nC20hrp6sU0WRYOXwKyXcE8Nj+lrtj8dx 7gmxYMT5Tsw7EIiS4kmfKkYYxTxVGc3PtxlLej9A1+pyNv98Yjo2Gsa4EtJB/Zmtlcj0 +ivfCqF/asJIn9Gyf4S0GEI86iDW4ypIwix7xedMOYbNWLqiJjhNBfns2K8Tbw1xAGTU OpZg== 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 m73-v6si15679648pga.398.2018.07.16.00.36.42; Mon, 16 Jul 2018 00:37:10 -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 S1730029AbeGPIBw (ORCPT + 99 others); Mon, 16 Jul 2018 04:01:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46538 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726301AbeGPIBu (ORCPT ); Mon, 16 Jul 2018 04:01:50 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4A620CAF; Mon, 16 Jul 2018 07:35:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , James Hogan , Ralf Baechle , Huacai Chen , linux-mips@linux-mips.org Subject: [PATCH 4.17 02/67] MIPS: Call dump_stack() from show_regs() Date: Mon, 16 Jul 2018 09:34:31 +0200 Message-Id: <20180716073443.563127118@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton commit 5a267832c2ec47b2dad0fdb291a96bb5b8869315 upstream. The generic nmi_cpu_backtrace() function calls show_regs() when a struct pt_regs is available, and dump_stack() otherwise. If we were to make use of the generic nmi_cpu_backtrace() with MIPS' current implementation of show_regs() this would mean that we see only register data with no accompanying stack information, in contrast with our current implementation which calls dump_stack() regardless of whether register state is available. In preparation for making use of the generic nmi_cpu_backtrace() to implement arch_trigger_cpumask_backtrace(), have our implementation of show_regs() call dump_stack() and drop the explicit dump_stack() call in arch_dump_stack() which is invoked by arch_trigger_cpumask_backtrace(). This will allow the output we produce to remain the same after a later patch switches to using nmi_cpu_backtrace(). It may mean that we produce extra stack output in other uses of show_regs(), but this: 1) Seems harmless. 2) Is good for consistency between arch_trigger_cpumask_backtrace() and other users of show_regs(). 3) Matches the behaviour of the ARM & PowerPC architectures. Marked for stable back to v4.9 as a prerequisite of the following patch "MIPS: Call dump_stack() from show_regs()". Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19596/ Cc: James Hogan Cc: Ralf Baechle Cc: Huacai Chen Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # v4.9+ Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/process.c | 4 ++-- arch/mips/kernel/traps.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -663,8 +663,8 @@ static void arch_dump_stack(void *info) if (regs) show_regs(regs); - - dump_stack(); + else + dump_stack(); } void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self) --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -351,6 +351,7 @@ static void __show_regs(const struct pt_ void show_regs(struct pt_regs *regs) { __show_regs((struct pt_regs *)regs); + dump_stack(); } void show_registers(struct pt_regs *regs)