From patchwork Mon Jan 16 19:11:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naik, Avadhut" X-Patchwork-Id: 44292 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1358996wrn; Mon, 16 Jan 2023 11:17:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXs3KEsyouKgReo8AHbWPSdsoYi0SLTFuyQsgiKOhZ6NLhk/yZZSrkCoHkuw2KdbQ4cEb4F2 X-Received: by 2002:a17:907:88cd:b0:859:5541:f3ff with SMTP id rq13-20020a17090788cd00b008595541f3ffmr118329ejc.32.1673896659319; Mon, 16 Jan 2023 11:17:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673896659; cv=pass; d=google.com; s=arc-20160816; b=oCYO1SiQSiMZmTAKasOL64vWtxE1jrQYX4MpfFD7WSBrnFVIj7Mn0eIiGT3yHruRz8 /yUPGZ52e4Gm7phOYpVklXntBAlEpI/0MIeCrY8G63t49cYxT1AnNTgk0fLqOeiybmkF ru6UOSZP22eiji2rg1aKP749HUUcrlZupZHadQT90Fx2c47S/7HWZPZvBD/D/FiCodgD /BQt3duMVYp4l9jxjbqBNoECbismDpMjtIo6zHOaXguoqP/y5hFwXCpmSaVTaFXLohAZ biXtw8OVMErP7hrv/5X6ys93nBgPrWOn7xzU9hcj6imgtwbtiaK54qN5aFESwffhsLT6 xlHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/Icv+0UWzPk1NtrCsyOwSlM+I2N7pyx/9kkzqrUot3o=; b=pRvjfNL7L2IrNgFEdXT3S93r/MKPDFnjQwILITUKi1zG8/IT0HgApTESV+JQvrNNdw jc1bn+PrqNIPzYTA6xkYoX7DROpndzJwyFz1Te06nRrFOVk5Fpptv4z44A+7dlwi1W5I 6cNL2Y828c7gvOF5k9E3Ns0zveJyOP9KGFvn1uaLFurcvyh/dl4e0IJyajyj6i0DdNZn sKY8ldxgwgl6sAzk/xHucosQrddsp1gJq+1eAyHVdyO1gADsW5EKxYlI32+SORlVjp5P YaNhiwS6KCcs8YzqsXpm6jAHmWgy99qdHwOkV6JVpIb95PMnMx0Tmt3toI2BxMgjvFpz L1XA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=StLSUvZA; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq24-20020a1709073f1800b0086c669eab27si8513009ejc.16.2023.01.16.11.17.15; Mon, 16 Jan 2023 11:17:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=StLSUvZA; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232666AbjAPTLb (ORCPT + 99 others); Mon, 16 Jan 2023 14:11:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232625AbjAPTLY (ORCPT ); Mon, 16 Jan 2023 14:11:24 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2055.outbound.protection.outlook.com [40.107.244.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0287E1CAC2; Mon, 16 Jan 2023 11:11:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hX9NSOeNPSsQLnookRJrj4Zdr3+LqlvRNXCCfEUO4VnKZEO5GtAh+1QEoY+GvE7hETIWf4pEEM5lpnMErXv9wYDPLEJpGRP2KAcibDVDIvU4GZn8yoHgvZwb7ZOvwzHFW9yc+J6jeW8ZeazpSeqHmS6wS5aTqljpKz/T2Sb9B3Fu7x5PYTSjrkPJzJGcNXff8RU3g0dIsko33RrLi5bHsNBpXUsY++bTpU18+ZCKfvm0ipfZ/pMFyNU2rmeLJnJRueJQCts1D7y4evQ+1E3oi/AQSgmWYgF/N99lq6AArx+czA7Cbh/SgBYogVggtA+JtL/uOEEBisCuPZoLezTBTg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/Icv+0UWzPk1NtrCsyOwSlM+I2N7pyx/9kkzqrUot3o=; b=Tk2LkZ6/f3vxrpj+m3PBlmwraR+6It6dTWIrtSmNRtVRZk+Gr/7NHzQh5hrovTmDETn+lszwayW4H0wnm+OvAUsSc6MSvEJaD8u6YCHUbIPr2boiYhZTJBMKHvnaDfoo/aPIzHGuhsN9buO/ZKATP4g6laLHLZmiz7/3NvJToqLnB9XJBbTW8K6Vlzv3TMAK2w3zja6frdh/iKM3rm3O1Vt5Vuai8jgqezchUEMNxtyVyyOKqL0MNriAcntth+6O/Y6L/oBwmK/w+gk0rAZHj5kxK4spN03Jr2BuYhskqvoxBado1KgGhvAQc1TuVermsxNyke8ikODhGKBvv2FmLA== 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=/Icv+0UWzPk1NtrCsyOwSlM+I2N7pyx/9kkzqrUot3o=; b=StLSUvZAO/n+rupXzpv8WkALafOvI0gSJ5+Qk2UufFRI6ciNqRVCOb/IIrTHX2bhEcT0L949m96BYpHGnY0Fyz+xpcfE0aesiAo/0mEBZFz4/4yVom4qdrFrlNx7t2NJ6Fzj6mSxk+9hRjtvGxoV/+llzuRz5U6xd1yNcAPHyx4= Received: from MW4PR04CA0124.namprd04.prod.outlook.com (2603:10b6:303:84::9) by DS7PR12MB6096.namprd12.prod.outlook.com (2603:10b6:8:9b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Mon, 16 Jan 2023 19:11:21 +0000 Received: from CO1NAM11FT070.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::3d) by MW4PR04CA0124.outlook.office365.com (2603:10b6:303:84::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Mon, 16 Jan 2023 19:11:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT070.mail.protection.outlook.com (10.13.175.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Mon, 16 Jan 2023 19:11:20 +0000 Received: from onyx-7400host.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.2375.34; Mon, 16 Jan 2023 13:11:19 -0600 From: Avadhut Naik To: , CC: , , , , Subject: [PATCH v1 1/3] EDAC/mce_amd: Update SMCA bank error descriptions Date: Mon, 16 Jan 2023 19:11:00 +0000 Message-ID: <20230116191102.4226-2-avadnaik@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230116191102.4226-1-avadnaik@amd.com> References: <20230116191102.4226-1-avadnaik@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-TrafficTypeDiagnostic: CO1NAM11FT070:EE_|DS7PR12MB6096:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c6a856a-789c-4649-221c-08daf7f573ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uj0EkGVj5Dr/lSsyQnjTGQt49MZbqZFPiNVlNFba40P6HIW0emovREIFW/eCxFAOLewfz0fIDtKya6RGFZFw4aiMpMlSWkFILTm3XNtbp0+EYLmsKCcd2/ck3e/w4wOQy9gsywwYXpL5ZP+yID57cNL1i+vv0ji+pl4BUBqaUhjqh9y30PkBtYH7NRvz+U2BWAfJqlAbbyp3al0s3lHa4Dz5I8k7DSo+wTOFK+0/AremHMA4P1ZSHzoeh+y2HxHOb+BQLxcxzFUWpB8SpUq3XVY7z9oqqxNk8tIOZSOY9LQ2dgHFhw7umQrLuWhAesSHuAbdWIxfDeSm+RKVRQo2sqfcszLrAynRUfnG1Nr8KwcrZImmZ0kOu9MEzsESKpADndDSO3k9OXhf3f+C7SOIKJ6Cc6qQ8UCcJMx/WJARue+nR/SEOPbZe0h42ZuQT7i4ST4m5VSX6jASoPhNAYaVtmU1a0lcc/HQ57vSIVoeVhjVFjrYLvdavLDytcmkTnRnVF9v7An1wUFLlrPU+7B2L1C0kHe7h/IfVIFYXqjXH2z01JWCyGVnQckdF9o3zHumUZedQpuImst2S18pNzKKvkLGYDLtoQWj3QfBfv+ehqn1NLifc8opGkeARCI+aHHLTx/hQP6F59j+9RxAorCLsVn22N1XZ6/ZWci6EONfqZM1uacVVD59QqhGHHDGMYTy7cj5UWT4t3JyQK6M3/8Re4xiU1sZgpFlX0FiuQiKg40= 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:(13230022)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(36756003)(82310400005)(16526019)(186003)(4326008)(8676002)(70206006)(426003)(70586007)(2616005)(47076005)(26005)(41300700001)(316002)(40480700001)(1076003)(83380400001)(7696005)(54906003)(110136005)(6666004)(478600001)(40460700003)(356005)(81166007)(15650500001)(2906002)(82740400003)(36860700001)(5660300002)(8936002)(336012)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 19:11:20.4402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c6a856a-789c-4649-221c-08daf7f573ad 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: CO1NAM11FT070.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6096 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755207863579566482?= X-GMAIL-MSGID: =?utf-8?q?1755207863579566482?= From: Yazen Ghannam Add new error descriptions to extend existing SMCA error decoding functionality for modern AMD processors. Additionally, also reword some existing error descriptions and remove the unused ones. [avadnaik: Add error descriptions for MPDMA SMCA bank, rework the commit message] Signed-off-by: Yazen Ghannam Signed-off-by: Avadhut Naik --- drivers/edac/mce_amd.c | 53 ++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index cc5c63feb26a..869dcca5e2f4 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c @@ -192,24 +192,24 @@ static const char * const smca_ls2_mce_desc[] = { "A SystemReadDataError error was reported on read data returned from L2 for an SCB store", "A SystemReadDataError error was reported on read data returned from L2 for a WCB store", "A hardware assertion error was reported", - "A parity error was detected in an STLF, SCB EMEM entry or SRB store data by any access", + "A parity error was detected in an STLF, SCB EMEM entry, store data mask or SRB store data by any access", }; static const char * const smca_if_mce_desc[] = { - "Op Cache Microtag Probe Port Parity Error", + "Op Cache Microtag Parity Error", "IC Microtag or Full Tag Multi-hit Error", "IC Full Tag Parity Error", "IC Data Array Parity Error", - "Decoupling Queue PhysAddr Parity Error", + "PRQ Parity Error", "L0 ITLB Parity Error", - "L1 ITLB Parity Error", - "L2 ITLB Parity Error", + "L1-TLB Parity Error", + "L2-TLB Parity Error", "BPQ Thread 0 Snoop Parity Error", "BPQ Thread 1 Snoop Parity Error", - "L1 BTB Multi-Match Error", - "L2 BTB Multi-Match Error", + "BP L1-BTB Multi-Hit Error", + "BP L2-BTB Multi-Hit Error", "L2 Cache Response Poison Error", - "System Read Data Error", + "L2 Cache Error Response", "Hardware Assertion Error", "L1-TLB Multi-Hit", "L2-TLB Multi-Hit", @@ -222,12 +222,13 @@ static const char * const smca_l2_mce_desc[] = { "L2M Tag or State Array ECC Error", "L2M Data Array ECC Error", "Hardware Assert Error", + "SDP Read Response Parity Error", }; static const char * const smca_de_mce_desc[] = { - "Micro-op cache tag parity error", - "Micro-op cache data parity error", - "Instruction buffer parity error", + "Micro-op cache tag array parity error", + "Micro-op cache data array parity error", + "IBB Register File parity error", "Micro-op queue parity error", "Instruction dispatch queue parity error", "Fetch address FIFO parity error", @@ -247,7 +248,7 @@ static const char * const smca_ex_mce_desc[] = { "Checkpoint queue parity error", "Retire dispatch queue parity error", "Retire status queue parity error", - "Scheduling queue parity error", + "Scheduler queue parity error", "Branch buffer queue parity error", "Hardware Assertion error", "Spec Map parity error", @@ -262,6 +263,7 @@ static const char * const smca_fp_mce_desc[] = { "Retire queue (RQ) parity error", "Status register file (SRF) parity error", "Hardware assertion", + "Physical K mask register file (KRF) parity error", }; static const char * const smca_l3_mce_desc[] = { @@ -270,9 +272,10 @@ static const char * const smca_l3_mce_desc[] = { "L3M Tag ECC Error", "L3M Tag Multi-way-hit Error", "L3M Data ECC Error", - "SDP Parity Error or SystemReadDataError from XI", - "L3 Victim Queue Parity Error", + "SDP Parity Error from XI", + "L3 Victim Queue Data Fabric Error", "L3 Hardware Assertion", + "XI WCB Parity Poison Creation Event", }; static const char * const smca_cs_mce_desc[] = { @@ -302,6 +305,10 @@ static const char * const smca_cs2_mce_desc[] = { "SDP read response had an unexpected RETRY error", "Counter overflow error", "Counter underflow error", + "Illegal Request on the no data channel", + "Address Violation on the no data channel", + "Security Violation on the no data channel", + "Hardware Assert Error", }; static const char * const smca_pie_mce_desc[] = { @@ -309,7 +316,9 @@ static const char * const smca_pie_mce_desc[] = { "Register security violation", "Link Error", "Poison data consumption", - "A deferred error was detected in the DF" + "A deferred error was detected in the DF", + "Watch Dog Timer", + "An SRAM ECC error was detected in the CNLI block", }; static const char * const smca_umc_mce_desc[] = { @@ -321,6 +330,10 @@ static const char * const smca_umc_mce_desc[] = { "Write data CRC error", "DCQ SRAM ECC error", "AES SRAM ECC error", + "ECS Row Error", + "ECS Error", + "UMC Throttling Error", + "Read CRC Error", }; static const char * const smca_umc2_mce_desc[] = { @@ -443,17 +456,12 @@ static const char * const smca_mpdma_mce_desc[] = { "MPDMA TVF SDP Master Memory 4 ECC or parity error", "MPDMA TVF SDP Master Memory 5 ECC or parity error", "MPDMA TVF SDP Master Memory 6 ECC or parity error", + "SDP Watchdog Timer expired", "MPDMA PTE Command FIFO ECC or parity error", "MPDMA PTE Hub Data FIFO ECC or parity error", "MPDMA PTE Internal Data FIFO ECC or parity error", "MPDMA PTE Command Memory DMA ECC or parity error", "MPDMA PTE Command Memory Internal ECC or parity error", - "MPDMA PTE DMA Completion FIFO ECC or parity error", - "MPDMA PTE Tablewalk Completion FIFO ECC or parity error", - "MPDMA PTE Descriptor Completion FIFO ECC or parity error", - "MPDMA PTE ReadOnly Completion FIFO ECC or parity error", - "MPDMA PTE DirectWrite Completion FIFO ECC or parity error", - "SDP Watchdog Timer expired", }; static const char * const smca_nbio_mce_desc[] = { @@ -461,7 +469,8 @@ static const char * const smca_nbio_mce_desc[] = { "PCIE error", "SDP ErrEvent error", "SDP Egress Poison Error", - "IOHC Internal Poison Error", + "Internal Poison Error", + "Internal system fatal error event", }; static const char * const smca_pcie_mce_desc[] = { From patchwork Mon Jan 16 19:11:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naik, Avadhut" X-Patchwork-Id: 44293 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1361585wrn; Mon, 16 Jan 2023 11:24:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXv2wXbx0rngTNb0J1RCo8B+iEJI7eTy24a4olZrgAq9GdUmPcFYQ+ZJYLlJaKw4A+i91N5O X-Received: by 2002:a05:6a20:3c8a:b0:b8:6583:b650 with SMTP id b10-20020a056a203c8a00b000b86583b650mr10081523pzj.12.1673897078295; Mon, 16 Jan 2023 11:24:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673897078; cv=pass; d=google.com; s=arc-20160816; b=InaC7k5riHkgnIbulmVrxL+9Qal4xqsa+QY4FgCE1g/RWaZJWBmuAKYWZAs8lklQhM RsGP06Vgtp3bqM2IjI0rue86mx74x3mj1RnhCSEiae0TfAnzR9EjzmcciUoJ7Dd09BQI djczB4mvM0QzGuWxegMNva3Bg+Z4WRUnGM5AhTYMTbth0A78L8JiEyWQkbBBA3DHG2jU o4eeGbeZNg7CXVTzZWLmM16P3u9KUx2SXzYcxj8yH96mwYjhz2f5cs21uThS3V9cCRgX 8MJtIpgzaPvQQ6yVGteKDDbP0XK2fTwF7TdyYo7ILWETg/2kScBGM0+uC9/lvQrVkwps jBFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hN2HxDRz9CijzijOXuIc91nDWFRsOWJOJIF4l4Wucuk=; b=XcY2imzq7C+BmdFG7baffLPnQ/agi6b/2vBHlmmOtlvR8HNKnimJZU3JNqiRfL1mXp zXLyip/GOQXT/8OA91a3xBJnHDbYE0bHIN/TbVZT+4oHcqnKkkMZodI7PW6/hIul15jg k2Ry1qLwrPxLnvzU/BZyKoNksgQaO/FtCwJEqacVPq4GBSZQYK8YF4FXcVn6Xa7TyDyX ac41Cp+IjwcS1Yv3TDujvjTxYiTVpZ3d2lzbGn616HeNmVyX3oUjfR0QCOzGyaACbCQV M9JjF5fQmsfjHgifutKvANyS9TQt+DauPtmoPU76czpOEofcOCh27wqxFekynX/KqPXE VKpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QXfLqB36; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a63790e000000b00499413885dasi30303064pgc.359.2023.01.16.11.24.25; Mon, 16 Jan 2023 11:24:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QXfLqB36; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232858AbjAPTLo (ORCPT + 99 others); Mon, 16 Jan 2023 14:11:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbjAPTLk (ORCPT ); Mon, 16 Jan 2023 14:11:40 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA482A173; Mon, 16 Jan 2023 11:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGSoDDBswBFkXrqhqpRWd1ua9MsZ8eiOUpSkf+Jky7rMPlTJpXtLEabPksmGnnx+/plifzRr58YX19F6S6JyjYWqatSrffLHPr89T3cwHWJ/cvvJ0FTowSodyiq09l9FzDFWQ7EG7KZoGE2p6+ZjdY7U9IdajZuzn9xa7l0VGfxtkzF10iy1gJoPGZlCJj1e1y96ssIez3JhG+o3+ggHXdTt3uOqlagBTs3nLXhl2PifHCSG6UraKiRBAgBEMxBEUxt6RYtxWlH5Xt6o3OJPoOuc5zvGAbuFGO1DnXVUUdl5LL3Er9RUl9KzmTL3Gt45MAagb5QNw9VDeqMduLBg9Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hN2HxDRz9CijzijOXuIc91nDWFRsOWJOJIF4l4Wucuk=; b=TTQYk7gf/KhFPKiMtrdBeXu5m1Xh/QmdI4rfHMvyucmENICNQRxpjI7qEMaJ5ClqWmN4OsBeBBLmYsHl7QfDJjjqAT0m55ws8s6zwZ4C8u2aL7rpYqI9YmLHZ6m6byMiWQusGlyC7tAS64cKoklAx+EYFTPbzPTUZwW3IFbMNxs8exVYf4D4Usc3YzlBqE/NKyzUteHISZbdOkF0+pAJpaiBjC/NYhbORzf/lBbiJgIgMtpj6AN539WtJHlajCzoQAe9fm1r7rVHVPogRD1XrOpINj7L3qyvUCMKsmDNFLQVBxzAaU3NwVSwkgR1LlIjAXKWmqkar8NJtQ9XhWpxmg== 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=hN2HxDRz9CijzijOXuIc91nDWFRsOWJOJIF4l4Wucuk=; b=QXfLqB36/SfX//l7nfBK7piGCel95FHoZULFs8l9h0WGaQmii9yt+8rgrW8dKqeHRM/l9KWGcuKV3SOD6jIp6hjKTvx3Evhn3bqvELafBSyvhWsUgGFtiolVDagD/xfK9XOGo5oPN+upj6wlmg/1Ub3v7KpNNc7wgL5zntOUmHs= Received: from MW4PR03CA0357.namprd03.prod.outlook.com (2603:10b6:303:dc::32) by DS7PR12MB8345.namprd12.prod.outlook.com (2603:10b6:8:e5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Mon, 16 Jan 2023 19:11:36 +0000 Received: from CO1NAM11FT085.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dc::4) by MW4PR03CA0357.outlook.office365.com (2603:10b6:303:dc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Mon, 16 Jan 2023 19:11:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT085.mail.protection.outlook.com (10.13.174.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Mon, 16 Jan 2023 19:11:36 +0000 Received: from onyx-7400host.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.2375.34; Mon, 16 Jan 2023 13:11:35 -0600 From: Avadhut Naik To: , CC: , , , , Subject: [PATCH v1 2/3] x86/MCE/AMD: Add HWID Fixup for PCS_XGMI SMCA Date: Mon, 16 Jan 2023 19:11:01 +0000 Message-ID: <20230116191102.4226-3-avadnaik@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230116191102.4226-1-avadnaik@amd.com> References: <20230116191102.4226-1-avadnaik@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-TrafficTypeDiagnostic: CO1NAM11FT085:EE_|DS7PR12MB8345:EE_ X-MS-Office365-Filtering-Correlation-Id: ae6a2550-cbcc-44df-5fd4-08daf7f57d41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4/K8Ktj1sGwNkxqdb/n3s8AfavPq4FDIc/Z4zFpSdlL1zvyWBuF010ay3f3xl3pqj11FZcSvN/i4egTG2nwTF4dQg6k/A3uh+gI3oMlkA1rIqc8DDvyQ8wMMZgayZZ8cqEtO96WI5jOauzpmw8WjSKxVsDK7URFQ1DIKaXQp10F3iSGjA9Q0f/WbcTex2lLGmKg5DUZFRYGYbKumazFYwl6a1WIqZ2lT859cd/AflJjv8jLHh+/sKM6sI8CFxPxReyoRAf42aXw66RgbmriFAnpcJbYh6PpuS2oHSWiNWf25DDL0Z5k3X/Vv2ksyOLokgr6LLB+U/s4SD+zp5zrbqXsLrP5wx1DZz500ZUSbswHfUy5N9UbC081x25iirs7zpmo91mA78+RN8AlNnzqJKry6h4BkEPrhQM1Vp7tUTkhz6Hl5gYdQTFYObu/Eh+9VJBvWWm5VHZWIC2axe9P4clO7k8UjLxZV6eCIE66c4SYdvdPH4b/tc4dQFX8oEFdCFZCOA9mWhAow56ZGFdI3VlxkpsbK8d/fyBdEH6jxt+EBPWaldd3BjRGhsScpRBUTWNfLzJLGp/Kma7rFiHh82HOjlzMOH08kFxAUhJePIGSv+28nlLAvhYNvN+EzBDK9VgEWIp89aIR+YeDAf24T7C4i/LBEEfO4HZECuYOpqwJQF5veTubvNnMSeiLNueg9OsplVOFOy/7I0ENC5MO3dGr/BUpcW0yXbZePQDfoa/Q= 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:(13230022)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(36756003)(356005)(5660300002)(82310400005)(40460700003)(8936002)(2906002)(40480700001)(36860700001)(47076005)(83380400001)(426003)(82740400003)(54906003)(110136005)(81166007)(41300700001)(478600001)(8676002)(6666004)(2616005)(7696005)(336012)(4326008)(316002)(70586007)(1076003)(70206006)(16526019)(186003)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 19:11:36.5112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae6a2550-cbcc-44df-5fd4-08daf7f57d41 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: CO1NAM11FT085.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8345 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755208303042616428?= X-GMAIL-MSGID: =?utf-8?q?1755208303042616428?= On AMD systems, during Scalable MCA (SMCA) initialization, the HWID and McaType tuple, read from MCA_IPID register of a SMCA bank type, is used by the kernel for populating the per-CPU smca_banks array. This very array is, in turn being utilized by the edac_mce_amd module for determining the SMCA bank type while decoding a machine check error. However, on some AMD CPUs, the HWID read from the MCA_IPID register for XGMI Controller SMCA bank type does not match the value expected by the kernel. Consequently, the smca_banks array is not populated for the bank type resulting in the machine check errors on the bank type not being decoded. As a solution, set the HWID, obtained from the MCA_IPID register, of the XGMI Controller SMCA bank type on affected CPUs, to the value expected by the kernel to ensure that the machine check errors on the bank type are correctly decoded. Signed-off-by: Avadhut Naik --- arch/x86/kernel/cpu/mce/amd.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c index 23c5072fbbb7..b0cce0ce056c 100644 --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -249,6 +249,30 @@ static void default_deferred_error_interrupt(void) } void (*deferred_error_int_vector)(void) = default_deferred_error_interrupt; +/* + * Errata encountered on AMD CPUs for some SMCA bank types requires fixup + * of HWID, read from MCA_IPID register, for accurate SMCA error decoding. + */ +static inline void fixup_hwid(unsigned int *hwid_mcatype) +{ + struct cpuinfo_x86 *c = &boot_cpu_data; + + if (c->x86 == 0x19) { + switch (c->x86_model) { + /* + * Handle discrepancy in HWID of kernel and MCA_IPID register + * for XGMI Controller SMCA bank type + */ + case 0x30 ... 0x3F: + if (*hwid_mcatype == HWID_MCATYPE(0x80, 0x0)) + *hwid_mcatype = HWID_MCATYPE(0x50, 0x0); + break; + default: + break; + } + } +} + static void smca_set_misc_banks_map(unsigned int bank, unsigned int cpu) { u32 low, high; @@ -321,6 +345,8 @@ static void smca_configure(unsigned int bank, unsigned int cpu) hwid_mcatype = HWID_MCATYPE(high & MCI_IPID_HWID, (high & MCI_IPID_MCATYPE) >> 16); + fixup_hwid(&hwid_mcatype); + for (i = 0; i < ARRAY_SIZE(smca_hwid_mcatypes); i++) { s_hwid = &smca_hwid_mcatypes[i]; From patchwork Mon Jan 16 19:11:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naik, Avadhut" X-Patchwork-Id: 44296 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1366463wrn; Mon, 16 Jan 2023 11:37:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXt7SwXQeltm7kRwuCBIgoprlTuJTHT7Wx5MLkKyuI9F9auCtqfEvLyYRAmqn0vEgV85AWsh X-Received: by 2002:a05:6a20:d39b:b0:af:7e01:706 with SMTP id iq27-20020a056a20d39b00b000af7e010706mr105606560pzb.52.1673897871111; Mon, 16 Jan 2023 11:37:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673897871; cv=pass; d=google.com; s=arc-20160816; b=D6UKYXqiiDySubS34UQ9SYZ7AWwxfUeLpsTaJDlHF5x5naidb1hUuJFnQo6XNyiOuz DM8EFzaAIndaqVBR93pMSZ3HnXL0esK9fmmZ6uHBoS+imIE/PjHIMBnh99X++a4laXbY 56/JdZHsxDzaVJo+EX0n7oKyduGupVQDnxasoo2nXMu4YXd84MseTSzZkIeGNhWHcn0x MHsULoMk/nVK6CEsT+aRUlFbE4t3FND2k3XjxEm31R0YwIQvLbU3G1cbUooQ65vmhZBO U+KehodK0bcrdvnTpWMK+y/J+22mdeG29ShfwadU1vAszAizTnO4gopngC4RDrh2u3mY 7bIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4wxRz8sHq7ijnnOkiEcewtmI6TapHvQYCMRerm1IFTI=; b=N7QMA64U4Ij9N83PfOMY9zHPSRpGVkxnoNTi8EhtnklnPR3WFHvqG7/Cf85iIm2sj1 hVgwEZGblAWyD0cwiRtJgDuG7ub9rD0W7D3q4wxfGQoKS7irLH2r/gxSlIFcudUoJXhw 6VppuOp+MyJWUbO7h8U585VO2L2/VTa+LFyJwhw+n5OJdp5lbIREHlAlV6OQ8bc8cnNl mrPTN79YDAVSWWButDKlgw8Ma/zCpBe+HvGpTHvhCJMKC/t33yjPE/ntXDLd1vIdiC2G WQUSg0FcQyJiXLL6HuVvJCsjSOrsUw20QhKQhTrv1rgLkIHQp+KsMGvm4nRWn7T+Shsq Qprg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=MntIhpMo; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k69-20020a638448000000b004c9e409c1f4si8491687pgd.772.2023.01.16.11.37.39; Mon, 16 Jan 2023 11:37:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=MntIhpMo; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbjAPTME (ORCPT + 99 others); Mon, 16 Jan 2023 14:12:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232332AbjAPTLw (ORCPT ); Mon, 16 Jan 2023 14:11:52 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2087.outbound.protection.outlook.com [40.107.237.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC292B08F; Mon, 16 Jan 2023 11:11:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ijwkPMUUJRfkuGpwTq/zQti241OMA8RO04nWJwA2tLmRmeDV0djQQZNt3i/7Tf83FK9ka4XiaWtn6/O7wXsiN+33DLPizwvQfopkSKj8aK7xP+K2N4LSeVcb8Edc4qAp0f700S9RcNZnGhvhTaaaEkxVRuhvBhk1SgfTWen9xkY9wB4R1hEkMJLmavjHLg56q120fd1aGvU4Yvx0w8nQf/z3B3aZXxmPFHkH2QG5+6/Sd06XDQhhJkFHjeFYBcGAyLAEQJhgRiHg87MrUItPj90nZJQ6wIAgeUqcICImxN4QaNbxjiCjkdm1jy2m425mysymnG7D9hEKddnW4zqoXw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4wxRz8sHq7ijnnOkiEcewtmI6TapHvQYCMRerm1IFTI=; b=XFPGq09e4VMR442dxGaCjeig4XsY5CAcvhKzYns9KQGQS8C+ztFzW3n//kzAv+e7f82gqULzbY/VyHwV7Y9bNNhYSvhGarQVHI5ICeWM3uwGdYOxexi6Fao3M+iTohu7KR+Nsfjb+JH0oV+iBnWo3GrGEpsikSyft3MDQUdQIhTbg3egWI2lDNb6Z8mPyXkwO+mFA/JFnZf45hnBX6ug0GU2VbSbh/1Wkk6Sd8bIoLhKirWTmPrJPaf4LzAkbBNu339LtZJb+/bqcjlPb1bZlXbaYLjnQ0mqOtjrG21hcOQ7zYTqDFqT6d6pcd7pjC3tlOaciCP8sfSflo47I2+tUw== 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=4wxRz8sHq7ijnnOkiEcewtmI6TapHvQYCMRerm1IFTI=; b=MntIhpMoMod70ifwhhfcuoprb4diJx4namet+JJZga/OjadVpTqr7NDt7/6DAM+9/I7Ct7dkO19yCdt8XRNKnfJ6tLD5pgox62EQLZy9zH5NNEPo5Hoc8/kD5uuHbvChCnR3Djcyo5kRjgUBSOk6nfr4YB9l++PTorqgrGT40VQ= Received: from MW4PR04CA0220.namprd04.prod.outlook.com (2603:10b6:303:87::15) by DM8PR12MB5447.namprd12.prod.outlook.com (2603:10b6:8:36::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Mon, 16 Jan 2023 19:11:48 +0000 Received: from CO1NAM11FT044.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87:cafe::42) by MW4PR04CA0220.outlook.office365.com (2603:10b6:303:87::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Mon, 16 Jan 2023 19:11:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT044.mail.protection.outlook.com (10.13.175.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Mon, 16 Jan 2023 19:11:47 +0000 Received: from onyx-7400host.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.2375.34; Mon, 16 Jan 2023 13:11:46 -0600 From: Avadhut Naik To: , CC: , , , , Subject: [PATCH v1 3/3] x86/MCE/AMD: Handle reassigned bit definitions for CS SMCA Date: Mon, 16 Jan 2023 19:11:02 +0000 Message-ID: <20230116191102.4226-4-avadnaik@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230116191102.4226-1-avadnaik@amd.com> References: <20230116191102.4226-1-avadnaik@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-TrafficTypeDiagnostic: CO1NAM11FT044:EE_|DM8PR12MB5447:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d542fdc-aaf7-4323-92c5-08daf7f5843f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ot6Ll6CSWD9DQ9FzQk1JpCsnDObNQDv9zxFpdeIDjvTUaFzLh4vf+La0B+WI12KZTmlEsateRTwYl8SNXDPHqnUygxZglNvlfxOSEg5Ypq8mdGcm+/be2ToVo/IeLpGWGoBpUUEZoeJDzlwxT9RxzHJHKSIZCYf+vYfHW0HzSI2iUCnGlG9xJWQlvc9XwnUyD+k0Rn1SW8LSYvWD/ps7bfsJFhLMKoSTyr9rccog3KXjZ0SmRhCw6NNDBpNLJhtDt5UIec2kDml5BjanDUpP86Aj7haNETG3fuqXKgtae09lLiQji3Jd9j4f8xZmorI6LXboPN6hvB7+hZZ8YTxD3ujDK+aVSgnHrePSlwysmIUesdiEKjGNvFgb9La2rCzbUXJFuZRsqgJjSCvdskD7ZQaMwD8LlOQ5yuhl6mfjF/TljH2j8Ckn3ZO2rCF7A8BfBp46vmb8oHeUAQ58eMAuAV5G/uTRxHr8K0yXc4AcwO9R3sa0/4zbgdDM6VzZgzeptLsS72GQfOe6vRXsHNcPj1+Ho5e/qaULs09ZR+xpf1dMwg3g9tonbOWz40Jczh4TY1x+ecwFtYa7mTePO+YP9ZTt/yhqPXnhshay9cYGEIPdnNK9ZzQIVLtxpXXEk+Kq66e0WyhSfE/ZixwfujpCCx5FT01RGFpyXnrTUlbDU8MRBgM9/gCXH8NwFyZDyTihzWgeZFMYXdpyhEsW8DXV4YG5YPuPcU1Bo+9rPrxpJ9U= 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:(13230022)(4636009)(376002)(396003)(136003)(346002)(39860400002)(451199015)(36840700001)(46966006)(40470700004)(36756003)(8936002)(356005)(70206006)(4326008)(70586007)(8676002)(5660300002)(2906002)(81166007)(83380400001)(82740400003)(36860700001)(478600001)(316002)(40460700003)(7696005)(6666004)(110136005)(54906003)(40480700001)(82310400005)(41300700001)(47076005)(1076003)(426003)(336012)(26005)(2616005)(16526019)(186003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 19:11:47.9778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d542fdc-aaf7-4323-92c5-08daf7f5843f 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: CO1NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5447 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755209134205402515?= X-GMAIL-MSGID: =?utf-8?q?1755209134205402515?= Currently, on AMD systems with Scalable MCA (SMCA), each machine check error of a SMCA bank type has an associated bit position in the bank's control (CTL) register used for enabling / disabling reporting of the very error. An error's bit position in the CTL register is also used during error decoding for offsetting into the corresponding bank's error description structure. As new errors are being added in newer AMD systems for existing SMCA bank types, the underlying SMCA architecture guarantees that the bit positions of existing errors are not altered. However, on some AMD systems viz. Genoa, some of the existing bit definitions in the CTL register of the Coherent Slave (CS) SMCA bank type are reassigned without defining new HWID and McaType. Consequently, the very errors whose bit definitions have been reassigned in the CTL register are being erroneously decoded. As a solution, create a new software defined SMCA bank type by utilizing one of the hardware-reserved values for HWID. The new SMCA bank type will only be employed for CS error decoding on affected CPU models. Additionally, since the existing error description structure for the CS SMCA bank type is still valid, add new error description structure to compensate for the reassigned bit definitions. Signed-off-by: Avadhut Naik --- arch/x86/include/asm/mce.h | 1 + arch/x86/kernel/cpu/mce/amd.c | 24 +++++++++++++++++++++++- drivers/edac/mce_amd.c | 26 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 9646ed6e8c0b..d0442b4147b5 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -308,6 +308,7 @@ enum smca_bank_types { SMCA_L3_CACHE, /* L3 Cache */ SMCA_CS, /* Coherent Slave */ SMCA_CS_V2, + SMCA_CS_V2_QUIRK, SMCA_PIE, /* Power, Interrupts, etc. */ SMCA_UMC, /* Unified Memory Controller */ SMCA_UMC_V2, diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c index b0cce0ce056c..317307772048 100644 --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -101,7 +101,7 @@ static struct smca_bank_name smca_names[] = { [SMCA_EX] = { "execution_unit", "Execution Unit" }, [SMCA_FP] = { "floating_point", "Floating Point Unit" }, [SMCA_L3_CACHE] = { "l3_cache", "L3 Cache" }, - [SMCA_CS ... SMCA_CS_V2] = { "coherent_slave", "Coherent Slave" }, + [SMCA_CS ... SMCA_CS_V2_QUIRK] = { "coherent_slave", "Coherent Slave" }, [SMCA_PIE] = { "pie", "Power, Interrupts, etc." }, /* UMC v2 is separate because both of them can exist in a single system. */ @@ -178,6 +178,8 @@ static const struct smca_hwid smca_hwid_mcatypes[] = { { SMCA_CS, HWID_MCATYPE(0x2E, 0x0) }, { SMCA_PIE, HWID_MCATYPE(0x2E, 0x1) }, { SMCA_CS_V2, HWID_MCATYPE(0x2E, 0x2) }, + /* Software defined SMCA bank type to handle erratum 1384*/ + { SMCA_CS_V2_QUIRK, HWID_MCATYPE(0x0, 0x1) }, /* Unified Memory Controller MCA type */ { SMCA_UMC, HWID_MCATYPE(0x96, 0x0) }, @@ -259,6 +261,17 @@ static inline void fixup_hwid(unsigned int *hwid_mcatype) if (c->x86 == 0x19) { switch (c->x86_model) { + /* + * Per Genoa's revision guide, erratum 1384, some SMCA Extended + * Error Codes and SMCA Control bits are incorrect for SMCA CS + * bank type. + */ + case 0x10 ... 0x1F: + case 0x60 ... 0x7B: + case 0xA0 ... 0xAF: + if (*hwid_mcatype == HWID_MCATYPE(0x2E, 0x2)) + *hwid_mcatype = HWID_MCATYPE(0x0, 0x1); + break; /* * Handle discrepancy in HWID of kernel and MCA_IPID register * for XGMI Controller SMCA bank type @@ -270,6 +283,15 @@ static inline void fixup_hwid(unsigned int *hwid_mcatype) default: break; } + } else if (c->x86 == 0x1A) { + switch (c->x86_model) { + case 0x40 ... 0x4F: + if (*hwid_mcatype == HWID_MCATYPE(0x2E, 0x2)) + *hwid_mcatype = HWID_MCATYPE(0x0, 0x1); + break; + default: + break; + } } } diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index 869dcca5e2f4..0586356475fd 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c @@ -311,6 +311,31 @@ static const char * const smca_cs2_mce_desc[] = { "Hardware Assert Error", }; +/* + * Per Genoa's revision guide, erratum 1384, existing bit definitions + * are reassigned for SMCA CS bank type. + */ +static const char * const smca_cs2_quirk_mce_desc[] = { + "Illegal Request", + "Address Violation", + "Security Violation", + "Illegal Response", + "Unexpected Response", + "Request or Probe Parity Error", + "Read Response Parity Error", + "Atomic Request Parity Error", + "SDP read response had no match in the CS queue", + "SDP read response had an unexpected RETRY error", + "Counter overflow error", + "Counter underflow error", + "Probe Filter Protocol Error", + "Probe Filter ECC Error", + "Illegal Request on the no data channel", + "Address Violation on the no data channel", + "Security Violation on the no data channel", + "Hardware Assert Error", +}; + static const char * const smca_pie_mce_desc[] = { "Hardware Assert", "Register security violation", @@ -602,6 +627,7 @@ static struct smca_mce_desc smca_mce_descs[] = { [SMCA_L3_CACHE] = { smca_l3_mce_desc, ARRAY_SIZE(smca_l3_mce_desc) }, [SMCA_CS] = { smca_cs_mce_desc, ARRAY_SIZE(smca_cs_mce_desc) }, [SMCA_CS_V2] = { smca_cs2_mce_desc, ARRAY_SIZE(smca_cs2_mce_desc) }, + [SMCA_CS_V2_QUIRK] = { smca_cs2_quirk_mce_desc, ARRAY_SIZE(smca_cs2_quirk_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) },