From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF64AC282C4 for ; Thu, 7 Feb 2019 12:46:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A486421902 for ; Thu, 7 Feb 2019 12:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727428AbfBGMq4 (ORCPT ); Thu, 7 Feb 2019 07:46:56 -0500 Received: from ozlabs.org ([203.11.71.1]:46827 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726844AbfBGMqy (ORCPT ); Thu, 7 Feb 2019 07:46:54 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 43wJ3b6Jzkz9s6w; Thu, 7 Feb 2019 23:46:51 +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 2/7] powerpc: Add PVR & CPU name to dump stack arch description Date: Thu, 7 Feb 2019 23:46:30 +1100 Message-Id: <20190207124635.3885-2-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 As soon as we've done some basic setup, 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/cputable.c | 1 + arch/powerpc/kernel/prom.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 1eab54bc6ee9..8b4520a84612 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 4181ec715f88..ea2c3498067d 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -761,6 +761,10 @@ void __init early_init_devtree(void *params) dt_cpu_ftrs_scan(); + /* We can now set the CPU name & PVR for the oops output */ + dump_stack_add_arch_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, ...) */ -- 2.20.1