Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp420582rdb; Thu, 18 Jan 2024 07:28:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFx0CPgTAo959BAHwqw5/+QHydMbKGfS+74Bjw8nISOK9zq9zQ0d93y4Yr465wgA0ZpOyyC X-Received: by 2002:a0c:cc0b:0:b0:681:7794:5972 with SMTP id r11-20020a0ccc0b000000b0068177945972mr935817qvk.33.1705591739342; Thu, 18 Jan 2024 07:28:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705591739; cv=pass; d=google.com; s=arc-20160816; b=l+VLQnykowtENaDnfrekpoNcWZwU9GedRdWIuXC0hjQP4muPdQF4eVWsooZSMdv7CB i3QllmEuYolO8ZnnHjo6exFVmJKJn/YC1hSCauQJ+IMxMAbyH21lTAt8rHLJErXuqXwk co8SldftiRvYHORYadHD5FjYqiLJYAvgZW8/3wD0/O60Y0l2GuNWqgTEwv3NE3SQjHvi zpO8awCdPOXTNve1JidjuLWQZxyQK8EMW1IoBONGgkoNng/GuTVL6PieaH0jTHCDYjsk gJEECrToDamIerqDCK5B449PEobjYqIdbSCihI+WiBWq9algoTXkPV6bjIJImKVasgOl W2lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=DvruwAVgFQQrEDzxS6NvC0VGi9dhiO+fYatRh7QawDc=; fh=0/OomzuShYuziTYlAWyPlUWU14rCcSJ++G4OgLHJGnk=; b=oLRIupr09sVl1M/1xb+DMsdoJMLHdk4K4gBeE7AkGaf4HkVG69WM7AmccHKddDUWIg UHzHhxoPzVSu7JvXiR7nHI0yDAIwM85mcwgFFuTuIdrZUlfQ9T3E/TdoHrEdctvFU3lC ErK2y9Y1Gh3sHe720v1vGY9GNAozDC3Oiz2SxyGBXsDr7JoOId1VIFw44WY91wuRSl6e n6AruZoa3Nc13MiYrWBiGRPPFa1CYgdDFxGrp7OrL1tAmOpx5LOH+PYzwCv9wTBla++3 hgyBbfIpCGvEd+1c8cREEe/oZCKge3rCs2GLIH/moGiepg90q5/OUaYhYWJZpyybjVsz 3Tkw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Co777sOq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30275-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30275-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m10-20020a0cac4a000000b006816c0b1f82si5472781qvb.446.2024.01.18.07.28.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 07:28:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30275-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Co777sOq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30275-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30275-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 11D021C231B3 for ; Thu, 18 Jan 2024 15:28:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6357D2CCB8; Thu, 18 Jan 2024 15:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Co777sOq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74EE92C857 for ; Thu, 18 Jan 2024 15:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705591542; cv=none; b=YDFP+ljsBil2PwL+nEHoGEVesSm52Q8zI6oQl+S0TleTc+m+jUPs6GKLI6UA/wKu3RVZaP0qPIsnIWWd5EaUqJJOHnsWSVWn3MeI9vWdR9LfKWFLH7vL1/uCShWAhvDNNdgs2RzxZSgZYnEPRCsgQLy6gyNAOBQf/WJK2+lBGN0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705591542; c=relaxed/simple; bh=wxONOmmGxUyWJ69hdYeGotk0425jRRxLbiWGsew7DL0=; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; b=EkjsDJhKVu4hwIti+Zk/PMYQ1csNwlLyAf80XNyLNVcrZt61e3rThW3beEeiP87kXZIxSrfnFjsr/FQl1uVmBLNPoVRUAKVBNV9Is1irlK1tQ/hegNCU3NISlBmaayrlHE+4QUQe7uXna3YJrmXDJG2e/R914vTftWyX9i9BmDY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Co777sOq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 26C18C43394; Thu, 18 Jan 2024 15:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705591542; bh=wxONOmmGxUyWJ69hdYeGotk0425jRRxLbiWGsew7DL0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Co777sOqdXYLbF4D/uUekrfeKydKPAYpWDwgdsbWcZrKxetnwr9Skr3xawuDApwE2 q9YFhS/xB5rtfva4cnu6WgHDTOS7jZYJxSgP4LJZgxW5t651ioZVqKSy20KVuGDYrC e2XXAn5iNNr2M55Rq9+rKsXf+tPg03YeYRwHEl/QVJ0fiCjUq7Xs5ZNsLfdFEXn3z3 nRBy0d5OHU37UlLPJAvNNdLZg1IiW3cajkdTP9mOyhpwdUO7dTRE5W3UPrym2deH7D equfvmap+1N0uOVFqSk1tMhP6ANCLEGJd0qjpFgjSGr+It6Zb0dAbLSwfGr9nQSe6V Ykgc0dU+6z0JA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F1EEC47DB3; Thu, 18 Jan 2024 15:25:42 +0000 (UTC) From: Nathan Lynch via B4 Relay Date: Thu, 18 Jan 2024 09:25:14 -0600 Subject: [PATCH RFC 3/5] powerpc/prom: Add CPU info to hardware description string later Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240118-update-dump-stack-arch-str-v1-3-5c0f98d017b5@linux.ibm.com> References: <20240118-update-dump-stack-arch-str-v1-0-5c0f98d017b5@linux.ibm.com> In-Reply-To: <20240118-update-dump-stack-arch-str-v1-0-5c0f98d017b5@linux.ibm.com> To: "Aneesh Kumar K.V" , "Naveen N. Rao" , Brian King , Christophe Leroy , John Ogness , Michael Ellerman , Nicholas Piggin , Petr Mladek , Sergey Senozhatsky , Steven Rostedt Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Nathan Lynch X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705591541; l=2684; i=nathanl@linux.ibm.com; s=20230817; h=from:subject:message-id; bh=+lv6CvMHBPkIkCIUDp5N0D4IvkHpdstqrvDIpsi8Zi8=; b=PKyW2FF7XVFeI0IyJdhUDwL62a2rUyi5fyEX8m3gJZgmgZ3WcsbUSP/o9+T10oPnzRZVM8VvP 2hrKH0MUx0OBEC+PmXWCS8VJVFn0XBFnUMsWj6hQ3D8YcH7rBl4TGF2 X-Developer-Key: i=nathanl@linux.ibm.com; a=ed25519; pk=jPDF44RvT+9DGFOH3NGoIu1xN9dF+82pjdpnKjXfoJ0= X-Endpoint-Received: by B4 Relay for nathanl@linux.ibm.com/20230817 with auth_id=78 X-Original-From: Nathan Lynch Reply-To: From: Nathan Lynch cur_cpu_spec->cpu_name is appended to ppc_hw_desc before cur_cpu_spec has taken on its final value. This is illustrated on pseries by comparing the CPU name as reported at boot ("POWER8E (raw)") to the contents of /proc/cpuinfo ("POWER8 (architected)"): $ dmesg | grep Hardware Hardware name: IBM,8408-E8E POWER8E (raw) 0x4b0201 0xf000004 \ of:IBM,FW860.50 (SV860_146) hv:phyp pSeries $ grep -m 1 ^cpu /proc/cpuinfo cpu : POWER8 (architected), altivec supported Some 44x models would appear to be affected as well; see identical_pvr_fixup(). This results in incorrect CPU information in stack dumps -- ppc_hw_desc is an input to dump_stack_set_arch_desc(). Delay gathering the CPU name until after all potential calls to identify_cpu(). Signed-off-by: Nathan Lynch Fixes: bd649d40e0f2 ("powerpc: Add PVR & CPU name to hardware description") --- arch/powerpc/kernel/prom.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 0b5878c3125b..c12b4434336f 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -327,6 +327,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, void *data) { const char *type = of_get_flat_dt_prop(node, "device_type", NULL); + const __be32 *cpu_version = NULL; const __be32 *prop; const __be32 *intserv; int i, nthreads; @@ -398,7 +399,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, prop = of_get_flat_dt_prop(node, "cpu-version", NULL); if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) { identify_cpu(0, be32_to_cpup(prop)); - seq_buf_printf(&ppc_hw_desc, "0x%04x ", be32_to_cpup(prop)); + cpu_version = prop; } check_cpu_feature_properties(node); @@ -409,6 +410,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node, } identical_pvr_fixup(node); + + // We can now add the CPU name & PVR to the hardware description + seq_buf_printf(&ppc_hw_desc, "%s 0x%04lx ", cur_cpu_spec->cpu_name, mfspr(SPRN_PVR)); + if (cpu_version) + seq_buf_printf(&ppc_hw_desc, "0x%04x ", be32_to_cpup(cpu_version)); + init_mmu_slb_size(node); #ifdef CONFIG_PPC64 @@ -846,9 +853,6 @@ void __init early_init_devtree(void *params) dt_cpu_ftrs_scan(); - // We can now add the CPU name & PVR to the hardware description - seq_buf_printf(&ppc_hw_desc, "%s 0x%04lx ", cur_cpu_spec->cpu_name, mfspr(SPRN_PVR)); - /* Retrieve CPU related informations from the flat tree * (altivec support, boot CPU ID, ...) */ -- 2.43.0