Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp308978imj; Thu, 7 Feb 2019 04:48:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IaqfMk1yQkVJ+oCPT2XiwslHdp8qxHRHT8oWZHUE4col34MYu4pyINnYLzpIGWPIvZ4QVC+ X-Received: by 2002:a63:4a4d:: with SMTP id j13mr14857426pgl.127.1549543689573; Thu, 07 Feb 2019 04:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549543689; cv=none; d=google.com; s=arc-20160816; b=rItw8VZhN0vnqf88usNoEWiXgHPrR60fUAlbFwOyA81EUxGHGvZ3wBnXgQUv3eEP++ B70P0+N5JF2tC2l1SaOYn0MLqbutf68KKDBgBzOQUk5qbnQf5j5llfLTLdjsq1OKhAhI JO9bJ0mGYEK/J0fx+0hKId1T2tY2aKcvHsdPA7ZyRflLGv/rI056gd8npyu2pQIohpcE mSVWgEm4UNTB4xqJ+gwxw4eJnpcrjr7unlWObNB3ixPBC049yn1Cjy32Ke4PEl3I8Rgh Pld8kOoP7ErJMnwiwaacM4IPs+XJU9dP4VOPLghl0UOzJczp0qoxcUvk8+7cE0ywWG36 hQbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9wu3G/jWCEMPkn2reZfFiOR38MhmCpKW9QLyEdLgtvU=; b=RoG3SJ/OCjVoXlrzYNoRZ3U0xSjjyD/Lo/mrZr+4s1sGRKOXAPdzEd3PIojyqYGn/n nSc+dvGmmfDZh2Mxzv1OMMF8yW/INRggUlYsebkpjIBj9bT5uBZwqs5vFxP9fT/m57e3 i5QR6PKQb9AdZYZJ+Y1CYUWLZpig1olVeMMwrOkeVpst2Uki407EROHlaBtfg7DCxypw 2UZ6OPhhh/4S5fLJvFR3LQVN6eo+eYaM24pl1IMjzRXIr7zLPB1ysp92ZCta39X1chbS /eRWhTCIJ4Pzg/T/yhLbSGi4h8jzZWWK/HADtsq/nMr0Ph5BAC0eDf3O10uD6PYZarPS BUBg== 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 e68si8960099pfb.101.2019.02.07.04.47.53; Thu, 07 Feb 2019 04:48:09 -0800 (PST) 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 S1727472AbfBGMrJ (ORCPT + 99 others); Thu, 7 Feb 2019 07:47:09 -0500 Received: from ozlabs.org ([203.11.71.1]:49295 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbfBGMq7 (ORCPT ); Thu, 7 Feb 2019 07:46:59 -0500 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 Cc: akpm@linux-foundation.org, tj@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, dyoung@redhat.com, sergey.senozhatsky@gmail.com, pmladek@suse.com 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(); -- 2.20.1