Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2041940imm; Mon, 16 Jul 2018 00:44:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeSM5wLHdEpyRx0dvoXKg8ffToSgJYnqsFm+KqYCNVHbCg1bSGNTv2C/JzKZSEWhZ7sudY9 X-Received: by 2002:a62:cd44:: with SMTP id o65-v6mr16854248pfg.47.1531727039999; Mon, 16 Jul 2018 00:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727039; cv=none; d=google.com; s=arc-20160816; b=r1SntJFjPY8xbefhWLy/9Zfb4S/Wqf0N2kTBJ0OHeWqtBwSyTkRIxc5byAoVQbz1ln mWF02JQgYGIEQ18OFl21K0jGzXIaDAkrSJsYb/a7Tt2a9sLtbtwxUInd1B51rTdKUWPl 22Op2QIkgpo0NUF8IwP1t1SJwndfGwrQMcAkM7nHfmkTV3LuRPiZlta5fvBjgpzFxy1q jjVQLgwZ6ZC2iXb1RGU7l3GNZyrLe9iAFOv87x0Vb0FG3bVQEnJirHVZH9OsHj0TO2Jb ljovddlZLV9ten9/3T2Wpi0tAcMDNGhaSbZP5eSJ5ToZL/vUl0/EwuVDPPebDKQ8tmKV fk6w== 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=bHSjzV31dVD5kJKn4TrhLjAKFHvK8yr3H8UR5PMZrM4=; b=COn6plqS2aw74+Bg1G+XBT/odF/rfxOIT35/nfmxr0FS6EJ/kvTg9J3Ro4lKjFI7M6 BwXr3wxulKk3E24vzxA1wZHx3cq04GlR8ygO36dxEgQ73z6zK59wIPqh3EF0TvK3R4MN vVqvWN5sfFnvIk8XI5lwcgecpppcApwvgBow70D9ZoMxT32bbF2MwJKClO1RXOp+Uj7Q 0WZG9iRBNSTy3MC9WRl+BZoP77qjvKsei/CUuiTCg71hRb90Wc13QIHOwJgYMnNtM8zP AJ4PhWX2GXPDZhS2ZPqclA89zPSyq7P0r1Axr7aS6g1/STvZvpVVQPvT6V41cKn5NnJa RtpA== 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 t62-v6si22026883pgd.485.2018.07.16.00.43.45; Mon, 16 Jul 2018 00:43:59 -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 S2388775AbeGPIIc (ORCPT + 99 others); Mon, 16 Jul 2018 04:08:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47788 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbeGPIIc (ORCPT ); Mon, 16 Jul 2018 04:08:32 -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 42606C03; Mon, 16 Jul 2018 07:42:29 +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.9 02/32] MIPS: Call dump_stack() from show_regs() Date: Mon, 16 Jul 2018 09:36:10 +0200 Message-Id: <20180716073504.733225999@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073504.433996952@linuxfoundation.org> References: <20180716073504.433996952@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.9-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 @@ -641,8 +641,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)