From patchwork Wed Sep 28 13:40:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1683898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=i4YCUIZA; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4McyMW6j81z1yqJ for ; Wed, 28 Sep 2022 23:41:43 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4McyMW3nHQz3ckZ for ; Wed, 28 Sep 2022 23:41:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=i4YCUIZA; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 4McyL85ffmz3bkb for ; Wed, 28 Sep 2022 23:40:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=i4YCUIZA; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4McyL65c8Zz4xGQ; Wed, 28 Sep 2022 23:40:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1664372430; bh=/lNEJmTqE4KJ0mXO03cJ7YzFkVHxeI96IWFG2LDU56Q=; h=From:To:Subject:Date:From; b=i4YCUIZAaLz17ulYzn+SwmuNEJb67OYEjRJ4H2gghGsC5dBKT3EhaQ5URkuxxBxfN YzNct5k9A8PnxZ3t2c1pdgTpPEdKOlluwjqny4c4GblxJG4FTIJ9tVTkb2qHMRwHCV TYAghR7nbT0hhHAlLQQeYmHd785hZZNmHT76OxsT5qY6qFDNq3puAVlTVQp0qeWJZa sIBNZrfDTLCv50dPcn4i2EiqTkQgAQdMLIQ2vvxegb2+QruvHBK+uOZ5YkuNnIXOp+ 8YjY740MxFGFrSHrMiNCen7azpeRG35XRgQiV/Fcr5hc3/dwcE2A1LqbrGItGoD3Cz oBvQddkXwT9oQ== From: Michael Ellerman To: Subject: [PATCH 1/6] powerpc: Add ppc_md.name to dump stack arch description Date: Wed, 28 Sep 2022 23:40:20 +1000 Message-Id: <20220928134025.1739909-1-mpe@ellerman.id.au> X-Mailer: git-send-email 2.37.3 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: , Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" As soon as we know the name of the machine description we're using, add it to the dump stack arch description, which is printed in case of an oops. eg: Hardware name: ... machine:pSeries Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/setup.h | 2 ++ arch/powerpc/kernel/setup-common.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h index 85143849a586..e29e83f8a89c 100644 --- a/arch/powerpc/include/asm/setup.h +++ b/arch/powerpc/include/asm/setup.h @@ -88,6 +88,8 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long pp, unsigned long r6, unsigned long r7, unsigned long kbase); +extern struct seq_buf ppc_hw_desc; + #endif /* !__ASSEMBLY__ */ #endif /* _ASM_POWERPC_SETUP_H */ diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index dd98f43bd685..42279c3f1d31 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -588,6 +590,15 @@ static __init int add_pcspkr(void) device_initcall(add_pcspkr); #endif /* CONFIG_PCSPKR_PLATFORM */ +static char ppc_hw_desc_buf[128] __initdata; + +struct seq_buf ppc_hw_desc __initdata = { + .buffer = ppc_hw_desc_buf, + .size = sizeof(ppc_hw_desc_buf), + .len = 0, + .readpos = 0, +}; + static __init void probe_machine(void) { extern struct machdep_calls __machine_desc_start; @@ -628,6 +639,9 @@ static __init void probe_machine(void) for (;;); } + seq_buf_printf(&ppc_hw_desc,"machine:%s ", ppc_md.name); + dump_stack_set_arch_desc(ppc_hw_desc.buffer); + printk(KERN_INFO "Using %s machine description\n", ppc_md.name); } From patchwork Wed Sep 28 13:40:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1683901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=IVixxF0b; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4McyNq2ttvz1yqJ for ; Wed, 28 Sep 2022 23:42:51 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4McyNp6Chfz3cj0 for ; Wed, 28 Sep 2022 23:42:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=IVixxF0b; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 4McyL936Wdz3bkb for ; Wed, 28 Sep 2022 23:40:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=IVixxF0b; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4McyL72pzHz4xGh; Wed, 28 Sep 2022 23:40:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1664372431; bh=pi+mUOLsnhmd6VVvCm4bw8pEUUFjwaM50i6henrEXqE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IVixxF0b2KwMHLOsnvERQ5NNeaJ6m3SUBNElNvB4OdimyvE+HGWKslUoI35zTg1ys onJ2Op8Dv+BbC5Mt/FD4RY7Zjroj+xzxf8k7VdQG70ADKQ9E4DSZqLbvoIJ1ka/KIP K4P6pKJiH6hqW9mtqvkwxPMGTBgRzLjwdPKzHMWVbyDhCNzC7ZrcnIvxI7bnKbQrbU 1NsQDeiybSsQucx7odkIUWE7oo55Ae2mKFKnyPzcYdV1kPhoddfZ4Gu3luBIOucn5p 19izVWTALp9X+pf6Np/ZPkpf2ozoaoHC2fwFHUSAn6heE6eWURWusryCA4NNVfK2ob YiS0e/abCCo3g== From: Michael Ellerman To: Subject: [PATCH 2/6] powerpc: Add PVR & CPU name to dump stack arch description Date: Wed, 28 Sep 2022 23:40:21 +1000 Message-Id: <20220928134025.1739909-2-mpe@ellerman.id.au> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928134025.1739909-1-mpe@ellerman.id.au> References: <20220928134025.1739909-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: , Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Add the PVR and CPU name to the dump stack arch description, which is printed in case of an oops. eg: Hardware name: ... POWER8E (raw) pvr:0x4b0201 Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/prom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 2e7a04dab2f7..7987d69f1785 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -819,6 +820,10 @@ void __init early_init_devtree(void *params) dt_cpu_ftrs_scan(); + /* We can now set the CPU name & PVR for the oops output */ + seq_buf_printf(&ppc_hw_desc, "%s pvr:0x%04lx ", cur_cpu_spec->cpu_name, + mfspr(SPRN_PVR)); + /* Retrieve CPU related informations from the flat tree * (altivec support, boot CPU ID, ...) */ From patchwork Wed Sep 28 13:40:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1683896 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=ALqFYcta; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4McyLL4lMJz1yqJ for ; Wed, 28 Sep 2022 23:40:42 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4McyLK5Jhrz3c7H for ; Wed, 28 Sep 2022 23:40:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=ALqFYcta; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (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 4McyL80Hgrz3bY3 for ; Wed, 28 Sep 2022 23:40:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=ALqFYcta; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4McyL76Tcyz4xGk; Wed, 28 Sep 2022 23:40:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1664372431; bh=x0mQAMZ2Pmj93eVlnPVlcjrp6/EVhhdmfLtEEDImEgw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ALqFYctaZZVJEn2Xt5JALRyF7TXBrgXY/eIoZXqZ1zWkF/DqdTRLkHvuOa9XxtRxf EUS8ySY4/ZUHxwT6MO6IEQuCw3aEDFeQns9C+YYdMp0RQSHMJ//+DBoREt1wWAyw72 JSrbdlHmN1ujrXey5hQq+j9ZDaH5ltY2kJdNL+ILzhn8omzJi/+/iSGFKVwLQspoOD 9TrJB56sERK3tTt6vn3x0vikkt7E6Fmg5Vd9oyjyJnzTEO7Q/Erw8YZyQT+zFRm2x0 iamT0hCvydFjrjQ1RMprk/3Ej4NdyjJod5rmWQyaWnLQsa9KqMLkZWAt7+M5q19Rmy Ydufh73CPYI1w== From: Michael Ellerman To: Subject: [PATCH 3/6] powerpc/64: Add logical PVR to the dump stack arch description Date: Wed, 28 Sep 2022 23:40:22 +1000 Message-Id: <20220928134025.1739909-3-mpe@ellerman.id.au> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928134025.1739909-1-mpe@ellerman.id.au> References: <20220928134025.1739909-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: , Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" If we detect a logical PVR add that to the dump stack arch description, which is printed in case of an oops. eg: Hardware name: ... lpvr:0xf000004 Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/prom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 7987d69f1785..dca06ef7fcde 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -390,8 +390,10 @@ static int __init early_init_dt_scan_cpus(unsigned long node, */ if (!dt_cpu_ftrs_in_use()) { prop = of_get_flat_dt_prop(node, "cpu-version", NULL); - if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) + if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) { identify_cpu(0, be32_to_cpup(prop)); + seq_buf_printf(&ppc_hw_desc, "lpvr:0x%04x ", be32_to_cpup(prop)); + } check_cpu_feature_properties(node); check_cpu_features(node, "ibm,pa-features", ibm_pa_features, From patchwork Wed Sep 28 13:40:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1683897 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=CJOyz4Ej; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4McyLt6qXRz1yql for ; Wed, 28 Sep 2022 23:41:10 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4McyLt6MMcz3cdP for ; Wed, 28 Sep 2022 23:41:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=CJOyz4Ej; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 4McyL85ZHnz3bY3 for ; Wed, 28 Sep 2022 23:40:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=CJOyz4Ej; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4McyL83DwDz4xGl; Wed, 28 Sep 2022 23:40:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1664372432; bh=/uqDlqqQgcpOgll/WldlYrE1D+Je2HurKP2I9O6k8JQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CJOyz4Ejm4g+h/I0J9mTK/gJXrXvKhzk/d/KeR2g8rN7B2o3WMO8nS9IRot2Y+RZq l4UL3Yzu3ToXXrH8lLnloxN6//jVvBm9v3wyg8uSFTrUbU3jm16VovrI3xcxH8/Wx+ iWszQDbQJvnrcxPw724og+quNOK99l3M6b38mn8lbIOxK7t4KvZUra4yoLW3jGqeiI 38sg+W8aMx+5AnZrEd7RkGFxmPNnCp/Fv+2+kgsHv73zogTm/oGQsgLYuraFOkn7No CdfSuszwgQpyUjWGfnofYeRvtmQfX3POnILtMXb/mcUdb8NURv1KNvRPFe48oxqZMR wamcNIbPQe7fw== From: Michael Ellerman To: Subject: [PATCH 4/6] powerpc: Add device-tree model to dump stack arch description Date: Wed, 28 Sep 2022 23:40:23 +1000 Message-Id: <20220928134025.1739909-4-mpe@ellerman.id.au> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928134025.1739909-1-mpe@ellerman.id.au> References: <20220928134025.1739909-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: , Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Add the model of the machine we're on to the dump stack arch description, which is printed in case of an oops. eg: Hardware name: model:'IBM,8247-22L' Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/prom.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index dca06ef7fcde..605e4ad8a4c2 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -715,6 +715,23 @@ static void __init tm_init(void) static void tm_init(void) { } #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ +static int __init +early_init_dt_scan_model(unsigned long node, const char *uname, + int depth, void *data) +{ + const char *prop; + + if (depth != 0) + return 0; + + prop = of_get_flat_dt_prop(node, "model", NULL); + if (prop) + seq_buf_printf(&ppc_hw_desc, "model:'%s' ", prop); + + /* break now */ + return 1; +} + #ifdef CONFIG_PPC64 static void __init save_fscr_to_task(void) { @@ -743,6 +760,8 @@ void __init early_init_devtree(void *params) if (!early_init_dt_verify(params)) panic("BUG: Failed verifying flat device tree, bad version?"); + of_scan_flat_dt(early_init_dt_scan_model, NULL); + #ifdef CONFIG_PPC_RTAS /* Some machines might need RTAS info for debugging, grab it now. */ of_scan_flat_dt(early_init_dt_scan_rtas, NULL); From patchwork Wed Sep 28 13:40:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1683899 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=o9Ilw5vK; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4McyN85JKJz1yqJ for ; Wed, 28 Sep 2022 23:42:16 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4McyN84bZMz3f2n for ; Wed, 28 Sep 2022 23:42:16 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=o9Ilw5vK; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 4McyL90Tz8z3bkb for ; Wed, 28 Sep 2022 23:40:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=o9Ilw5vK; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4McyL86wWKz4xGH; Wed, 28 Sep 2022 23:40:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1664372433; bh=Y1C3ki1GevbbthhRELULS4p8sdE1ZmXzWqPGNPp0Pzk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o9Ilw5vKaTMcPFB5ZLHkevBQLThKD/cbilBGTQU2cjhrpLPJNeyIpRvEMjXctXehw 192TzTKXirYsI0ooHvK/haNYaKE4SmxVqoglKzRgJ54NxqSJYWKX9+/H8euR+CsoI2 8YlTXunjCCZUtbH9XeK3k5ZfGpafX6/W0WjXMsxoSgtmyp3HAktL/SPPX3ZP/XVMA7 CKObBpyjdNnDYdNZuw8PYIcstCgo7sn5x22/WHJc/CoQRcf9CDZA7pDNozJEvXzGUd 8KmZ5tM2o2GrbXuTPhMqROJTu1CnATHC6+X25F1Jq1fELGFTqW5NLRLKATd7U0PkA6 LPyI4xxmIn2NA== From: Michael Ellerman To: Subject: [PATCH 5/6] powerpc/powernv: Add opal details to dump stack arch description Date: Wed, 28 Sep 2022 23:40:24 +1000 Message-Id: <20220928134025.1739909-5-mpe@ellerman.id.au> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928134025.1739909-1-mpe@ellerman.id.au> References: <20220928134025.1739909-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: , Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Add OPAL version details to the dump stack arch description, which is printed in case of an oops. eg: Hardware name: ... opal:v6.2 Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/powernv/setup.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index dac545aa0308..fddc61ec1d5b 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -207,8 +208,33 @@ static void __init pnv_setup_arch(void) pnv_rng_init(); } +static void __init pnv_add_dump_stack_arch_desc(void) +{ + struct device_node *dn; + const char *version; + + dn = of_find_node_by_path("/ibm,opal/firmware"); + if (!dn) + return; + + version = of_get_property(dn, "version", NULL); + if (!version) + version = of_get_property(dn, "git-id", NULL); + + if (version) + seq_buf_printf(&ppc_hw_desc, "opal:%s", version); + + version = of_get_property(dn, "mi-version", NULL); + if (version) + seq_buf_printf(&ppc_hw_desc, "mi:%s", version); + + of_node_put(dn); +} + static void __init pnv_init(void) { + pnv_add_dump_stack_arch_desc(); + /* * Initialize the LPC bus now so that legacy serial * ports can be found on it From patchwork Wed Sep 28 13:40:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1683902 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=cBl/R0Mv; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4McyPS2P5kz1yqJ for ; Wed, 28 Sep 2022 23:43:24 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4McyPS1vfxz3dpq for ; Wed, 28 Sep 2022 23:43:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=cBl/R0Mv; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 4McyL94Jmhz3bkb for ; Wed, 28 Sep 2022 23:40:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=cBl/R0Mv; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4McyL93c8Vz4xGm; Wed, 28 Sep 2022 23:40:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1664372433; bh=OmVLqcJXRvUals4duaQ8Y3fFuXzdjkddBOVtf5vzMjk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cBl/R0Mv7TbDoDPBwHqb7Btjy0TlhgEdKFCdHCHlvUP31hAsuo9diPoFGIW9eU8lb j74y1RqaIUIM0/lRxq1PXYU93Qt3tU1x22c6mU7TtE1XRtwpDZYm7oe4Lh+jO1wFl1 lxLvFuEXghOR4GvC033J1ttzpjPLHlPCicmxGXurCVRPo0kuyt5pez6RMX2e6TQhew 6yStgzGCqaR1VUXpu6nncNc0Z7pbp5jKE5w8rYvMj4QCNHwvcDUT2gT205tIwz+PCC UfcdEznmGL4GTkYJ4VNVhCPlSiTPbl2+uEMZMnrxxti5q0GPbZOGLPVdsmF/PGazAG Km66lYgdgTkOg== From: Michael Ellerman To: Subject: [PATCH 6/6] powerpc/pseries: Add firmware details to dump stack arch description Date: Wed, 28 Sep 2022 23:40:25 +1000 Message-Id: <20220928134025.1739909-6-mpe@ellerman.id.au> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928134025.1739909-1-mpe@ellerman.id.au> References: <20220928134025.1739909-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: , Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Add firmware version details to the 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. eg: Hardware name: ... of:'IBM,FW860.42 (SV860_138)' hv:phyp Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/pseries/setup.c | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 5e44c65a032c..f0ce8256ebb8 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -1011,6 +1012,39 @@ static void __init 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) + seq_buf_printf(&ppc_hw_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) + seq_buf_printf(&ppc_hw_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) + seq_buf_printf(&ppc_hw_desc, "hv:phyp "); + + of_node_put(dn); + } + } +} + /* * Early initialization. Relocation is on but do not reference unbolted pages */ @@ -1018,6 +1052,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();