From patchwork Thu Feb 7 12:46:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1038052 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43wJS96K1zz9s4Z for ; Fri, 8 Feb 2019 00:04:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43wJS94XMxzDqSP for ; Fri, 8 Feb 2019 00:04:41 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43wJ3j5G68zDqRq for ; Thu, 7 Feb 2019 23:46:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: by ozlabs.org (Postfix) id 43wJ3j1jW4z9sNL; Thu, 7 Feb 2019 23:46:57 +1100 (AEDT) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id 43wJ3h6wmRz9sNQ; Thu, 7 Feb 2019 23:46:56 +1100 (AEDT) From: Michael Ellerman To: linuxppc-dev@ozlabs.org Subject: [PATCH v3 7/7] powerpc/pseries: Add firmware details to dump stack arch description Date: Thu, 7 Feb 2019 23:46:35 +1100 Message-Id: <20190207124635.3885-7-mpe@ellerman.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207124635.3885-1-mpe@ellerman.id.au> References: <20190207124635.3885-1-mpe@ellerman.id.au> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, pmladek@suse.com, linux-kernel@vger.kernel.org, sergey.senozhatsky@gmail.com, tj@kernel.org, akpm@linux-foundation.org, dyoung@redhat.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Once we have unflattened the device tree we can easily grab these firmware version details and add them to dump stack arch description, which is printed in case of an oops. Currently /hypervisor only exists on KVM, so if we don't find that look for something that suggests we're on phyp and if so that's probably a good guess. The actual content of the ibm,fw-net-version seems to be a full path so is too long to add to the description. Hardware name: ... of:'IBM,FW860.42 (SV860_138)' hv:phyp Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/pseries/setup.c | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 41f62ca27c63..dfb084f5a573 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -923,6 +923,39 @@ static void pSeries_cmo_feature_init(void) pr_debug(" <- fw_cmo_feature_init()\n"); } +static void __init pseries_add_dump_stack_arch_desc(void) +{ + struct device_node *dn; + const char *prop; + + dn = of_find_node_by_path("/openprom"); + if (dn) { + prop = of_get_property(dn, "model", NULL); + if (prop) + dump_stack_add_arch_desc("of:'%s'", prop); + + of_node_put(dn); + } + + dn = of_find_node_by_path("/hypervisor"); + if (dn) { + prop = of_get_property(dn, "compatible", NULL); + if (prop) + dump_stack_add_arch_desc("hv:%s", prop); + + of_node_put(dn); + } else { + dn = of_find_node_by_path("/"); + if (dn) { + prop = of_get_property(dn, "ibm,fw-net-version", NULL); + if (prop) + dump_stack_add_arch_desc("hv:phyp"); + + of_node_put(dn); + } + } +} + /* * Early initialization. Relocation is on but do not reference unbolted pages */ @@ -930,6 +963,8 @@ static void __init pseries_init(void) { pr_debug(" -> pseries_init()\n"); + pseries_add_dump_stack_arch_desc(); + #ifdef CONFIG_HVC_CONSOLE if (firmware_has_feature(FW_FEATURE_LPAR)) hvc_vio_init_early();