From patchwork Tue Aug 10 17:22:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 12429239 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,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 13FD3C4320A for ; Tue, 10 Aug 2021 17:22:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE4FE60F13 for ; Tue, 10 Aug 2021 17:22:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230289AbhHJRXP (ORCPT ); Tue, 10 Aug 2021 13:23:15 -0400 Received: from mail-bn8nam11on2064.outbound.protection.outlook.com ([40.107.236.64]:48704 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229456AbhHJRXP (ORCPT ); Tue, 10 Aug 2021 13:23:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SekhP5vdGRlfVVUb3/pCOh3LMox1zaEHd+llha1fP7DkkXJNYnaVqF4avonQ1cJawdrae7ANA62SI2J1IMfeIC1Dn1z3gQIDxmld8H/EI/+TUIrMgjOBKLMHoKSb7BHgvlT8m4HvlmbKauBftddqJHp/t9VH+Unh9YlXqf7LQMXgABHzXIYr2/TlQy0PbvHt28eE+hxsD27WMcQyCtjOdDqoA1/kyRKhOCXDTzsOBjjai4EZfTVhx93Y7rDpx3B2gljz5WO9h96lLB2K1bhRxpo8s9tSjXMEtvIb0vHIAzSyPtmi5k5mANMOb8WNxHaDvUnDX7fn30AnmCogf39W5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VDRoUzm06odvHus9TYolcxm3o2UgbTEvTV+RVGT37hU=; b=bY5gS1c5Imv4Ix2beShxsBYmGKlAsEnGn9ip4tgqEf95ZhiAXimNrPljoZyfmb6OWzF4HiT9842RVcF2GUCJmk7OBuxFsFU1Pkj4oNFoGoe2vOqDj9+WE2zhqzEdlJjQZw86twab9FKBAOm0zzUZeLAtUcNWmcePoPy1orkaTz6vO/P0MfdqGthI9b/4BnO3KNs9iwn9iI4SlCTzQsADLehZiGxi70q3Hk13Uwry3JsZeVX9TdRpjcfIEx4bcK1nug52GMQnyidHj/2pjfQAM8Ebqotqc9Ac90/o5l3jw07oBdV/CbN3JG1iyK8THdY4aLeSBPU8WYtGivWGgREPnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VDRoUzm06odvHus9TYolcxm3o2UgbTEvTV+RVGT37hU=; b=sC3HQCf8exfuerhgASnvzJIjNv03zcXD/7Sl3GenCuPDVgZjc56xdj9HdxMr+tUDficmAxG4ata/T6qAqAQvndY6hPpB7etzOOyfGcNtZ9aBM1ULoRZnvQwxDPcpTIwVTTWsWB+QkYkPqLF7M38daHBrJxovc7wzMiinwvTOjuc= Received: from MW4PR04CA0015.namprd04.prod.outlook.com (2603:10b6:303:69::20) by MWHPR12MB1376.namprd12.prod.outlook.com (2603:10b6:300:13::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.18; Tue, 10 Aug 2021 17:22:50 +0000 Received: from CO1NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:303:69:cafe::28) by MW4PR04CA0015.outlook.office365.com (2603:10b6:303:69::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Tue, 10 Aug 2021 17:22:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT057.mail.protection.outlook.com (10.13.174.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4394.16 via Frontend Transport; Tue, 10 Aug 2021 17:22:50 +0000 Received: from milan-ETHANOL-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 10 Aug 2021 12:22:46 -0500 From: Naveen Krishna Chatradhi To: CC: , , , , , "Naveen Krishna Chatradhi" , Muralidhara M K Subject: [PATCH 1/4] rasdaemon: Add new SMCA bank types with error decoding Date: Tue, 10 Aug 2021 22:52:11 +0530 Message-ID: <20210810172214.134099-2-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210810172214.134099-1-nchatrad@amd.com> References: <20210810172214.134099-1-nchatrad@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 430242b9-2a62-4b15-fe72-08d95c237ad0 X-MS-TrafficTypeDiagnostic: MWHPR12MB1376: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:556; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PT5opLK+5v1b9+REma3Srugm/FxodXFOlz/wxG9awTNMBRDZ4DS4ueudtkUil8DASW90AZX+zfRG7MRBn2roBvZnkmZMppLGI9qK6+8h3jBIR5bA8g9jXqDfdXfPcgcx6rGxE/qHU2OQRj8BolgKhXUYYTlcnMU2YNI4qq6pr32dmObNwPk2o+X8KM1r03iGDfIn3oAzIHKmwA68pIayX2dOKIy7pwtK4RnNRYGnPNgXO1MfTOMqWYvXQa/ULvNYr55j66Wh+ASDefpFccg9Q13zCmFDV+YwVkm0NdOLTFIL4O1ijVx9qDeCEy8z8xb52gb5UurpwGn6Ndx4HmYoDhbWSFfSXb5KTvqoKpSC/LPEw/5M99q0E0h37isymvsT2VVg3sj72Q8AaShcDdTOhxbDomcgoTQu5CUI1bFP3gUVxPJ5fzcguGaeNVmsISKWHlE3H0mjnImnrlWtLidP6Pq01IT8NiKrvQkRZ04t8/ot1TgWJPnfMvntSO8shlSCenjenB+uEaOInN0kZDA5nzSrju3Gu+n2AfVv71n6nHgdZaAqbefCaBpIQ2G+KcvrNdlWwBpd8l2dSeqxv6b9akt6gyZXTcFWCmMU7i6du0t8bK7onPcmXQftmYsmcBA/g/OZqkYlPxyKLmnVXVKabOTAvjcVNLiqLOAtInPGLBkWRar8KTLo0NjhcGq/X9nHGtFDq3gTofgh5Z7hTDvVoZc6kNspmLaemEz2lBH4el3Ax6m8IlSFJjqQbNXbx79In2vpfzYv1uLuGW9Z1ChMeg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(396003)(346002)(39860400002)(136003)(376002)(46966006)(36840700001)(82310400003)(426003)(47076005)(1076003)(36756003)(6916009)(54906003)(81166007)(7696005)(2616005)(356005)(6666004)(316002)(26005)(336012)(8936002)(5660300002)(478600001)(34020700004)(70586007)(36860700001)(15650500001)(82740400003)(70206006)(2906002)(8676002)(83380400001)(186003)(16526019)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2021 17:22:50.2214 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 430242b9-2a62-4b15-fe72-08d95c237ad0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1376 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org Upcoming systems with Scalable Machine Check Architecture (SMCA) have new MCA banks added. This patch adds the (HWID, MCATYPE) tuple, name and error decoding for those new SMCA banks. While at it, optimize the string names in smca_bank_name[]. This patch is based on the commit below upstremed into the kernel 94a311ce248e0b53c76e110fd00511af47b72ffb Signed-off-by: Muralidhara M K Signed-off-by: Naveen Krishna Chatradhi --- mce-amd-smca.c | 138 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 113 insertions(+), 25 deletions(-) diff --git a/mce-amd-smca.c b/mce-amd-smca.c index 7c619fd..e0cf512 100644 --- a/mce-amd-smca.c +++ b/mce-amd-smca.c @@ -47,7 +47,7 @@ /* These may be used by multiple smca_hwid_mcatypes */ enum smca_bank_types { SMCA_LS = 0, /* Load Store */ - SMCA_LS_V2, /* Load Store */ + SMCA_LS_V2, SMCA_IF, /* Instruction Fetch */ SMCA_L2_CACHE, /* L2 Cache */ SMCA_DE, /* Decoder Unit */ @@ -56,17 +56,22 @@ enum smca_bank_types { SMCA_FP, /* Floating Point */ SMCA_L3_CACHE, /* L3 Cache */ SMCA_CS, /* Coherent Slave */ - SMCA_CS_V2, /* Coherent Slave V2 */ + SMCA_CS_V2, SMCA_PIE, /* Power, Interrupts, etc. */ SMCA_UMC, /* Unified Memory Controller */ + SMCA_UMC_V2, SMCA_PB, /* Parameter Block */ SMCA_PSP, /* Platform Security Processor */ - SMCA_PSP_V2, /* Platform Security Processor V2 */ + SMCA_PSP_V2, SMCA_SMU, /* System Management Unit */ - SMCA_SMU_V2, /* System Management Unit V2 */ + SMCA_SMU_V2, SMCA_MP5, /* Microprocessor 5 Unit */ SMCA_NBIO, /* Northbridge IO Unit */ SMCA_PCIE, /* PCI Express Unit */ + SMCA_PCIE_V2, + SMCA_XGMI_PCS, /* xGMI PCS Unit */ + SMCA_XGMI_PHY, /* xGMI PHY Unit */ + SMCA_WAFL_PHY, /* WAFL PHY Unit */ N_SMCA_BANK_TYPES }; @@ -237,6 +242,22 @@ static const char * const smca_umc_mce_desc[] = { "Command/address parity error", "Write data CRC error", }; + +static const char * const smca_umc2_mce_desc[] = { + "DRAM ECC error", + "Data poison error", + "SDP parity error", + "Reserved", + "Address/Command parity error", + "Write data parity error", + "DCQ SRAM ECC error", + "Reserved", + "Read data parity error", + "Rdb SRAM ECC error", + "RdRsp SRAM ECC error", + "LM32 MP errors", +}; + /* Parameter Block */ static const char * const smca_pb_mce_desc[] = { "Parameter Block RAM ECC error", @@ -314,6 +335,55 @@ static const char * const smca_pcie_mce_desc[] = { "CCIX Non-okay write response with data error", }; +static const char * const smca_pcie2_mce_desc[] = { + "SDP Parity Error logging", +}; + +static const char * const smca_xgmipcs_mce_desc[] = { + "Data Loss Error", + "Training Error", + "Flow Control Acknowledge Error", + "Rx Fifo Underflow Error", + "Rx Fifo Overflow Error", + "CRC Error", + "BER Exceeded Error", + "Tx Vcid Data Error", + "Replay Buffer Parity Error", + "Data Parity Error", + "Replay Fifo Overflow Error", + "Replay Fifo Underflow Error", + "Elastic Fifo Overflow Error", + "Deskew Error", + "Flow Control CRC Error", + "Data Startup Limit Error", + "FC Init Timeout Error", + "Recovery Timeout Error", + "Ready Serial Timeout Error", + "Ready Serial Attempt Error", + "Recovery Attempt Error", + "Recovery Relock Attempt Error", + "Replay Attempt Error", + "Sync Header Error", + "Tx Replay Timeout Error", + "Rx Replay Timeout Error", + "LinkSub Tx Timeout Error", + "LinkSub Rx Timeout Error", + "Rx CMD Pocket Error", +}; + +static const char * const smca_xgmiphy_mce_desc[] = { + "RAM ECC Error", + "ARC instruction buffer parity error", + "ARC data buffer parity error", + "PHY APB error", +}; + +static const char * const smca_waflphy_mce_desc[] = { + "RAM ECC Error", + "ARC instruction buffer parity error", + "ARC data buffer parity error", + "PHY APB error", +}; struct smca_mce_desc { const char * const *descs; @@ -333,6 +403,7 @@ static struct smca_mce_desc smca_mce_descs[] = { [SMCA_CS_V2] = { smca_cs2_mce_desc, ARRAY_SIZE(smca_cs2_mce_desc) }, [SMCA_PIE] = { smca_pie_mce_desc, ARRAY_SIZE(smca_pie_mce_desc) }, [SMCA_UMC] = { smca_umc_mce_desc, ARRAY_SIZE(smca_umc_mce_desc) }, + [SMCA_UMC_V2] = { smca_umc2_mce_desc, ARRAY_SIZE(smca_umc2_mce_desc) }, [SMCA_PB] = { smca_pb_mce_desc, ARRAY_SIZE(smca_pb_mce_desc) }, [SMCA_PSP] = { smca_psp_mce_desc, ARRAY_SIZE(smca_psp_mce_desc) }, [SMCA_PSP_V2] = { smca_psp2_mce_desc, ARRAY_SIZE(smca_psp2_mce_desc)}, @@ -341,6 +412,10 @@ static struct smca_mce_desc smca_mce_descs[] = { [SMCA_MP5] = { smca_mp5_mce_desc, ARRAY_SIZE(smca_mp5_mce_desc) }, [SMCA_NBIO] = { smca_nbio_mce_desc, ARRAY_SIZE(smca_nbio_mce_desc)}, [SMCA_PCIE] = { smca_pcie_mce_desc, ARRAY_SIZE(smca_pcie_mce_desc)}, + [SMCA_PCIE_V2] = { smca_pcie2_mce_desc, ARRAY_SIZE(smca_pcie2_mce_desc) }, + [SMCA_XGMI_PCS] = { smca_xgmipcs_mce_desc, ARRAY_SIZE(smca_xgmipcs_mce_desc) }, + [SMCA_XGMI_PHY] = { smca_xgmiphy_mce_desc, ARRAY_SIZE(smca_xgmiphy_mce_desc) }, + [SMCA_WAFL_PHY] = { smca_waflphy_mce_desc, ARRAY_SIZE(smca_waflphy_mce_desc) }, }; struct smca_hwid { @@ -369,6 +444,8 @@ static struct smca_hwid smca_hwid_mcatypes[] = { /* Unified Memory Controller MCA type */ { SMCA_UMC, 0x00000096 }, + /* Heterogeneous systems may have both UMC and UMC_v2 types on the same node. */ + { SMCA_UMC_V2, 0x00010096 }, /* Parameter Block MCA type */ { SMCA_PB, 0x00000005 }, @@ -389,6 +466,16 @@ static struct smca_hwid smca_hwid_mcatypes[] = { /* PCI Express Unit MCA type */ { SMCA_PCIE, 0x00000046 }, + { SMCA_PCIE_V2, 0x00010046 }, + + /* Ext Global Memory Interconnect PCS MCA type */ + { SMCA_XGMI_PCS, 0x00000050 }, + + /* Ext Global Memory Interconnect PHY MCA type */ + { SMCA_XGMI_PHY, 0x00000259 }, + + /* WAFL PHY MCA type */ + { SMCA_WAFL_PHY, 0x00000267 }, }; struct smca_bank_name { @@ -396,27 +483,28 @@ struct smca_bank_name { }; static struct smca_bank_name smca_names[] = { - [SMCA_LS] = { "Load Store Unit" }, - [SMCA_LS_V2] = { "Load Store Unit" }, - [SMCA_IF] = { "Instruction Fetch Unit" }, - [SMCA_L2_CACHE] = { "L2 Cache" }, - [SMCA_DE] = { "Decode Unit" }, - [SMCA_RESERVED] = { "Reserved" }, - [SMCA_EX] = { "Execution Unit" }, - [SMCA_FP] = { "Floating Point Unit" }, - [SMCA_L3_CACHE] = { "L3 Cache" }, - [SMCA_CS] = { "Coherent Slave" }, - [SMCA_CS_V2] = { "Coherent Slave" }, - [SMCA_PIE] = { "Power, Interrupts, etc." }, - [SMCA_UMC] = { "Unified Memory Controller" }, - [SMCA_PB] = { "Parameter Block" }, - [SMCA_PSP] = { "Platform Security Processor" }, - [SMCA_PSP_V2] = { "Platform Security Processor" }, - [SMCA_SMU] = { "System Management Unit" }, - [SMCA_SMU_V2] = { "System Management Unit" }, - [SMCA_MP5] = { "Microprocessor 5 Unit" }, - [SMCA_NBIO] = { "Northbridge IO Unit" }, - [SMCA_PCIE] = { "PCI Express Unit" }, + [SMCA_LS ... SMCA_LS_V2] = { "Load Store Unit" }, + [SMCA_IF] = { "Instruction Fetch Unit" }, + [SMCA_L2_CACHE] = { "L2 Cache" }, + [SMCA_DE] = { "Decode Unit" }, + [SMCA_RESERVED] = { "Reserved" }, + [SMCA_EX] = { "Execution Unit" }, + [SMCA_FP] = { "Floating Point Unit" }, + [SMCA_L3_CACHE] = { "L3 Cache" }, + [SMCA_CS ... SMCA_CS_V2] = { "Coherent Slave" }, + [SMCA_PIE] = { "Power, Interrupts, etc." }, + [SMCA_UMC] = { "Unified Memory Controller" }, + [SMCA_UMC_V2] = { "Unified Memory Controller V2" }, + [SMCA_PB] = { "Parameter Block" }, + [SMCA_PSP ... SMCA_PSP_V2] = { "Platform Security Processor" }, + [SMCA_SMU ... SMCA_SMU_V2] = { "System Management Unit" }, + [SMCA_MP5] = { "Microprocessor 5 Unit" }, + [SMCA_NBIO] = { "Northbridge IO Unit" }, + [SMCA_PCIE ... SMCA_PCIE_V2] = { "PCI Express Unit" }, + [SMCA_XGMI_PCS] = { "Ext Global Memory Interconnect PCS Unit" }, + [SMCA_XGMI_PHY] = { "Ext Global Memory Interconnect PHY Unit" }, + [SMCA_WAFL_PHY] = { "WAFL PHY Unit" }, + }; static void amd_decode_errcode(struct mce_event *e) From patchwork Tue Aug 10 17:22:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 12429241 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,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 68F0AC4338F for ; Tue, 10 Aug 2021 17:22:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5179960EB5 for ; Tue, 10 Aug 2021 17:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbhHJRXT (ORCPT ); Tue, 10 Aug 2021 13:23:19 -0400 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83]:49472 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229582AbhHJRXS (ORCPT ); Tue, 10 Aug 2021 13:23:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ekpesfYJhUOyO1W6zhvGDnSgpEe5g4Wqnf1l+i/11KNIVD0Ul3FwvSC832pbVC8rVoKO7pum/F4msis/SpeuT6x4VLzO2hvPJ7e9y8k71lM2ie4iEcgidu0eWLTeDqNrAgQ/36i+fyYc68o3SeXMMJDMqiNe/7mfFn/OwtdqikyqDkf2ujMsYGP89rOTpW4X1btYUBO7kR7Oafie3m/yiM7E7/J5UW2T0PLaJACnHlXi3Oe7mIz5dKrGBgX+0ldddUrQ+6CgSNwxxkVwtH1+SlWnpgPzkdQtCwMkx5u0T23RlDYEHiGSKV+S7yJwcAnH3oGj/6O3i+q3wO9yt5+tAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nMa81uHlVm5wegPjFlwdcZGZl3Fu6WB87Z9c1wnFA+o=; b=BAMhRqvghHyLod9AhfGLYw5jMW78PDejI3zbxfCBEtCCxAq7d3YHvmY8RxmJQbC4O4JTdi1tgaQpAZYxlA34asSJRTmXHqHqloQF+W08YkHSeyXky8ijLV2TLnlWnJHvCW3dJDvlA9QgNTScJcBrN7DPy3tyP3M3jAEIqPx05CLmce0dpOYSpnnfAVC9iq4VQJ9K55wAvjB7ff5OzWwZc9Y5ncgzUPlifrR3o4et3tuKumqN96muPH5ZYIPvH/vhS/DGN+9JxA2JbeWGnTkC13oYbzli6epbpvS4IlfPoIuDa0WRZtAdk/3YtDymz+/ozHE5/MECMSPWUAjSmJXskQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nMa81uHlVm5wegPjFlwdcZGZl3Fu6WB87Z9c1wnFA+o=; b=gthmjzYJNRJ3Iu5AmuWVJcTRfl38MFdV2VZStdRn8fNCQbv87dFXGM4x2MTVDlIiqMxeUt9T7uUtPCT6at6aEMkiNRnFUawqxgWkWznhUURE2xWaosENZDcvujyu++Tt3sG/yyoO39w36xb+1Q58lV0AHX5gVSZJ+ISTwxSSEzc= Received: from MWHPR19CA0024.namprd19.prod.outlook.com (2603:10b6:300:d4::34) by MWHPR12MB1359.namprd12.prod.outlook.com (2603:10b6:300:11::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Tue, 10 Aug 2021 17:22:54 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:300:d4:cafe::89) by MWHPR19CA0024.outlook.office365.com (2603:10b6:300:d4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Tue, 10 Aug 2021 17:22:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4394.16 via Frontend Transport; Tue, 10 Aug 2021 17:22:54 +0000 Received: from milan-ETHANOL-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 10 Aug 2021 12:22:51 -0500 From: Naveen Krishna Chatradhi To: CC: , , , , , Muralidhara M K Subject: [PATCH 2/4] rasdaemon: set SMCA maximum number of banks to 64 Date: Tue, 10 Aug 2021 22:52:12 +0530 Message-ID: <20210810172214.134099-3-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210810172214.134099-1-nchatrad@amd.com> References: <20210810172214.134099-1-nchatrad@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66e75b42-d296-440a-6ebb-08d95c237d2a X-MS-TrafficTypeDiagnostic: MWHPR12MB1359: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:171; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QggA+7ruYBz9P1rMf2CFaVrgaiAWPm9gJJjWpvuu/Htj+8n/BWu7hAerSj+762D7SGSZjEdCiwoDj2LR1mX4S7lZKkAG+HQdZwEzvh3hI/8onGakEJYU+CYgTr03U/lz5E9LCNvCDXhTdUv7gNJZFYVWfcrjRA4ujuybTZawOal3bUMhts77FA+8pv8sMOHkA5qEKrn2gdMYpyjU3eDzm/fsEwa/cP+53D2QiH1ZkVCNfKIhN8ERB/1jFEZKgODcmIqbS7I+7gz19bZgRXtBIMsMgYv2MUzqFxH5p/oLABhOQ1XA4MED/QpmbhMSEDul/iyneOIaYoGl5MpaOJU+eNi+HkIZw9SO+/O1i+gSks9PKQ2S3GFdBQcS2/qT6a+hYcgOrf6BP4AwFSSFvNPsZYUvjM9KsvNREQfh0E4M4epDap6aYM+Jewg5cpeCu4flZt0d+ED3oyiZkqNB/P/SkZa1mO+ZcsS5bMJlLUk9m0a2B32mrhnHbX+77hg5BwtI3pLKdX1kJOo652rAkYWhojRZRds+x7bjrHGlG9BiLITjWYYGIqcJJs4zZgwG2rzW9KP7umx2R3v9fKa3AHLlMucmkYThsajq8/3hXLy++LmC5kwgu9gu6MWn8oy4SGmC4oJ5cQy9jlu+wHCxZjE+eaKkHvWUipF3GNNxcuCXx39/CetvlISgU7g6ZLzeSeWjT4nEpKQBtJCGlHH2ZYwHiuBtYmoAqD6tKBZGY9It6x+TRLz6/nfkIZ2Jx2HQXGipu2gYS7HD73R8wedn37IdUA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(81166007)(356005)(8936002)(36756003)(83380400001)(316002)(34020700004)(82310400003)(8676002)(6916009)(336012)(508600001)(16526019)(2906002)(26005)(36860700001)(186003)(4326008)(54906003)(5660300002)(15650500001)(70586007)(70206006)(7696005)(6666004)(47076005)(426003)(1076003)(4744005)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2021 17:22:54.1600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66e75b42-d296-440a-6ebb-08d95c237d2a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1359 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K Newer AMD systems with SMCA banks support up to 64 MCA banks per CPU. This patch is based on the commit below upstremed into the kernel [a0bc32b3cacf194dc479b342f006203fd1e1941a] Signed-off-by: Muralidhara M K --- mce-amd-smca.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mce-amd-smca.c b/mce-amd-smca.c index e0cf512..3c346f4 100644 --- a/mce-amd-smca.c +++ b/mce-amd-smca.c @@ -75,6 +75,9 @@ enum smca_bank_types { N_SMCA_BANK_TYPES }; +/* Maximum number of MCA banks per CPU. */ +#define MAX_NR_BANKS 64 + /* SMCA Extended error strings */ /* Load Store */ static const char * const smca_ls_mce_desc[] = { From patchwork Tue Aug 10 17:22:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 12429243 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,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 B60A6C4338F for ; Tue, 10 Aug 2021 17:23:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8999D61073 for ; Tue, 10 Aug 2021 17:23:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbhHJRXX (ORCPT ); Tue, 10 Aug 2021 13:23:23 -0400 Received: from mail-bn1nam07on2079.outbound.protection.outlook.com ([40.107.212.79]:42334 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230262AbhHJRXW (ORCPT ); Tue, 10 Aug 2021 13:23:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hrj6bD+Z5c8vFmeqm+6iYbiEm7Zd3Bydc6UCN3OB+UcBp/p8e1FfkdBVhrpCY3C+0sKF1B7UMN9FYOmNLIpsZr9tpUbQYiII5AU+DRGl0/ROn+ZsWYqL/lE7qGTJuWtZA8T2RiZiS519qE7He/rL20uOKbZYlGS+mBX8CDUjxzMeI9Os4RQlx0iplsRUbj9mArYfY2uZ0DQgBx+FxLRZS75d16ahwOLIJb9M1biSL7PCZIdK4o7LEd9vpeUwLLomQchmw+0QnOcYPuzaTk35qUoo6XAav9EgEU6jGvG0RZf95DoO1EjHXWgiQHGuE6Hl1zBVREQkTtFLhZfvGPyeeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QE9XDASmNn6+nO/shQlVtLnBXIJ0fS0NDRT9s4fGWP0=; b=WaiXH7dLYCnQrhYa91Ljh3JcCj6tx5QOcxduMN4Xh4r+5qlD50NToEx1cOqsF6nBD6161g7pkKWXNsmgBQy6fghi+xOREokl7IVkxdQkrm5d8COfIkgDkjo6w9QXnzKKMmptyylgAIDkQmrGg9eeJfDyYzEkvVLNwH6T8txEveMCPbigi0nzHPkBzS37pa+DlSdHVe1Kbv63pceY3GawJgzZITxn6IUNYplsSkJnJOvk48ZUjoU9BD+Hnk+I/mfLIYycXSQKd5UpAEOiSMN63qJ0/LkRAcDV9d/bbbgILIS08ruB/EhbxAy5ljdt6YKYy0xxd01FjNu0cYKOrKtHCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QE9XDASmNn6+nO/shQlVtLnBXIJ0fS0NDRT9s4fGWP0=; b=oKISedRJ5yemn/B7lUmwtoK5nxhvb1il9bZQQSoLCyAeFaD/RjdexTi7ZizmDVhBgKEkOJTv5gRrR6x5N+jhghL+V3D57CKjy1mD3blr46jO9VNj3t4O7j74yTCMgw6wh7Lmm6kZWjEr3YGVdKFJfzeT+1cz5+8PXixPr6Nnnzc= Received: from MWHPR19CA0008.namprd19.prod.outlook.com (2603:10b6:300:d4::18) by DM6PR12MB4417.namprd12.prod.outlook.com (2603:10b6:5:2a4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Tue, 10 Aug 2021 17:22:58 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:300:d4:cafe::a7) by MWHPR19CA0008.outlook.office365.com (2603:10b6:300:d4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Tue, 10 Aug 2021 17:22:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4394.16 via Frontend Transport; Tue, 10 Aug 2021 17:22:57 +0000 Received: from milan-ETHANOL-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 10 Aug 2021 12:22:55 -0500 From: Naveen Krishna Chatradhi To: CC: , , , , , Muralidhara M K , Naveen Krishna Chatradhi Subject: [PATCH 3/4] rasdaemon: Enumerate memory on noncpu nodes Date: Tue, 10 Aug 2021 22:52:13 +0530 Message-ID: <20210810172214.134099-4-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210810172214.134099-1-nchatrad@amd.com> References: <20210810172214.134099-1-nchatrad@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf0140cd-d137-4e10-dfe4-08d95c237f6a X-MS-TrafficTypeDiagnostic: DM6PR12MB4417: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zkNzlJanGYHOJtRHu0PEZAgXMZlMDGyGFg0IGzERXvUklMIVsprcU1mDKmJLI8bhJd3VU6D1lL4L/qVaR+RT25GXrw3i8Qj/lJTPLPKt6mQ4aKl6bMEHMbjNOSVpxAZkO7Cp5TAnNsYOUNJuBCDFuUjYRMpRwnpG5ENzSOy494ONTtayHpL05PAVsbTtD41IcCzIg+30MMWW7F3ZFYI/A4toIzeNxfPjdNEG9AdgoAI6NLoy4Ac6iQZhhRB5zi10cHC6Xz1hZXoWTTC2S7XqY7wqD079usTYoQCHmEjpK1nNbIaPSR1g2PyA7uXGu4/zmGQbgYesmUvxSUgqcWZ/GGeXtkfYI+40r4rsO7dNPysP/4JtfGFKw5QQF9cdF/WuG2T1FwWl7oIRuyHnxGi2GFVcBVOamQPhNCVEANQRGt8kZVvkrXtMlu/0+GUvnuEg8xuHJmsUexCboUqrzVW3ZhDohU8NEB4lLAx/LmqrcFfRwdoyvhJDO23E7E94HRcH6df8t9YyZlrvAuuYpg6OkxL7WZHl0OnIP22oGDwkUJ8bcYHQITgQUOm2Y/4anuVtZI6EsfGGpwCEgXAVVzdOp82hZftaxMHaPEw03zMq5qPi0aG6Z42kgAt1uK/ot6pE9xIlPVKMHpoXUeeR62lD/T1EEZXGpR5fekmy5NHPq/y2WZm2hGjWgJw4yXoKXLwxU9c/e3haiRvH/lrtwE87P1UFZfTcPFnoU1BbmqLVY/vx8lZrKDbuYKReUr0AeR4qJoswWg4TvAXwOiksyAA1Mg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(136003)(396003)(376002)(346002)(39860400002)(36840700001)(46966006)(2906002)(26005)(186003)(81166007)(8936002)(356005)(36756003)(2616005)(4326008)(34020700004)(6666004)(316002)(16526019)(82310400003)(5660300002)(1076003)(83380400001)(47076005)(7696005)(426003)(82740400003)(70206006)(70586007)(336012)(8676002)(54906003)(478600001)(6916009)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2021 17:22:57.9358 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf0140cd-d137-4e10-dfe4-08d95c237f6a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4417 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K On newer heterogeneous systems from AMD with GPU nodes (with HBM2 memory) connected via xGMI links to the CPUs. The node id information is available in the MCA_IPID[47:44](InstanceIdHI) register. The UMC Phys on Aldeberan nodes are enumerated as csrow The UMC channels connected to HBMs are enumerated as ranks. Signed-off-by: Muralidhara M K Signed-off-by: Naveen Krishna Chatradhi --- mce-amd-smca.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/mce-amd-smca.c b/mce-amd-smca.c index 3c346f4..9381aa1 100644 --- a/mce-amd-smca.c +++ b/mce-amd-smca.c @@ -78,6 +78,16 @@ enum smca_bank_types { /* Maximum number of MCA banks per CPU. */ #define MAX_NR_BANKS 64 +/* + * On newer heterogeneous systems the data gabrics of the CPUs and GPUs + * are connected directly via a custom links, like is done with + * 2 socket CPU systems and also within a socket for Multi-chip Module + * (MCM) CPUs like Naples. + * The first GPU node(non cpu) is assumed to have an "AMD Node ID" value + * of 8 (the second GPU node has 9, etc.). + */ +#define NONCPU_NODE_INDEX 8 + /* SMCA Extended error strings */ /* Load Store */ static const char * const smca_ls_mce_desc[] = { @@ -531,6 +541,26 @@ static int find_umc_channel(struct mce_event *e) { return EXTRACT(e->ipid, 0, 31) >> 20; } + +/* + * The HBM memory managed by the UMCCH of the noncpu node + * can be calculated based on the [15:12]bits of IPID + */ +static int find_hbm_channel(struct mce_event *e) +{ + int umc, tmp; + + umc = EXTRACT(e->ipid, 0, 31) >> 20; + + /* + * The HBM channel managed by the UMC of the noncpu node + * can be calculated based on the [15:12]bits of IPID as follows + */ + tmp = ((e->ipid >> 12) & 0xf); + + return (umc % 2) ? tmp + 4 : tmp; +} + /* Decode extended errors according to Scalable MCA specification */ static void decode_smca_error(struct mce_event *e) { @@ -539,6 +569,7 @@ static void decode_smca_error(struct mce_event *e) unsigned short xec = (e->status >> 16) & 0x3f; const struct smca_hwid *s_hwid; uint32_t mcatype_hwid = EXTRACT(e->ipid, 32, 63); + uint8_t mcatype_instancehi = EXTRACT(e->ipid, 44, 47); unsigned int csrow = -1, channel = -1; unsigned int i; @@ -548,14 +579,16 @@ static void decode_smca_error(struct mce_event *e) bank_type = s_hwid->bank_type; break; } + if (mcatype_instancehi >= NONCPU_NODE_INDEX) + bank_type = SMCA_UMC_V2; } - if (i >= ARRAY_SIZE(smca_hwid_mcatypes)) { + if (i >= MAX_NR_BANKS) { strcpy(e->mcastatus_msg, "Couldn't find bank type with IPID"); return; } - if (bank_type >= N_SMCA_BANK_TYPES) { + if (bank_type >= MAX_NR_BANKS) { strcpy(e->mcastatus_msg, "Don't know how to decode this bank"); return; } @@ -580,6 +613,16 @@ static void decode_smca_error(struct mce_event *e) mce_snprintf(e->mc_location, "memory_channel=%d,csrow=%d", channel, csrow); } + + if (bank_type == SMCA_UMC_V2 && xec == 0) { + /* The UMCPHY is reported as csrow in case of noncpu nodes */ + csrow = find_umc_channel(e) / 2; + /* UMCCH is managing the HBM memory */ + channel = find_hbm_channel(e); + mce_snprintf(e->mc_location, "memory_channel=%d,csrow=%d", + channel, csrow); + } + } int parse_amd_smca_event(struct ras_events *ras, struct mce_event *e) From patchwork Tue Aug 10 17:22:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 12429245 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,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 D2EECC432BE for ; Tue, 10 Aug 2021 17:23:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1E6660EC0 for ; Tue, 10 Aug 2021 17:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbhHJRX1 (ORCPT ); Tue, 10 Aug 2021 13:23:27 -0400 Received: from mail-bn8nam11on2051.outbound.protection.outlook.com ([40.107.236.51]:43873 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229582AbhHJRX0 (ORCPT ); Tue, 10 Aug 2021 13:23:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cdu8jdWkGKzeCAdRkpbdokfU0bRFndKeMQkVxx3CHAOzQjGSPVhYis0ZJeWKLoKcrjjWi+hDhEerwTQo6TIUtXTI/76rr5mY+z77JeGx/yf/CrmVVaqpIMccx1mlaOYjcsXYZ7dLSYH2+aAx+TXyeBaFEkPxIrWd8uFkZhLJPtsh3ZRLcmOr3wyJuTwKMe/g/BLlnSwhgMzTeDzdez/prEtyQvwHFeD4cmgMua4BoKu7vLOXeQgTXM0EaXBHjzxTRhF/VW2N6yJcowEZrtXZsJ6h3r/u5DaEJpNvaw/Ud7DnhHprzI76mjxRHQjhd+kvcXgqbLzLU9TVqRr5nURk6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nRrxuVRTI+PoZEteeDNrCJsnPWzYNUaipkancwLpO4M=; b=RuCq0uD9L2ZBRskGcLiXmMGUGJKJI9zthTeXOz/oij7pISPaFA5PZBdSz7cD6bOHGAzUiQiBeDCi4VDUyU1qUeWBaEYgoeXBi2IsGncgwour1QIHlcyy/5zCbUAG3xO2CGTSCnmpzWrR+KGZhbLOy0UDptvmOgzh31QY+LdLiHdhmPz7trB3x8NHBtbJF8g0kLmWD5WdgEDi/3/RjV1Y5EusUq5KAXiDwzLeZUlbtmLf5FTv4dNNtRLkk9++1bQRpC5dMmtaGx5CeiPdjQ42XQEK/aKytWOo1X/A4EpKvRKxooNzkvRjhNDMT3I8JJ99no7lBKAOmUgmeZ4ZpHuMkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nRrxuVRTI+PoZEteeDNrCJsnPWzYNUaipkancwLpO4M=; b=VlXt8xIrQUTCWNmoKsUzzO04WmEYolWBR597k9jHBAi4IigGJ+npmVEYEag+WTuHIrV4G4rlINxCSyqtAizPjHFpGk8FW9ks5lAugEETaVM0eQUmvlbvhYt138aZ/PfPU2xLsQyZxbFCyLn5Z8F879hcHuir44IVhlrRFgLsxYM= Received: from MWHPR19CA0008.namprd19.prod.outlook.com (2603:10b6:300:d4::18) by BL1PR12MB5334.namprd12.prod.outlook.com (2603:10b6:208:31d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.22; Tue, 10 Aug 2021 17:23:03 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:300:d4:cafe::d5) by MWHPR19CA0008.outlook.office365.com (2603:10b6:300:d4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Tue, 10 Aug 2021 17:23:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4394.16 via Frontend Transport; Tue, 10 Aug 2021 17:23:02 +0000 Received: from milan-ETHANOL-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 10 Aug 2021 12:22:59 -0500 From: Naveen Krishna Chatradhi To: CC: , , , , , Muralidhara M K Subject: [PATCH 4/4] rasdaemon: Support MCE for AMD CPU family 19h Date: Tue, 10 Aug 2021 22:52:14 +0530 Message-ID: <20210810172214.134099-5-nchatrad@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210810172214.134099-1-nchatrad@amd.com> References: <20210810172214.134099-1-nchatrad@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0821693e-142f-4108-06da-08d95c238260 X-MS-TrafficTypeDiagnostic: BL1PR12MB5334: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0aedL1TFRLPFgA+4zuf4FjxdukqHvSy8hHp8wdbsoscvYmVw/KF9Z6SqNiIyoopSDz5jaUoxtQtb36FgRUv9Q3VjKLLlB8N8G4vLLjYIQNJblzZX/i8l7U9dmrEgEm74KIeV2ZBYBRsL4/hDiEdqu/4GpwCrZtvCPDfCmGVuVxVjcjoJ5k3GiXyZrK/REUXSpslTd9uYxj4PBLYtIMXe4xR/kjJtHG176SRgwUxa3UfCMR6tq7LObf3DY5r9IfqC+sbXRp0/sF6bYyaGa3SKdBCM/8zviXF22154gcViQpg+JUzmq+I6JGK0iwFR6SGfZVIMGJvueXDaDX9O2vw0YS/z2pvDz6wSPokW7yKF7fI9Plok5EWBmicW5IMuS70AfEZ4MSvrXlmiRwIVNFf/NBLCcQW3Y9gFEeQPI9I3ELvhhM9YNL4J//zoZSVvg07Dz/IvvUxRiE6HB2WENT5t1vunWnb6S4SLLVSqw8b6eVOmE5XAMEx7MKO4isBXkFr8BhqTwxAwFHjl860QfU1s0uKgSLZu4469jwjmVSzvCcv0n11jvSLtCEQ2dT+ZUsGEgLPmB2WFm2XCoTM6bHwsLJuiwimxALlQzSil0noK9hZUb8QyTaBppMTLlnTX3VrZOwDu6V8jtTUcFWTMDia/60qrmShE99i5VBdXSD6W+YqYhLB6CahrYJ7Ao/IiTLmUQRO50Ec3n/Mtc4GUiWHcIluUDoSMFLTc8tAeZjXirz9kBVqG6q1k3cilZdz0EntEobe0oNgcVdZCETXZ+DpaMg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(39860400002)(376002)(136003)(396003)(346002)(36840700001)(46966006)(316002)(83380400001)(6666004)(36756003)(7696005)(336012)(8676002)(356005)(34020700004)(82310400003)(26005)(8936002)(1076003)(54906003)(478600001)(16526019)(186003)(5660300002)(81166007)(2616005)(47076005)(6916009)(36860700001)(70586007)(426003)(82740400003)(4744005)(4326008)(70206006)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2021 17:23:02.8978 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0821693e-142f-4108-06da-08d95c238260 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5334 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K Add support for family 19h x86 CPUs from AMD. Signed-off-by: Muralidhara M K --- ras-mce-handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ras-mce-handler.c b/ras-mce-handler.c index 805004a..f2b53d4 100644 --- a/ras-mce-handler.c +++ b/ras-mce-handler.c @@ -208,7 +208,7 @@ static int detect_cpu(struct ras_events *ras) mce->cputype = CPU_AMD_SMCA; goto ret; } - if (mce->family > 23) { + if (mce->family > 25) { log(ALL, LOG_INFO, "Can't parse MCE for this AMD CPU yet %d\n", mce->family);