From patchwork Thu Jul 20 12:54:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M K, Muralidhara" X-Patchwork-Id: 13320452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14747EB64DC for ; Thu, 20 Jul 2023 12:54:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbjGTMyt (ORCPT ); Thu, 20 Jul 2023 08:54:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbjGTMys (ORCPT ); Thu, 20 Jul 2023 08:54:48 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2078.outbound.protection.outlook.com [40.107.237.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95C3F268C; Thu, 20 Jul 2023 05:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iW1WtU0ppMvEfz/XdaBzCz0k+2WaphSW0ETSHdO7p7MIRjgzPpi9PEQJdHDkWmkNv/RhHs3RrKgy7jGdTpdQ5EkascaVyDb6H9rPJVqaw4GVavJVamJeOyJTTREz/jCsdbargL/2b2E4m3NA1hwxpbkZBTwzt2rs/vlgqQgG0TYqRndxLdpHSZZZbKUEa1iBwBmNeNXzJaU05OpBCmQ+vMUabdHJcEvGH76j66+GvB1O0rpS393nuScNm9DreNu8W59esfOx1DrSqzIWSkQlmTWFo3sustc1AsOUlc4JQffAhtPjXT5yae9nn+Jyr6OpioT42COQHQtuI2DfizLnLQ== 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=Om5MFofT8lAmv+jDjQ3D5jjvGthd1aPCAiowkvn5tRg=; b=CzePKim9R9bp7h/aAEv2N9SyasZVT1AA1qky70upmPVA7knbiaWaPRlsg6hwFwT0UBNdGJfdQK6YVx4XjjydjRYbaBup0pJcRRhjr2NF/kA6nem8YkplLW4SBSOxO6gGw/rkf2AeStbIS6WuGlvMBfHlYniZdU+2WHHB70JqETocGHTJ036isU1oujN3B51aXE/VSHRQ3EnWHhhzJTHVsPlMGfB+y4TiyTpGMYAP16NzpkZwz877Ay8i5MAP///HsMYq810WYLD7uBZzx8f9453ScwCPrSZNoVDLisgNORHWddxZlKyF46EOXJAAnEU1hEqdFRY3cH43G+k2HfKcCw== 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=Om5MFofT8lAmv+jDjQ3D5jjvGthd1aPCAiowkvn5tRg=; b=HCrF+ZFLGWGrP73oAhBOsbC6fWIPT7BoJfpzLe98Bu72Pfh9TUgeyt6I2J9PmCWsNK6Rrxbfz1j7OGafyKzZtYq0aiitz+otQRsfJz7wp9SebpzhNH6ledVTbobUOU2ihodlKS4R+X3WoF7DShHJaMwHBxE6lPcRpfD9fzBXigU= Received: from BN1PR13CA0021.namprd13.prod.outlook.com (2603:10b6:408:e2::26) by LV2PR12MB5846.namprd12.prod.outlook.com (2603:10b6:408:175::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Thu, 20 Jul 2023 12:54:45 +0000 Received: from BN8NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e2:cafe::60) by BN1PR13CA0021.outlook.office365.com (2603:10b6:408:e2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.15 via Frontend Transport; Thu, 20 Jul 2023 12:54:45 +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 BN8NAM11FT008.mail.protection.outlook.com (10.13.177.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.34 via Frontend Transport; Thu, 20 Jul 2023 12:54:45 +0000 Received: from amd.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.2507.23; Thu, 20 Jul 2023 07:54:42 -0500 From: Muralidhara M K To: , CC: , , , , , , Muralidhara M K Subject: [PATCH 1/7] x86/amd_nb: Add AMD Family 19h Models(80h-80fh) and (90h-9fh) PCI IDs Date: Thu, 20 Jul 2023 12:54:19 +0000 Message-ID: <20230720125425.3735538-2-muralimk@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720125425.3735538-1-muralimk@amd.com> References: <20230720125425.3735538-1-muralimk@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: BN8NAM11FT008:EE_|LV2PR12MB5846:EE_ X-MS-Office365-Filtering-Correlation-Id: 57277bf5-3f41-4951-8b53-08db89207e46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5nioNs8LLLN9Gk44ol+hQiRVEnAa8xEh8NwmGe7S05BrgxsbZjjK2hE8OuL+oCNK1dlRo6/b4qMWDodD7E+r4gAMFy4J668rfAmAV4qy1wPYttLwl0iIwyATqz6pEEK1XtDYWRE7I69Jg56bWmEgLf0Q9+ediXNT+CYLeTTWuaJyiemivNk9M8zalsurN/V17iRHrhGxpiYt0KBKpOBDA7biSVChVWXYO8Z/uzBkAS5kyq8o+iZ9iOxX7qbe9x6OD453fF4efqU0cHj/VPCkvQEbAuTYbAYRpluOnsDyiYDP26nUmddVG/QcBRdlIcQLXJKcdYvOtohDar+qfOj5rGOzBnmvAGXJ3uEg7JJigzbl7jkGVoIAiMNLY6qNOxL9qsIY/9lZqKX+gb76U2mCyYFyGd/kShqENZlIeE43yFPgzZYTDbLYIT+WpzEUcciDYJp+JKsBWgflv8JXrfggUA73RfoCsLP9iNBlTe2JK2HrS0YO4baNEYpCtuZiAljEX29aidpFwFh9+dHgijefQEueAVHJgfNCQhzIxZNi88dSc3oKOcletbzh4InCjbsA9HIN7gYf3SHrNqeOq+aZvPs3oJmB8J1DPvS7DePsFScf4If8TPJQF3X7eyWZ/48+/4EIKtB0VAGGFAkx1IPIYvTT9VKegmAnNc7k6yLqZQFv+OUu4QapsBBKA5erAz9CHZ2AJ30ZUZXcgYASIh31kHIyK+HaHKWoGsZTG2pR5nk4bk2gKP9iibW0vqFaXJ4gddiIW9ZJARD1HWkxj3pveg== 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:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(376002)(451199021)(82310400008)(40470700004)(46966006)(36840700001)(26005)(1076003)(40480700001)(40460700003)(54906003)(110136005)(36756003)(70206006)(81166007)(5660300002)(4326008)(2906002)(8936002)(8676002)(70586007)(316002)(41300700001)(7696005)(6666004)(82740400003)(356005)(478600001)(2616005)(36860700001)(426003)(47076005)(336012)(186003)(16526019)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:54:45.3099 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57277bf5-3f41-4951-8b53-08db89207e46 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: BN8NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5846 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K Add new Root, Device 18h Function 3, and Function 4 PCI IDS for x86 AMD family 19h, Models 80h-80fh and 90h-9fh. Signed-off-by: Muralidhara M K --- arch/x86/kernel/amd_nb.c | 5 +++++ include/linux/pci_ids.h | 1 + 2 files changed, 6 insertions(+) diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index 035a3db5330b..0dece8606ae2 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -25,6 +25,7 @@ #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 #define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 #define PCI_DEVICE_ID_AMD_MI200_ROOT 0x14bb +#define PCI_DEVICE_ID_AMD_MI300_ROOT 0x14f8 #define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464 #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec @@ -40,6 +41,7 @@ #define PCI_DEVICE_ID_AMD_19H_M70H_DF_F4 0x14f4 #define PCI_DEVICE_ID_AMD_19H_M78H_DF_F4 0x12fc #define PCI_DEVICE_ID_AMD_MI200_DF_F4 0x14d4 +#define PCI_DEVICE_ID_AMD_MI300_DF_F4 0x152c /* Protect the PCI config register pairs used for SMN. */ static DEFINE_MUTEX(smn_mutex); @@ -57,6 +59,7 @@ static const struct pci_device_id amd_root_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_ROOT) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_ROOT) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI200_ROOT) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI300_ROOT) }, {} }; @@ -86,6 +89,7 @@ static const struct pci_device_id amd_nb_misc_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M78H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI200_DF_F3) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI300_DF_F3) }, {} }; @@ -107,6 +111,7 @@ static const struct pci_device_id amd_nb_link_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI200_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI300_DF_F4) }, {} }; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2dc75df1437f..70decb578206 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -577,6 +577,7 @@ #define PCI_DEVICE_ID_AMD_19H_M70H_DF_F3 0x14f3 #define PCI_DEVICE_ID_AMD_19H_M78H_DF_F3 0x12fb #define PCI_DEVICE_ID_AMD_MI200_DF_F3 0x14d3 +#define PCI_DEVICE_ID_AMD_MI300_DF_F3 0x152b #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 #define PCI_DEVICE_ID_AMD_LANCE 0x2000 #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 From patchwork Thu Jul 20 12:54:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M K, Muralidhara" X-Patchwork-Id: 13320454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8D48EB64DC for ; Thu, 20 Jul 2023 12:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230220AbjGTMy6 (ORCPT ); Thu, 20 Jul 2023 08:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230483AbjGTMy5 (ORCPT ); Thu, 20 Jul 2023 08:54:57 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80E7B2137; Thu, 20 Jul 2023 05:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GLdpQ28Ee4v03pgprhKODMwYTC486ZqKAbye5EUtM05mH0eHxA/+fAi+2ofOXyWZKI4RcuDQ6VftvoHOAwk0Z6EgjJo9iUG8qi4eiECzVQsM09xJcS0gblYyxlrCx2+thb5ttTDqZknEdrOUT3JQ34rivpsrkyc+h+v87CkYrW8KVEgznD41WbCz+me0BgEYVsTGScf+uLHuP4DlA1tRPBAqgUiBfO4230nvvE5p66cxIMk1q2ZLIYnZnwN4by81aU92pCvotbKjOCSG1VTtBTym1fPGmv5cgVLFeoHu+lk16VfEoFfCR+6OARmC6QZ7Qjn/u48ontaRy/KFTaQUVg== 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=7YHckAVzkjcfl+MC4HnsS7dOdBu5icTimHL48CYRn5w=; b=gEZBU650RfxrMOkov/Hdd+Gu+M4q/BI7me/I/zSL4ovb2U17eld7ot1jL2yVnnAw2cnGGOaR/6oGR8HqH7GjZLNM1LsZIrKvz88doTPWGbf0X8RosyWSfBrYUursByE9ILbNuS35dzdcLzH/MzqogioquL28VmV36L0o+GgEmFpqEpgU28cgDABNoZPJSIHy7K7SbVIhyZ1vsZibyAKNdXQaijtf16RPV4kUmVCWSwbGb9ZAls+0RMi4Wm9sjUW6wLiB0zLU3MwX44iCc8NvKKYpfzmhzgZ1PGfJc16E8jrAKwIXUAcRMOc85QQ6B+xKRH9eIT7HAPO2pguSmtYRtA== 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=7YHckAVzkjcfl+MC4HnsS7dOdBu5icTimHL48CYRn5w=; b=GzsWBWuGCrCMC+/kTjqaH2geHDdDxeVbV1KB9tVbpjhq+erX9JIqAPb3BiqFc+1VLd7zW8645+3uEd7XQvKSqfwtKg5ZQp2VnqB3jc0+Q8dq7jBm4WpBbyouMzUlna4DkSbtA4Z1oqvTsfh2N7NDoh8Yy5K1xBmjKXMWtQYr/eM= Received: from BN9P222CA0027.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::32) by PH8PR12MB6891.namprd12.prod.outlook.com (2603:10b6:510:1cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul 2023 12:54:49 +0000 Received: from BN8NAM11FT111.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::27) by BN9P222CA0027.outlook.office365.com (2603:10b6:408:10c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend Transport; Thu, 20 Jul 2023 12:54:49 +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 BN8NAM11FT111.mail.protection.outlook.com (10.13.177.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6609.25 via Frontend Transport; Thu, 20 Jul 2023 12:54:48 +0000 Received: from amd.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.2507.23; Thu, 20 Jul 2023 07:54:45 -0500 From: Muralidhara M K To: , CC: , , , , , , Muralidhara M K Subject: [PATCH 2/7] EDAC/mce_amd: Remove SMCA Extended Error code descriptions Date: Thu, 20 Jul 2023 12:54:20 +0000 Message-ID: <20230720125425.3735538-3-muralimk@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720125425.3735538-1-muralimk@amd.com> References: <20230720125425.3735538-1-muralimk@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: BN8NAM11FT111:EE_|PH8PR12MB6891:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c0b59c6-2c23-40c7-7971-08db89208071 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0LIlQg7fLeZtDCbvnd5lsD3pVoXzxeHSvS3n1nyHa3VgDlFkQD11h0h5XONg4UfczO8zjfeAF5qcCwlURFh1L5H6L+aYhqlFgYS1KF1lzURIeCNeCySp7VekjT2c1Vdb28xwICutnN8nBYqCln8f1Skv3vPRZRMCG9AZOgRkt8uUonwm0g8fztc4YP1iPtpzcMJBC0zk/EU+uSdvfC27gnjgRQI27b9Fr8l0PUFP9Zt+iLaItfugqLEW6HBfOEchwFCRoIapVmEzv0qFj1XtLuvcqXmSUktu1O2d6Kk+dElbfGRnJj1muUOBGdJvHrHXL6LYN0HnzXYXMXxMkB8Hp7Ykp3xFzOj3v3QLtnUVm2Q8hq9tLZTbfWi+kRYVV0Q0ffV/xMtDfJeYQtyCWjGGKwprfJrteN1vFNPufkhlwWgI8Z51LKcinHVE6NYns+Oo/pvIfVSbeM1ZIm7KxHQDHp/TVmLkYyzjfSaDjcTsCHDzeGWl60padpAhnMDFmNJmm2f8E3km8aclZ9rZ9Sx+Tal3Oxd83+nZ/Hw91b6z+1RzIe9LsqZrpp8GaI7JGYbQ6+lxDe3dM/D1iy0BySPfm8oTVlgN1OzKavpGO8jA2YVoE1FR46ZsSTaLpnzXFey1dvQx8JKNvaXd77W0O4M6YPQNtoJ3g5xK675KCgUqyfv7o4J2DoweYZbjeXF23Ihm+SpgBl7nS8RM42U9i77YmElU25EQjymUQJzj1jlCYICvWxSolSRK0qMwlZnzE+WNzuAG7D9zMjdlZtn0lG46ZQ== 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:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(376002)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(82740400003)(8676002)(8936002)(5660300002)(2616005)(47076005)(4326008)(316002)(70586007)(70206006)(83380400001)(30864003)(36860700001)(426003)(2906002)(41300700001)(81166007)(110136005)(356005)(478600001)(7696005)(6666004)(54906003)(36756003)(16526019)(26005)(1076003)(186003)(336012)(40460700003)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:54:48.9467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c0b59c6-2c23-40c7-7971-08db89208071 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: BN8NAM11FT111.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6891 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K On AMD systems with Scalable MCA, each machine check error of a SMCA bank type has an associated bit position in the bank's control (CTL) register. An error's bit position in the CTL register is 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 some of the existing bit definitions in the CTL register of SMCA bank type are reassigned without defining new HWID and McaType. Consequently, the errors whose bit definitions have been reassigned in the CTL register are being erroneously decoded. Remove SMCA Extended Error Code descriptions. This avoids decoding issues for incorrectly reassigned bits, and avoids the related maintenance burden in the kernel. This decoding can be done in external tools or by referring to AMD documentation. The bank type and Extended Error Code value for an error will continue to be printed as a convenience. Signed-off-by: Muralidhara M K Reviewed-by: Yazen Ghannam --- drivers/edac/mce_amd.c | 480 ----------------------------------------- 1 file changed, 480 deletions(-) diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index 9215c06783df..3a67f02a34ad 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c @@ -143,482 +143,6 @@ static const char * const mc6_mce_desc[] = { "Status Register File", }; -/* Scalable MCA error strings */ -static const char * const smca_ls_mce_desc[] = { - "Load queue parity error", - "Store queue parity error", - "Miss address buffer payload parity error", - "Level 1 TLB parity error", - "DC Tag error type 5", - "DC Tag error type 6", - "DC Tag error type 1", - "Internal error type 1", - "Internal error type 2", - "System Read Data Error Thread 0", - "System Read Data Error Thread 1", - "DC Tag error type 2", - "DC Data error type 1 and poison consumption", - "DC Data error type 2", - "DC Data error type 3", - "DC Tag error type 4", - "Level 2 TLB parity error", - "PDC parity error", - "DC Tag error type 3", - "DC Tag error type 5", - "L2 Fill Data error", -}; - -static const char * const smca_ls2_mce_desc[] = { - "An ECC error was detected on a data cache read by a probe or victimization", - "An ECC error or L2 poison was detected on a data cache read by a load", - "An ECC error was detected on a data cache read-modify-write by a store", - "An ECC error or poison bit mismatch was detected on a tag read by a probe or victimization", - "An ECC error or poison bit mismatch was detected on a tag read by a load", - "An ECC error or poison bit mismatch was detected on a tag read by a store", - "An ECC error was detected on an EMEM read by a load", - "An ECC error was detected on an EMEM read-modify-write by a store", - "A parity error was detected in an L1 TLB entry by any access", - "A parity error was detected in an L2 TLB entry by any access", - "A parity error was detected in a PWC entry by any access", - "A parity error was detected in an STQ entry by any access", - "A parity error was detected in an LDQ entry by any access", - "A parity error was detected in a MAB entry by any access", - "A parity error was detected in an SCB entry state field by any access", - "A parity error was detected in an SCB entry address field by any access", - "A parity error was detected in an SCB entry data field by any access", - "A parity error was detected in a WCB entry by any access", - "A poisoned line was detected in an SCB entry by any access", - "A SystemReadDataError error was reported on read data returned from L2 for a load", - "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", -}; - -static const char * const smca_if_mce_desc[] = { - "Op Cache Microtag Probe Port 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", - "L0 ITLB Parity Error", - "L1 ITLB Parity Error", - "L2 ITLB Parity Error", - "BPQ Thread 0 Snoop Parity Error", - "BPQ Thread 1 Snoop Parity Error", - "L1 BTB Multi-Match Error", - "L2 BTB Multi-Match Error", - "L2 Cache Response Poison Error", - "System Read Data Error", - "Hardware Assertion Error", - "L1-TLB Multi-Hit", - "L2-TLB Multi-Hit", - "BSR Parity Error", - "CT MCE", -}; - -static const char * const smca_l2_mce_desc[] = { - "L2M Tag Multiple-Way-Hit error", - "L2M Tag or State Array ECC Error", - "L2M Data Array ECC Error", - "Hardware Assert 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 queue parity error", - "Instruction dispatch queue parity error", - "Fetch address FIFO parity error", - "Patch RAM data parity error", - "Patch RAM sequencer parity error", - "Micro-op buffer parity error", - "Hardware Assertion MCA Error", -}; - -static const char * const smca_ex_mce_desc[] = { - "Watchdog Timeout error", - "Physical register file parity error", - "Flag register file parity error", - "Immediate displacement register file parity error", - "Address generator payload parity error", - "EX payload parity error", - "Checkpoint queue parity error", - "Retire dispatch queue parity error", - "Retire status queue parity error", - "Scheduling queue parity error", - "Branch buffer queue parity error", - "Hardware Assertion error", - "Spec Map parity error", - "Retire Map parity error", -}; - -static const char * const smca_fp_mce_desc[] = { - "Physical register file (PRF) parity error", - "Freelist (FL) parity error", - "Schedule queue parity error", - "NSQ parity error", - "Retire queue (RQ) parity error", - "Status register file (SRF) parity error", - "Hardware assertion", -}; - -static const char * const smca_l3_mce_desc[] = { - "Shadow Tag Macro ECC Error", - "Shadow Tag Macro Multi-way-hit Error", - "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", - "L3 Hardware Assertion", -}; - -static const char * const smca_cs_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", - "Probe Filter ECC Error", -}; - -static const char * const smca_cs2_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", - "Probe Filter Protocol Error", - "Probe Filter ECC Error", - "SDP read response had an unexpected RETRY error", - "Counter overflow error", - "Counter underflow error", -}; - -static const char * const smca_pie_mce_desc[] = { - "Hardware Assert", - "Register security violation", - "Link Error", - "Poison data consumption", - "A deferred error was detected in the DF" -}; - -static const char * const smca_umc_mce_desc[] = { - "DRAM ECC error", - "Data poison error", - "SDP parity error", - "Advanced peripheral bus error", - "Address/Command parity error", - "Write data CRC error", - "DCQ SRAM ECC error", - "AES SRAM ECC 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", -}; - -static const char * const smca_pb_mce_desc[] = { - "An ECC error in the Parameter Block RAM array", -}; - -static const char * const smca_psp_mce_desc[] = { - "An ECC or parity error in a PSP RAM instance", -}; - -static const char * const smca_psp2_mce_desc[] = { - "High SRAM ECC or parity error", - "Low SRAM ECC or parity error", - "Instruction Cache Bank 0 ECC or parity error", - "Instruction Cache Bank 1 ECC or parity error", - "Instruction Tag Ram 0 parity error", - "Instruction Tag Ram 1 parity error", - "Data Cache Bank 0 ECC or parity error", - "Data Cache Bank 1 ECC or parity error", - "Data Cache Bank 2 ECC or parity error", - "Data Cache Bank 3 ECC or parity error", - "Data Tag Bank 0 parity error", - "Data Tag Bank 1 parity error", - "Data Tag Bank 2 parity error", - "Data Tag Bank 3 parity error", - "Dirty Data Ram parity error", - "TLB Bank 0 parity error", - "TLB Bank 1 parity error", - "System Hub Read Buffer ECC or parity error", -}; - -static const char * const smca_smu_mce_desc[] = { - "An ECC or parity error in an SMU RAM instance", -}; - -static const char * const smca_smu2_mce_desc[] = { - "High SRAM ECC or parity error", - "Low SRAM ECC or parity error", - "Data Cache Bank A ECC or parity error", - "Data Cache Bank B ECC or parity error", - "Data Tag Cache Bank A ECC or parity error", - "Data Tag Cache Bank B ECC or parity error", - "Instruction Cache Bank A ECC or parity error", - "Instruction Cache Bank B ECC or parity error", - "Instruction Tag Cache Bank A ECC or parity error", - "Instruction Tag Cache Bank B ECC or parity error", - "System Hub Read Buffer ECC or parity error", - "PHY RAM ECC error", -}; - -static const char * const smca_mp5_mce_desc[] = { - "High SRAM ECC or parity error", - "Low SRAM ECC or parity error", - "Data Cache Bank A ECC or parity error", - "Data Cache Bank B ECC or parity error", - "Data Tag Cache Bank A ECC or parity error", - "Data Tag Cache Bank B ECC or parity error", - "Instruction Cache Bank A ECC or parity error", - "Instruction Cache Bank B ECC or parity error", - "Instruction Tag Cache Bank A ECC or parity error", - "Instruction Tag Cache Bank B ECC or parity error", -}; - -static const char * const smca_mpdma_mce_desc[] = { - "Main SRAM [31:0] bank ECC or parity error", - "Main SRAM [63:32] bank ECC or parity error", - "Main SRAM [95:64] bank ECC or parity error", - "Main SRAM [127:96] bank ECC or parity error", - "Data Cache Bank A ECC or parity error", - "Data Cache Bank B ECC or parity error", - "Data Tag Cache Bank A ECC or parity error", - "Data Tag Cache Bank B ECC or parity error", - "Instruction Cache Bank A ECC or parity error", - "Instruction Cache Bank B ECC or parity error", - "Instruction Tag Cache Bank A ECC or parity error", - "Instruction Tag Cache Bank B ECC or parity error", - "Data Cache Bank A ECC or parity error", - "Data Cache Bank B ECC or parity error", - "Data Tag Cache Bank A ECC or parity error", - "Data Tag Cache Bank B ECC or parity error", - "Instruction Cache Bank A ECC or parity error", - "Instruction Cache Bank B ECC or parity error", - "Instruction Tag Cache Bank A ECC or parity error", - "Instruction Tag Cache Bank B ECC or parity error", - "Data Cache Bank A ECC or parity error", - "Data Cache Bank B ECC or parity error", - "Data Tag Cache Bank A ECC or parity error", - "Data Tag Cache Bank B ECC or parity error", - "Instruction Cache Bank A ECC or parity error", - "Instruction Cache Bank B ECC or parity error", - "Instruction Tag Cache Bank A ECC or parity error", - "Instruction Tag Cache Bank B ECC or parity error", - "System Hub Read Buffer ECC or parity error", - "MPDMA TVF DVSEC Memory ECC or parity error", - "MPDMA TVF MMIO Mailbox0 ECC or parity error", - "MPDMA TVF MMIO Mailbox1 ECC or parity error", - "MPDMA TVF Doorbell Memory ECC or parity error", - "MPDMA TVF SDP Slave Memory 0 ECC or parity error", - "MPDMA TVF SDP Slave Memory 1 ECC or parity error", - "MPDMA TVF SDP Slave Memory 2 ECC or parity error", - "MPDMA TVF SDP Master Memory 0 ECC or parity error", - "MPDMA TVF SDP Master Memory 1 ECC or parity error", - "MPDMA TVF SDP Master Memory 2 ECC or parity error", - "MPDMA TVF SDP Master Memory 3 ECC or parity error", - "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", - "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[] = { - "ECC or Parity error", - "PCIE error", - "SDP ErrEvent error", - "SDP Egress Poison Error", - "IOHC Internal Poison Error", -}; - -static const char * const smca_pcie_mce_desc[] = { - "CCIX PER Message logging", - "CCIX Read Response with Status: Non-Data Error", - "CCIX Write Response with Status: Non-Data Error", - "CCIX Read Response with Status: Data Error", - "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 Packet 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_nbif_mce_desc[] = { - "Timeout error from GMI", - "SRAM ECC error", - "NTB Error Event", - "SDP Parity error", -}; - -static const char * const smca_sata_mce_desc[] = { - "Parity error for port 0", - "Parity error for port 1", - "Parity error for port 2", - "Parity error for port 3", - "Parity error for port 4", - "Parity error for port 5", - "Parity error for port 6", - "Parity error for port 7", -}; - -static const char * const smca_usb_mce_desc[] = { - "Parity error or ECC error for S0 RAM0", - "Parity error or ECC error for S0 RAM1", - "Parity error or ECC error for S0 RAM2", - "Parity error for PHY RAM0", - "Parity error for PHY RAM1", - "AXI Slave Response error", -}; - -static const char * const smca_gmipcs_mce_desc[] = { - "Data Loss Error", - "Training Error", - "Replay Parity Error", - "Rx Fifo Underflow Error", - "Rx Fifo Overflow Error", - "CRC Error", - "BER Exceeded Error", - "Tx Fifo Underflow Error", - "Replay Buffer Parity Error", - "Tx Overflow Error", - "Replay Fifo Overflow Error", - "Replay Fifo Underflow Error", - "Elastic Fifo Overflow Error", - "Deskew Error", - "Offline 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", - "Deskew Abort Error", - "Rx Buffer Error", - "Rx LFDS Fifo Overflow Error", - "Rx LFDS Fifo Underflow Error", - "LinkSub Tx Timeout Error", - "LinkSub Rx Timeout Error", - "Rx CMD Packet Error", - "LFDS Training Timeout Error", - "LFDS FC Init Timeout Error", - "Data Loss Error", -}; - -struct smca_mce_desc { - const char * const *descs; - unsigned int num_descs; -}; - -static struct smca_mce_desc smca_mce_descs[] = { - [SMCA_LS] = { smca_ls_mce_desc, ARRAY_SIZE(smca_ls_mce_desc) }, - [SMCA_LS_V2] = { smca_ls2_mce_desc, ARRAY_SIZE(smca_ls2_mce_desc) }, - [SMCA_IF] = { smca_if_mce_desc, ARRAY_SIZE(smca_if_mce_desc) }, - [SMCA_L2_CACHE] = { smca_l2_mce_desc, ARRAY_SIZE(smca_l2_mce_desc) }, - [SMCA_DE] = { smca_de_mce_desc, ARRAY_SIZE(smca_de_mce_desc) }, - [SMCA_EX] = { smca_ex_mce_desc, ARRAY_SIZE(smca_ex_mce_desc) }, - [SMCA_FP] = { smca_fp_mce_desc, ARRAY_SIZE(smca_fp_mce_desc) }, - [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_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) }, - [SMCA_SMU] = { smca_smu_mce_desc, ARRAY_SIZE(smca_smu_mce_desc) }, - [SMCA_SMU_V2] = { smca_smu2_mce_desc, ARRAY_SIZE(smca_smu2_mce_desc) }, - [SMCA_MP5] = { smca_mp5_mce_desc, ARRAY_SIZE(smca_mp5_mce_desc) }, - [SMCA_MPDMA] = { smca_mpdma_mce_desc, ARRAY_SIZE(smca_mpdma_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) }, - /* NBIF and SHUB have the same error descriptions, for now. */ - [SMCA_NBIF] = { smca_nbif_mce_desc, ARRAY_SIZE(smca_nbif_mce_desc) }, - [SMCA_SHUB] = { smca_nbif_mce_desc, ARRAY_SIZE(smca_nbif_mce_desc) }, - [SMCA_SATA] = { smca_sata_mce_desc, ARRAY_SIZE(smca_sata_mce_desc) }, - [SMCA_USB] = { smca_usb_mce_desc, ARRAY_SIZE(smca_usb_mce_desc) }, - [SMCA_GMI_PCS] = { smca_gmipcs_mce_desc, ARRAY_SIZE(smca_gmipcs_mce_desc) }, - /* All the PHY bank types have the same error descriptions, for now. */ - [SMCA_XGMI_PHY] = { smca_xgmiphy_mce_desc, ARRAY_SIZE(smca_xgmiphy_mce_desc) }, - [SMCA_WAFL_PHY] = { smca_xgmiphy_mce_desc, ARRAY_SIZE(smca_xgmiphy_mce_desc) }, - [SMCA_GMI_PHY] = { smca_xgmiphy_mce_desc, ARRAY_SIZE(smca_xgmiphy_mce_desc) }, -}; - static bool f12h_mc0_mce(u16 ec, u8 xec) { bool ret = false; @@ -1182,10 +706,6 @@ static void decode_smca_error(struct mce *m) pr_emerg(HW_ERR "%s Ext. Error Code: %d", ip_name, xec); - /* Only print the decode of valid error codes */ - if (xec < smca_mce_descs[bank_type].num_descs) - pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]); - if ((bank_type == SMCA_UMC || bank_type == SMCA_UMC_V2) && xec == 0 && decode_dram_ecc) decode_dram_ecc(topology_die_id(m->extcpu), m); From patchwork Thu Jul 20 12:54:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M K, Muralidhara" X-Patchwork-Id: 13320453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8B52EB64DA for ; Thu, 20 Jul 2023 12:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231128AbjGTMy7 (ORCPT ); Thu, 20 Jul 2023 08:54:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbjGTMy5 (ORCPT ); Thu, 20 Jul 2023 08:54:57 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2059.outbound.protection.outlook.com [40.107.102.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 965E1269D; Thu, 20 Jul 2023 05:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LRCsIOlvmHNQNP548AaXrk0lQhTrEDdCchVBWN+cSByzaGmRuUkAw6UgYqEweNtPjzuKNhBV04u1WAx9sKLqv7gtwm/pAIUH7VmbuNYK5N26kgQNDdin91fJGJdq5F2umiXul8oFCfM/FUhFPZKwhWpN/OIJQRAGAWo+Oh57P8Esg7o/FyySkBwTsqbrOPK6DoYrSNIITfNJ17Nscu0UJpXmk4FgRIZqdYYyohttZ1Z0vPuOBttEtKjzil0DZ6r7zaAsHSQUYULLSNqag58bE1W2Swn/FlizSiYSh3uKims7RRZ2GQDaC1uNhBeF8i+Cga6sdadBo+Gw4zdQjo3Azg== 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=ubSJl4XH8IAHWE4V1QuESlkZ/80QZTf1OxwqloJtUik=; b=ZzJaQvg4RyEL7QpHO3SG618Se0AWwzgRaylo2PVyGdKLXbeDM7H3lMtCNFC7BReln77s5fnqMJKCtNCPHWapNXTqO6bnwTQwUkOqT5LoFPDcDR1NFHqC3nxsd+f3kemN7rIds84Dh/BZgg8Wvrh/IN96n/5Q6Z6kxKh9ktMsCZ3gVYnquYNBFI52vuyovQP5FCXE+aJ3BqWnzPPbMzHzjYu6Pgbh/Mme3YTlNw38Zmh9UXH7Nm7THjCYPIYCAXD+FDlCaUrQf1cvzE25uRkw7E+YPYYf0y+r32bJXQmBEU7qmIyUQrdzbN/FKq8PU1jEFsVvAx2frhHZFvdw5UNulw== 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=ubSJl4XH8IAHWE4V1QuESlkZ/80QZTf1OxwqloJtUik=; b=ryWQw0rCoGKi2kdot+6w2f2WrOV1bTACKjLDhzdgxUoqzyhXqxoaRn5K3080Tc225j+1Q0yTZqIrw6P3HoiXB9DRY1DjEmKq/ND97Xl23dUNdDGYTw1mKk76us68scohHHkoJEcMFwEFup537ytcYPq/y/0QKXBzEOC13UGHzGA= Received: from BN9PR03CA0855.namprd03.prod.outlook.com (2603:10b6:408:13d::20) by CH3PR12MB8911.namprd12.prod.outlook.com (2603:10b6:610:169::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul 2023 12:54:51 +0000 Received: from BN8NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13d:cafe::ac) by BN9PR03CA0855.outlook.office365.com (2603:10b6:408:13d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend Transport; Thu, 20 Jul 2023 12:54:51 +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 BN8NAM11FT016.mail.protection.outlook.com (10.13.176.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.34 via Frontend Transport; Thu, 20 Jul 2023 12:54:51 +0000 Received: from amd.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.2507.23; Thu, 20 Jul 2023 07:54:48 -0500 From: Muralidhara M K To: , CC: , , , , , , Muralidhara M K Subject: [PATCH 3/7] x86/MCE/AMD: Add new MA_LLC, USR_DP, and USR_CP bank types Date: Thu, 20 Jul 2023 12:54:21 +0000 Message-ID: <20230720125425.3735538-4-muralimk@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720125425.3735538-1-muralimk@amd.com> References: <20230720125425.3735538-1-muralimk@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: BN8NAM11FT016:EE_|CH3PR12MB8911:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ff9f69a-d7c8-44ed-31f2-08db89208209 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: htF42f9xts8VgYaAfmS/WpwuD63Mn07j2cHdBXHSw5iTSvmfCRdO55r6rNRC4HNcdh/Lxx6Mnh3PvXO5KDvQ+Rq5cmpgx7tHbjorIIgiJkpsdJ7BDbTK2bzB6Y/94J5B4av3G5y1uK0OvRq5xOqAmVtnaNch/+WZnyGWfmZzRvP9k3nAX0eoZ+8cKFk5Gv1mzn4g440h2OlDbLy1evhi8APIT4mG+pg9v8bH1poPq8gAigaoxwzYm+eiZT+RZatJRSS847odmklhlwjbeKCV+URTJOq5YOT6vAqyA06NZJgEGKPfSp5o8phJYKTs5u/7QnGdz1oRycFPN8P69HD4A8DXN02nMif7GFtAW/XtXhx24qz15q7+tB3qxTP0QQRZ/9MQIVnCoSCt1Vrw4d5eRf8EdtCQwx7ac9W1sIPR/ggqvKCXNNNnaKM99RwJiN9roi2oy5Niyx4ztpb0/yLHWZUXA2gZah5AcwXfmyZWwXmyAQd003YVz2S/hJ7rbHkrzwX5skuFCxXqYRnYxsKvSwL2o/QkYcjFJggOYYsmv/RqAc7w7TiJcoCktMAhutIO6Jn6oyajciVfzrlhCoXsUUDEeRd7n9/vgHh75D0yPCu7Uks3IZ4W0EZwFYGgOu+0O+ac00FZZo0bXBwYz/G2t9nqQ1/WWfCp8xqgVHJnl0eDxCRa7f64ndAb8XNbkRGYd8+xY5/5GwY5i+viryCdy8X03qfly+ydOl4vHtYNibjffyyMwceZrke9FEJVPGEs16lXkrYv9IaC1IVdbyLfwA== 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:(13230028)(4636009)(376002)(396003)(39860400002)(346002)(136003)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(41300700001)(15650500001)(110136005)(40480700001)(478600001)(54906003)(2906002)(316002)(5660300002)(70586007)(8936002)(8676002)(70206006)(4326008)(6666004)(26005)(1076003)(7696005)(40460700003)(186003)(356005)(82740400003)(81166007)(16526019)(426003)(47076005)(336012)(2616005)(83380400001)(36860700001)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:54:51.6187 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ff9f69a-d7c8-44ed-31f2-08db89208209 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: BN8NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8911 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K Add HWID and McaType values for new SMCA bank types. Signed-off-by: Muralidhara M K --- arch/x86/include/asm/mce.h | 3 +++ arch/x86/kernel/cpu/mce/amd.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 180b1cbfcc4e..8e0ed4b86e29 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -311,6 +311,7 @@ enum smca_bank_types { SMCA_PIE, /* Power, Interrupts, etc. */ SMCA_UMC, /* Unified Memory Controller */ SMCA_UMC_V2, + SMCA_MA_LLC, /* Memory Attached Last Level Cache */ SMCA_PB, /* Parameter Block */ SMCA_PSP, /* Platform Security Processor */ SMCA_PSP_V2, @@ -326,6 +327,8 @@ enum smca_bank_types { SMCA_SHUB, /* System HUB Unit */ SMCA_SATA, /* SATA Unit */ SMCA_USB, /* USB Unit */ + SMCA_USR_DP, /* Ultra Short Reach Data Plane Controller */ + SMCA_USR_CP, /* Ultra Short Reach Control Plane Controller */ SMCA_GMI_PCS, /* GMI PCS Unit */ SMCA_XGMI_PHY, /* xGMI PHY Unit */ SMCA_WAFL_PHY, /* WAFL PHY Unit */ diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c index 5e74610b39e7..cf8b4616fd31 100644 --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -107,6 +107,7 @@ static struct smca_bank_name smca_names[] = { /* UMC v2 is separate because both of them can exist in a single system. */ [SMCA_UMC] = { "umc", "Unified Memory Controller" }, [SMCA_UMC_V2] = { "umc_v2", "Unified Memory Controller v2" }, + [SMCA_MA_LLC] = { "mall", "Memory Attached Last Level Cache" }, [SMCA_PB] = { "param_block", "Parameter Block" }, [SMCA_PSP ... SMCA_PSP_V2] = { "psp", "Platform Security Processor" }, [SMCA_SMU ... SMCA_SMU_V2] = { "smu", "System Management Unit" }, @@ -119,6 +120,8 @@ static struct smca_bank_name smca_names[] = { [SMCA_SHUB] = { "shub", "System Hub Unit" }, [SMCA_SATA] = { "sata", "SATA Unit" }, [SMCA_USB] = { "usb", "USB Unit" }, + [SMCA_USR_DP] = { "usr_dp_pcs", "Ultra Short Reach Data Plane Controller" }, + [SMCA_USR_CP] = { "usr_cp_pcs", "Ultra Short Reach Control Plane Controller" }, [SMCA_GMI_PCS] = { "gmi_pcs", "Global Memory Interconnect PCS Unit" }, [SMCA_XGMI_PHY] = { "xgmi_phy", "Ext Global Memory Interconnect PHY Unit" }, [SMCA_WAFL_PHY] = { "wafl_phy", "WAFL PHY Unit" }, @@ -178,6 +181,7 @@ 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) }, + { SMCA_MA_LLC, HWID_MCATYPE(0x2E, 0x4) }, /* Unified Memory Controller MCA type */ { SMCA_UMC, HWID_MCATYPE(0x96, 0x0) }, @@ -212,6 +216,8 @@ static const struct smca_hwid smca_hwid_mcatypes[] = { { SMCA_SHUB, HWID_MCATYPE(0x80, 0x0) }, { SMCA_SATA, HWID_MCATYPE(0xA8, 0x0) }, { SMCA_USB, HWID_MCATYPE(0xAA, 0x0) }, + { SMCA_USR_DP, HWID_MCATYPE(0x170, 0x0) }, + { SMCA_USR_CP, HWID_MCATYPE(0x180, 0x0) }, { SMCA_GMI_PCS, HWID_MCATYPE(0x241, 0x0) }, { SMCA_XGMI_PHY, HWID_MCATYPE(0x259, 0x0) }, { SMCA_WAFL_PHY, HWID_MCATYPE(0x267, 0x0) }, From patchwork Thu Jul 20 12:54:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M K, Muralidhara" X-Patchwork-Id: 13320455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9196C001DF for ; Thu, 20 Jul 2023 12:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbjGTMzB (ORCPT ); Thu, 20 Jul 2023 08:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjGTMzA (ORCPT ); Thu, 20 Jul 2023 08:55:00 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2052.outbound.protection.outlook.com [40.107.220.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF01426B7; Thu, 20 Jul 2023 05:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Td8rawbLu40n3a6j9G5cVhV0lTOjn+49uR2EeBT9fur0+EVBhSKYVb+4cDp/7uCjupqIkTc1U0RLOOZ/LBdGFgmV0bZ6wf3rvEpcMmp8vuvwWmOpENj12Nkt7lsX2G28q90xiMkSEiiYQ/26A3Fy8b0tWC56fpVMAO4+wrknGCTzqlKsDk8yaOV6F9AXrP0uuQ50VfJ+IPg9TM9U0eICbqOdFl5JE77ayYpQDPwmErLLT2BPpBUeDLspxop07jj0V13phzPc/lu3EzZ+Fr0qlm3qYBRDH0pu2YFBzExutVoCt+J5CkdBgpXkycpK3sE/fK5GoqaOITrUQTAZEedMGQ== 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=r7sCBkrm39wGlaeEusXYI2a6fbO/pAqwdlGXo95aV4U=; b=ayC9wjBMaHt/K7yoRkM0Pfjyvfj4x4OOEqqHvokW5XDGDyw8AKgmdXi2SGiGzh0xvPUS78eANsYBSz9MDTGC6SEPmpr/32P91fjq8wQlGus4zIaiAf6G/yDgAKMszQoHaq2XaGvi8jihyQo5p6Mg0KmUQtuGqu5CHZ3Vqux3smFSAjSPYIMtbCvAXy+97NEQHU0gZOlw9pkxVWytkyhA2ro+TXg3AiwsuL7fUK61GE+abmd2Q45Q5z/el6QbDCuA+wjb/47cSaqGBLajBhmrT5igXU1e/RpQj54hMjHJjvmfFaZoUO5IX6zrcvG9wo5yzg5GFW8CqHsWZ5zIpsTEmg== 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=r7sCBkrm39wGlaeEusXYI2a6fbO/pAqwdlGXo95aV4U=; b=VXpKQIvmoCFxnr+zFrtV+E9PQHJct5TO6M639qAUMrh6prs9K7LwUuit9uwiqIxxrC1+MFSybte2+LQ8VIPTcKu4XgcixQqHpThopRIteHaWo0qs+MjlFsJhjrjnGdRZVRpofrcOVad+guxH/CHIZ0SHLgEmxWUQbbcbG6CK93c= Received: from BN9PR03CA0318.namprd03.prod.outlook.com (2603:10b6:408:112::23) by SA1PR12MB7409.namprd12.prod.outlook.com (2603:10b6:806:29c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul 2023 12:54:54 +0000 Received: from BN8NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::b1) by BN9PR03CA0318.outlook.office365.com (2603:10b6:408:112::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend Transport; Thu, 20 Jul 2023 12:54:54 +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 BN8NAM11FT109.mail.protection.outlook.com (10.13.176.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6609.25 via Frontend Transport; Thu, 20 Jul 2023 12:54:54 +0000 Received: from amd.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.2507.23; Thu, 20 Jul 2023 07:54:51 -0500 From: Muralidhara M K To: , CC: , , , , , , Muralidhara M K Subject: [PATCH 4/7] EDAC/mc: Add new HBM3 memory type Date: Thu, 20 Jul 2023 12:54:22 +0000 Message-ID: <20230720125425.3735538-5-muralimk@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720125425.3735538-1-muralimk@amd.com> References: <20230720125425.3735538-1-muralimk@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: BN8NAM11FT109:EE_|SA1PR12MB7409:EE_ X-MS-Office365-Filtering-Correlation-Id: e259f821-eee5-46bf-649f-08db892083b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: foBJb5egt1t8tTnk7u7osWSTBNy96soLj+EDCxa60TpxMD3iUZyhuUbYxRLtQxjf/wwVyMSzABrAvuSqYHps6RHGw0gaop3y4QMVYKJ0sRRXIu9CFO6Azr5cUgT4ofg4Nh4ZqODgSSXDw86wzf2L29T9hhKLq8BevUO46WpIkJNDsxw4IuaEMlqNL7hB/3wyfmuFL4HSjLn0/hKzhSuCEnqK72bwY57p58S3jGM9O3a+vGg3+WofSkuuRBs0UKLLeBlOumlI6weauasxKOYzo5yMP3ur+pOpz0DV53l7MTNlBqrh2a9whf78oKYCeuchEruVCUaPAzRrtF62A/BZcyAnYIeJANyfd8JwtgzgFF6QxCeJwUE1FRTQOX6WKdL7as4R47D+Y5OedLgTcBqeNu25dCE4nRlhRmNg6npV23cWBu3gpJ6Hy2QMPVDppoPd8epm0w2asabE2W/womE7U3occlqVZzIHt6Am6nB+zv1dYEEKFofGup9urWJDDSWKLRpx81qZYesgsXM9/Pdy4xbPFoJo+/i/AJaWjA8EFXmi4BM6Qml7TdDDEfYhCU6IDBI8KbR5N3dqiZYUGkYmx0Q3+kE9pyHOaNTDlkkRLcSc9P5qE1aF+dsb2xeI+/tFjn53no25vySlvBCeR/wRjZqTkli74y6Vkl2ZR+ecOy9jPiMMi6O+YZ2aQzh/NppWNBKiwSqHKPrts5scbAwGsBY57S4L7TMXvtkfO6G9AisdE/WXy86XJSUL65V9TZN80/dDVbOqVD1bgYOvsK3EeA== 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:(13230028)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(36860700001)(36756003)(426003)(2616005)(316002)(4326008)(82740400003)(81166007)(47076005)(83380400001)(6666004)(7696005)(16526019)(336012)(26005)(1076003)(186003)(356005)(40460700003)(54906003)(110136005)(478600001)(2906002)(5660300002)(70206006)(70586007)(40480700001)(8936002)(8676002)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:54:54.3988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e259f821-eee5-46bf-649f-08db892083b1 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: BN8NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7409 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K Add a new entry to 'enum mem_type' and a new string to 'edac_mem_types[]' for HBM3 (High Bandwidth Memory Gen 3) new memory type. Signed-off-by: Muralidhara M K --- drivers/edac/edac_mc.c | 1 + include/linux/edac.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 6faeb2ab3960..d6eed727b0cd 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -166,6 +166,7 @@ const char * const edac_mem_types[] = { [MEM_NVDIMM] = "Non-volatile-RAM", [MEM_WIO2] = "Wide-IO-2", [MEM_HBM2] = "High-bandwidth-memory-Gen2", + [MEM_HBM3] = "High-bandwidth-memory-Gen3", }; EXPORT_SYMBOL_GPL(edac_mem_types); diff --git a/include/linux/edac.h b/include/linux/edac.h index fa4bda2a70f6..1174beb94ab6 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h @@ -187,6 +187,7 @@ static inline char *mc_event_error_type(const unsigned int err_type) * @MEM_NVDIMM: Non-volatile RAM * @MEM_WIO2: Wide I/O 2. * @MEM_HBM2: High bandwidth Memory Gen 2. + * @MEM_HBM3: High bandwidth Memory Gen 3. */ enum mem_type { MEM_EMPTY = 0, @@ -218,6 +219,7 @@ enum mem_type { MEM_NVDIMM, MEM_WIO2, MEM_HBM2, + MEM_HBM3, }; #define MEM_FLAG_EMPTY BIT(MEM_EMPTY) @@ -248,6 +250,7 @@ enum mem_type { #define MEM_FLAG_NVDIMM BIT(MEM_NVDIMM) #define MEM_FLAG_WIO2 BIT(MEM_WIO2) #define MEM_FLAG_HBM2 BIT(MEM_HBM2) +#define MEM_FLAG_HBM3 BIT(MEM_HBM3) /** * enum edac_type - Error Detection and Correction capabilities and mode From patchwork Thu Jul 20 12:54:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M K, Muralidhara" X-Patchwork-Id: 13320456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54B4EEB64DA for ; Thu, 20 Jul 2023 12:55:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231463AbjGTMzT (ORCPT ); Thu, 20 Jul 2023 08:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231438AbjGTMzM (ORCPT ); Thu, 20 Jul 2023 08:55:12 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2063.outbound.protection.outlook.com [40.107.220.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53CA926BF; Thu, 20 Jul 2023 05:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D8qpsf4vm+3M9XC3FYQPsEWoBKQQrQd1jEo72DMhxoq4CdmkAsHuoHkdExzT0nuJV2x6O5k3796S/Q6QowbEPBi/j8jMid1vBfmWUK+fpXKAEIGGF7KHqSRDeb8PLRFklJExxzEBsdt/5OBflZdk34/NrshoK+M8MLgDF4BErugqqaBYi30tECjNeTLAputrR4zNtSjsLX4JMsKYtXeJPGjFajW/UKHSvLhm2D1/4UtQy5bcWEizEg9tgTg8vPcLUFozAnJiSiZxh6kz6YhjD3A3CNsF73HrX8N48/PrN/C/07TB5vUPvz73Aqo3FX6hcpP1C78K60KgtxKbQ22m9w== 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=id3Ep6tox7jziFtgXSfdfgpg6msnemBUMm+8mCJC0ig=; b=IszMwCxTqUmZQQ6jSrKZHAl+VDnkedklrpq+74jK468M+G3KOCUvNyNOl75lda2heLUXDp408cJitdoSRXpu2Pm0nosNr2DL8D4ZtcIp/Vij0XR423yjKaRiSVLpoRM7gyjU8dwkWsKIAJvVfTRxFVhYhzFeT0twtuku/5s6yBvbgAZUiAB6DdxKZYqdSuEpfE3fMva+Rakb7MkjEA1Bx5wy+Vm7K36z2PJQXBOOVW3kXOhToqw5levhL9gs546PfhOrSLk6nRx8XBOIdvw/BEaCxIjnz81zC176hM9YqNYqnedkT3d/mNJCdaXbYpK58kPXFzcBt1/sG1axBxR63Q== 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=id3Ep6tox7jziFtgXSfdfgpg6msnemBUMm+8mCJC0ig=; b=R9bkj+unnx+Zqve7VZoMrXNgOC9RS3uqi/vrxLKmK1H7WnsJdGrKXtD3f9xvnCcHQ+MhXMFXQU4epplBcBBRKiSvCQDzj68YZrLdeogOo2GI73XxtP4jnYEUS4uMgDGeqXjkkuSvRtmo7H16mEMFnQLVWYYRlMNApwtPEfv7fyk= Received: from BN9PR03CA0313.namprd03.prod.outlook.com (2603:10b6:408:112::18) by DM4PR12MB8522.namprd12.prod.outlook.com (2603:10b6:8:18f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul 2023 12:54:57 +0000 Received: from BN8NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::f2) by BN9PR03CA0313.outlook.office365.com (2603:10b6:408:112::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend Transport; Thu, 20 Jul 2023 12:54:57 +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 BN8NAM11FT109.mail.protection.outlook.com (10.13.176.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6609.25 via Frontend Transport; Thu, 20 Jul 2023 12:54:57 +0000 Received: from amd.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.2507.23; Thu, 20 Jul 2023 07:54:54 -0500 From: Muralidhara M K To: , CC: , , , , , , Muralidhara M K Subject: [PATCH 5/7] EDAC/amd64: Add Fam19h Model 90h ~ 9fh enumeration support Date: Thu, 20 Jul 2023 12:54:23 +0000 Message-ID: <20230720125425.3735538-6-muralimk@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720125425.3735538-1-muralimk@amd.com> References: <20230720125425.3735538-1-muralimk@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: BN8NAM11FT109:EE_|DM4PR12MB8522:EE_ X-MS-Office365-Filtering-Correlation-Id: d9109e6d-632d-4bfc-0b09-08db89208587 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rAgUJEUm9IDeGm8vLvJNwhuDiTF58I66uif4PCLOxYF7V8+KlsdrMp5aqNn653EEtYGWyefGZuA375upXztiigMiDC1xu7KBO0Mg8YCcWo+buhvorp1zXMhXo4NoQfNqAk8H2bYjO5KmzamJZiJQas92+R7h5qktyZ2PVljksdWXPcLyMqewlwB6+rPwD/77Tk8LbvM9r9KLkishyv1/2Lxn+DFQnS7QdFl8KBhW7w2HKhmgkZyC+sU/gBvQePuioelqQDt7qzqywS4RyjILbaj2QWlDXIg8g0owBBe8UdSEsCrsjVosG900YQbQrLy57rVGw3dvyNwLe2yjR0JBN+2TKxYyQHUDklOloFco6pdSFe2bmgfU6H+iuGPQJToxHwK+qIsAbQ5WVQHKDVNZYfl0UOYe5dg+9qZKUVkyowCUIZ/ILzSsLS3PRjsEO29qdaiebHDCRqJ2QAbSylJeGCBc/58AqlKMfeiWNSE5pFbLrgbdWAO9NO912Y2nrYeylqJCeOODZ/RgrDGqUXey8QNeiHaXl+hu42Cuvu26Um82zSTNkY0v87gkGM6N2XljPqPP3jCk+Cg9SwaUyNJWAM7h+W6M5pO8kqAFmO0X6RZjoCU3gvcTXZitvawZvhGpdvuwmlahl44Pvki8SSTjB/v9YNyTUYg+e2843rSNEU4gYIvHyuHpg3CkkTC8ji8Ag6vViMQIy87h6BkZxDnz9IFTkaIXKYoONkpaeHO7FrxGKlDOPO7Oy/8hh/CMq7ksTCD7l/++ilZIg1nu1xN8eA== 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:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199021)(82310400008)(40470700004)(36840700001)(46966006)(478600001)(83380400001)(336012)(1076003)(26005)(41300700001)(40480700001)(186003)(110136005)(54906003)(8936002)(8676002)(316002)(356005)(2906002)(4326008)(7696005)(36860700001)(70206006)(6666004)(81166007)(40460700003)(2616005)(426003)(70586007)(16526019)(5660300002)(47076005)(36756003)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:54:57.4767 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9109e6d-632d-4bfc-0b09-08db89208587 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: BN8NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8522 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K Add AMD family 19h Model 90h-9fh. Models 90h-9fh are APUs, and they have built-in HBM3 memory. ECC support is enabled by default. APU models have a single Data Fabric (DF) per Package. Each DF is visible to the OS in the same way as chiplet-based systems like Rome and later. However, the Unified Memory Controllers (UMCs) are arranged in the same way as GPU-based MI200 devices rather than CPU-based systems. So, it uses the gpu_ops for enumeration and adds a few fixups. Signed-off-by: Muralidhara M K --- drivers/edac/amd64_edac.c | 65 +++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 597dae7692b1..45d8093c117a 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -996,12 +996,16 @@ static struct local_node_map { #define LNTM_NODE_COUNT GENMASK(27, 16) #define LNTM_BASE_NODE_ID GENMASK(11, 0) -static int gpu_get_node_map(void) +static int gpu_get_node_map(struct amd64_pvt *pvt) { struct pci_dev *pdev; int ret; u32 tmp; + /* return early for non heterogeneous systems */ + if (pvt->F3->device != PCI_DEVICE_ID_AMD_MI200_DF_F3) + return 0; + /* * Node ID 0 is reserved for CPUs. * Therefore, a non-zero Node ID means we've already cached the values. @@ -3851,7 +3855,7 @@ static void gpu_init_csrows(struct mem_ctl_info *mci) dimm->nr_pages = gpu_get_csrow_nr_pages(pvt, umc, cs); dimm->edac_mode = EDAC_SECDED; - dimm->mtype = MEM_HBM2; + dimm->mtype = pvt->dram_type; dimm->dtype = DEV_X16; dimm->grain = 64; } @@ -3880,6 +3884,9 @@ static bool gpu_ecc_enabled(struct amd64_pvt *pvt) return true; } +/* Base address used for channels selection on GPUs */ +static u32 gpu_umc_base = 0x50000; + static inline u32 gpu_get_umc_base(u8 umc, u8 channel) { /* @@ -3893,13 +3900,32 @@ static inline u32 gpu_get_umc_base(u8 umc, u8 channel) * On GPU nodes channels are selected in 3rd nibble * HBM chX[3:0]= [Y ]5X[3:0]000; * HBM chX[7:4]= [Y+1]5X[3:0]000 + * + * On APU nodes, same as GPU but with diff base 0x90000; */ umc *= 2; if (channel >= 4) umc++; - return 0x50000 + (umc << 20) + ((channel % 4) << 12); + return gpu_umc_base + (umc << 20) + ((channel % 4) << 12); +} + +static void gpu_determine_memory_type(struct amd64_pvt *pvt) +{ + if (pvt->fam == 0x19) { + switch (pvt->model) { + case 0x30 ... 0x3F: + pvt->dram_type = MEM_HBM2; + break; + case 0x90 ... 0x9F: + pvt->dram_type = MEM_HBM3; + break; + default: + break; + } + } + edac_dbg(1, " MEM type: %s\n", edac_mem_types[pvt->dram_type]); } static void gpu_read_mc_regs(struct amd64_pvt *pvt) @@ -3960,7 +3986,7 @@ static int gpu_hw_info_get(struct amd64_pvt *pvt) { int ret; - ret = gpu_get_node_map(); + ret = gpu_get_node_map(pvt); if (ret) return ret; @@ -3971,6 +3997,7 @@ static int gpu_hw_info_get(struct amd64_pvt *pvt) gpu_prep_chip_selects(pvt); gpu_read_base_mask(pvt); gpu_read_mc_regs(pvt); + gpu_determine_memory_type(pvt); return 0; } @@ -4142,6 +4169,12 @@ static int per_family_init(struct amd64_pvt *pvt) pvt->ctl_name = "F19h_M70h"; pvt->flags.zn_regs_v2 = 1; break; + case 0x90 ... 0x9f: + pvt->ctl_name = "F19h_M90h"; + pvt->max_mcs = 4; + gpu_umc_base = 0x90000; + pvt->ops = &gpu_ops; + break; case 0xa0 ... 0xaf: pvt->ctl_name = "F19h_MA0h"; pvt->max_mcs = 12; @@ -4166,23 +4199,31 @@ static const struct attribute_group *amd64_edac_attr_groups[] = { NULL }; +/* + * For Heterogeneous and APU models EDAC CHIP_SELECT and CHANNEL layers + * should be swapped to fit into the layers. + */ +static unsigned int get_layer_size(struct amd64_pvt *pvt, u8 layer) +{ + bool is_gpu = (pvt->ops == &gpu_ops); + + if (!layer) + return is_gpu ? pvt->max_mcs : pvt->csels[0].b_cnt; + + return is_gpu ? pvt->csels[0].b_cnt : pvt->max_mcs; +} + static int init_one_instance(struct amd64_pvt *pvt) { struct mem_ctl_info *mci = NULL; struct edac_mc_layer layers[2]; int ret = -ENOMEM; - /* - * For Heterogeneous family EDAC CHIP_SELECT and CHANNEL layers should - * be swapped to fit into the layers. - */ layers[0].type = EDAC_MC_LAYER_CHIP_SELECT; - layers[0].size = (pvt->F3->device == PCI_DEVICE_ID_AMD_MI200_DF_F3) ? - pvt->max_mcs : pvt->csels[0].b_cnt; + layers[0].size = get_layer_size(pvt, 0); layers[0].is_virt_csrow = true; layers[1].type = EDAC_MC_LAYER_CHANNEL; - layers[1].size = (pvt->F3->device == PCI_DEVICE_ID_AMD_MI200_DF_F3) ? - pvt->csels[0].b_cnt : pvt->max_mcs; + layers[1].size = get_layer_size(pvt, 1); layers[1].is_virt_csrow = false; mci = edac_mc_alloc(pvt->mc_node_id, ARRAY_SIZE(layers), layers, 0); From patchwork Thu Jul 20 12:54:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M K, Muralidhara" X-Patchwork-Id: 13320457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EC4FEB64DC for ; Thu, 20 Jul 2023 12:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231314AbjGTMz0 (ORCPT ); Thu, 20 Jul 2023 08:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbjGTMzR (ORCPT ); Thu, 20 Jul 2023 08:55:17 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2071.outbound.protection.outlook.com [40.107.243.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AFFA2722; Thu, 20 Jul 2023 05:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ciFG9DhHDbGUwpBvTMX/FFuQUf7IpqyMgcI62KAmtBs4+yOuhx6PuihWC5zthRedeVQCYcXmfpSWEMnFwxYOUM57XeYoKsgque9UiaExlMH3ckJNlcaY9WQanGgb/C68Tzsh6tX0zK3sud5j4Hbsg3DSNUDHMvlXvEE7nvygwt6HO7mHhBslnX2VN4C4A//xJ+pvi6Y17vsBry+SfZIL0CGHljxDSeDKER0I71pdS8RRtv3SFkIP6HAWVF3sm3WjOwgm/gmtbFOxv7+XWRgf0acGgsTla3VQLRLaM75AmQya7GCO9/iMNlIXTz73pDq0djTYV62D+VWLm8wgP33SpA== 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=U9yRez6h0uRSAITgN3HzUnO3UVFKjwjVboVPu2W1haY=; b=f9mOPxtawmepysmyhWp6hgQpWiggwXkZKnTTWww7WE53klrvU1P3aZ7dnantg+OBZ5gOuuB6exmzSnZo5ETtxyP5+Jc9cX0HfuQB0KxXry56vRzZ65UMFzXTplQpBVQ539vFrAzA5W9REkNk2ToxFrwgg9NlV0TBXWXfOKq7MCTwd2ElcygjxLuY/hnwsrhbX5r6Y+htW9jIzjXuNJC6Lxu40Oa8YTMkjh3PouPTD1zU9B/6r4IkYF5oUnFrCr6zHQKWwaAj02nsZXK6fKts7g2XiQiu1Gra5SSz9BPWxF4pxcsvp5xpHwO0E7BjPa4j09BtRqpcklYmdXCUVhYOMg== 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=U9yRez6h0uRSAITgN3HzUnO3UVFKjwjVboVPu2W1haY=; b=vWbpOmro9VM3aXVTVVVRhZyi1WSef3ZxfMlB5sTdviIT3vew+TzW7Vj0boPSxsKvG5Imoz3kem4FegidlOhgTbDrjmYfq3YatjBWWDlPzfJuaz0S0dtp//jB34INstBtYElzqEBYxUAjVamGVBIPaLXb3BlA43s2A6NL95BRHqQ= Received: from BN9PR03CA0256.namprd03.prod.outlook.com (2603:10b6:408:ff::21) by MN2PR12MB4125.namprd12.prod.outlook.com (2603:10b6:208:1d9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul 2023 12:55:00 +0000 Received: from BN8NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ff:cafe::5f) by BN9PR03CA0256.outlook.office365.com (2603:10b6:408:ff::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend Transport; Thu, 20 Jul 2023 12:55:00 +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 BN8NAM11FT017.mail.protection.outlook.com (10.13.177.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.34 via Frontend Transport; Thu, 20 Jul 2023 12:55:00 +0000 Received: from amd.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.2507.23; Thu, 20 Jul 2023 07:54:57 -0500 From: Muralidhara M K To: , CC: , , , , , , Muralidhara M K , Naveen Krishna Chatradhi Subject: [PATCH 6/7] EDAC/amd64: Add error instance get_err_info() to pvt->ops Date: Thu, 20 Jul 2023 12:54:24 +0000 Message-ID: <20230720125425.3735538-7-muralimk@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720125425.3735538-1-muralimk@amd.com> References: <20230720125425.3735538-1-muralimk@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: BN8NAM11FT017:EE_|MN2PR12MB4125:EE_ X-MS-Office365-Filtering-Correlation-Id: 8638fa0d-c730-40c9-4870-08db89208738 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6rg+zHz7NoaAdVrld3L2RELt40X9NJd6C3Vi2CEoJc4JXH4ToIofIh7typbWHaOYa6JwY3Bq/IUeeoJ8IrDw/G184hXW3RzygjPXZ9P/8OEnv8VAhhiwJlIjUrNMCsZLHMRcT7oBbWRtfKXnixpDta6TyavzVqjnXY85czKLE1bIJXMXIZWLyfBe5x2XoWqTLPjagw5rtbXrCTRKcsvrnYs1gjB4nGqw/AWL3Wp1Q25jCQINaIN434wVaeS1thQKJ2u7cFzkv74S7TLdt/vOAyjdpJXj19OS+/Bpt9E+cKVphLl0fQb5S1Ib2LA0jNqpWTZPegkdZxYdh7j+y+dOVgTmWupbzyMS7806mBqBlO449xYHYZ6JKkWAWr58lSG0yrNabRA2Xq3kjYd+f3Eufn4PmLHWi6sJ9GlWpjZ9NjCrzKo8fqQ4w4iN8Jpqx6wjOQgM1lZkoqzJ2EylrYFM+d/tvQZl14tw4IaazitRMKumKz6+VyZXcqbcZgVGvLobkUxhPNvsX5gZDB3ByE2AStHvIBMC3qF453EkexkcQ7ZeCjNQ2AFFeXLZXyYjeHmFGN5EEunK3xWgWmz9lHTwDv3oplVQGnoPD6pqzTV83oy2M+RcVQjtwv3120StQePD19Gnl25Wnzhqm1pBOJnI02QKrzykzG1x1KUfrQxspAXrfzZPiThgkxGx1aWxhtw1W0GHNMC/F7rOs8hTnNNTPv5j/8dqyOQ14RCb25nifFMxhIiRZAqxxMKAduL7l1zG6ZNpVMCNAhpRK7qQaH3s6g== 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:(13230028)(4636009)(346002)(376002)(396003)(136003)(39860400002)(451199021)(82310400008)(36840700001)(46966006)(40470700004)(478600001)(83380400001)(336012)(1076003)(40480700001)(186003)(41300700001)(26005)(110136005)(54906003)(8676002)(8936002)(316002)(356005)(2906002)(426003)(4326008)(7696005)(36860700001)(70206006)(6666004)(81166007)(40460700003)(2616005)(16526019)(70586007)(47076005)(36756003)(82740400003)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:55:00.3159 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8638fa0d-c730-40c9-4870-08db89208738 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: BN8NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4125 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K On CPUs the data fabric ID of an instance on a CPU is equal to the UMC number. since the UMC number and channel are equal in CPU nodes, the channel can be used as the data fabric ID of the instance. GPU node has 'X' number of PHYs and 'Y' number of channels. This results in 'X*Y' number of instances in the data fabric. Therefore the data fabric ID of an instance in GPU as below: df_inst_id = 'X' * number of channels per PHY + 'Y' Co-developed-by: Naveen Krishna Chatradhi Signed-off-by: Naveen Krishna Chatradhi Signed-off-by: Muralidhara M K --- drivers/edac/amd64_edac.c | 36 +++++++++++++++++++++++++++++++++++- drivers/edac/amd64_edac.h | 2 ++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 45d8093c117a..74b2b47cc22a 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -3047,6 +3047,17 @@ static inline void decode_bus_error(int node_id, struct mce *m) __log_ecc_error(mci, &err, ecc_type); } +/* + * On CPUs, The data fabric ID of an instance is equal to the UMC number. + * and since the UMC number and channel are equal in CPU nodes, the channel can be + * used as the data fabric ID of the instance. + */ +static int umc_inst_id(struct mem_ctl_info *mci, struct amd64_pvt *pvt, + struct err_info *err) +{ + return err->channel; +} + /* * To find the UMC channel represented by this bank we need to match on its * instance_id. The instance_id of a bank is held in the lower 32 bits of its @@ -3071,6 +3082,7 @@ static void decode_umc_error(int node_id, struct mce *m) struct mem_ctl_info *mci; struct amd64_pvt *pvt; struct err_info err; + u8 df_inst_id; u64 sys_addr; node_id = fixup_node_id(node_id, m); @@ -3101,8 +3113,9 @@ static void decode_umc_error(int node_id, struct mce *m) } pvt->ops->get_err_info(m, &err); + df_inst_id = pvt->ops->get_inst_id(mci, pvt, &err); - if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) { + if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, df_inst_id, &sys_addr)) { err.err_code = ERR_NORM_ADDR; goto log_error; } @@ -3758,6 +3771,25 @@ static int umc_hw_info_get(struct amd64_pvt *pvt) return 0; } +/* + * A GPU node has 'X' number of PHYs and 'Y' number of channels. + * This results in 'X*Y' number of instances in the data fabric. + * Therefore the data fabric ID of an instance can be found with the following formula: + * df_inst_id = 'X' * number of channels per PHY + 'Y' + * + */ +static int gpu_inst_id(struct mem_ctl_info *mci, struct amd64_pvt *pvt, + struct err_info *err) +{ + int i, channels = 0; + + /* The memory channels in case of GPUs are fully populated */ + for_each_umc(i) + channels += pvt->csels[i].b_cnt; + + return (err->csrow * channels / mci->nr_csrows) + err->channel; +} + /* * The CPUs have one channel per UMC, so UMC number is equivalent to a * channel number. The GPUs have 8 channels per UMC, so the UMC number no @@ -4015,6 +4047,7 @@ static struct low_ops umc_ops = { .setup_mci_misc_attrs = umc_setup_mci_misc_attrs, .dump_misc_regs = umc_dump_misc_regs, .get_err_info = umc_get_err_info, + .get_inst_id = umc_inst_id, }; static struct low_ops gpu_ops = { @@ -4023,6 +4056,7 @@ static struct low_ops gpu_ops = { .setup_mci_misc_attrs = gpu_setup_mci_misc_attrs, .dump_misc_regs = gpu_dump_misc_regs, .get_err_info = gpu_get_err_info, + .get_inst_id = gpu_inst_id, }; /* Use Family 16h versions for defaults and adjust as needed below. */ diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h index 5a4e4a59682b..d9e9e62dd4b1 100644 --- a/drivers/edac/amd64_edac.h +++ b/drivers/edac/amd64_edac.h @@ -471,6 +471,8 @@ struct low_ops { void (*setup_mci_misc_attrs)(struct mem_ctl_info *mci); void (*dump_misc_regs)(struct amd64_pvt *pvt); void (*get_err_info)(struct mce *m, struct err_info *err); + int (*get_inst_id)(struct mem_ctl_info *mci, struct amd64_pvt *pvt, + struct err_info *err); }; int __amd64_read_pci_cfg_dword(struct pci_dev *pdev, int offset, From patchwork Thu Jul 20 12:54:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "M K, Muralidhara" X-Patchwork-Id: 13320458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3056BEB64DA for ; Thu, 20 Jul 2023 12:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231301AbjGTMzh (ORCPT ); Thu, 20 Jul 2023 08:55:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231562AbjGTMz1 (ORCPT ); Thu, 20 Jul 2023 08:55:27 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2066.outbound.protection.outlook.com [40.107.237.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F8DE26B2; Thu, 20 Jul 2023 05:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oR6ADlBSzHaiFZuMT8iCWBSDC+ooccLocm4PjbZvrNlNVeT5HQXrf6w0CeXODhWaqxa2tD9YjRvY4DWXwMJSsiTdmXq+MsJOPY4Y6gXmor85OWCLufASzzxPxYwPDedSfOGCwnssirIHzI3rY0tlblbWsbAna/ULLEkl5W4n8GPD31J1/gEhAWfeDlBJQQSojTyGLGAj09bqqCw9lJNAvcEchIkqYfRmIvM0P5YYpUZHOBDi686FudD5LOiN1l0OEdQCON7JBDz9K6VI4MLyO5c3fFue9xiA+Bs2+cqWIS6AqDPxbRoqcuO73R09CQZSdwJVkis5KRKoaGkd2c7qNg== 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=gpF5CU3R3oxAqvV9qnvtGlkZ4ET7rpxtO10T0fLl03s=; b=luqUZfZMX10eNfIQaUCG6t9Re3RmEaDd5D/D4r7BlsOOR/vMOkqEORg4Sivd2x80xc9/OWYsRrwvJkVUd2d/1w5/8SXRnniaGJKuv1Fij29IjY520gSebZVjCVMzwAsyYQhN57Ch8jSxqEN+uOxyUfUK+jOpN/VKTlBeTdGuyZvxaaMpff/D/napn+fM3ge+t15Eq6fJKCm0MTGZbMYOgVtPmC9MBOjQDvxItS1a27EwOG+p0r6L1I229F9LZELk0Q8dNezTIMgQrcAtZJhwVSQoU/Ri0Sm//OH4I520Bnhlqk18wWuFzgiDJzBkhEcD8KjPmWT6JagKMaYnyl3zJg== 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=gpF5CU3R3oxAqvV9qnvtGlkZ4ET7rpxtO10T0fLl03s=; b=3uYMQg107kt6AaK8hw/E328E3DwqyH+oRJh0dmYlKSY/wNStnl3wvdFF5Lm4gpEDvX6MG8iRgENdFa/lIlS7A+NGAOKLj7ePzwLEtX/jrwrUfgnSO/bkFzxpWHAIEEuuI9rz01K9+gDtoy3CgQ4xhe8/sw3QuKLkUSqlWaX2OXo= Received: from BN0PR03CA0035.namprd03.prod.outlook.com (2603:10b6:408:e7::10) by DM4PR12MB6399.namprd12.prod.outlook.com (2603:10b6:8:b7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul 2023 12:55:03 +0000 Received: from BN8NAM11FT105.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::84) by BN0PR03CA0035.outlook.office365.com (2603:10b6:408:e7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend Transport; Thu, 20 Jul 2023 12:55:03 +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 BN8NAM11FT105.mail.protection.outlook.com (10.13.176.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6609.28 via Frontend Transport; Thu, 20 Jul 2023 12:55:03 +0000 Received: from amd.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.2507.23; Thu, 20 Jul 2023 07:55:00 -0500 From: Muralidhara M K To: , CC: , , , , , , Muralidhara M K Subject: [PATCH 7/7] EDAC/amd64: Add Error address conversion for UMC Date: Thu, 20 Jul 2023 12:54:25 +0000 Message-ID: <20230720125425.3735538-8-muralimk@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720125425.3735538-1-muralimk@amd.com> References: <20230720125425.3735538-1-muralimk@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: BN8NAM11FT105:EE_|DM4PR12MB6399:EE_ X-MS-Office365-Filtering-Correlation-Id: c0489295-1caf-4fb3-f7ab-08db892088ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DLsAR0bx0SiXg7wyOlZqqsbdn9aqetXOS78T4pnvPtm8BGgxA7vPoyr+3eOfWtnqX/qQezF9igQ7W1IEwX0F/3E16O513EoDGZ59TBeH7oO36lyHHWdxYt7lVERyAopPIiIrYrUjsOqUS+DQYDy37LTAkEe07hDP6+3n0HDyYnmtaKh/WH9B0ljBwooLzMEEpQykHAzDXGYAm1uhsUmtFTghEjHF/Iq7HryHqTa9cRnBAMm2iZaywYZAp3ALknczy2RZsAdqvLDHnn+I4qDN+3rP4Md55yXyy+oErxJLbdwNWoZEHqIZKpfNF6BwFikXHFP/Utf2y7WYYuNDnDxxpnuNnI8fk68gTOpfoe477D2HyN8vSakD3NNgbS0J1IjEWKlBt8ehSZyP3G+H+ioYFG6CX5z8tAJhLCNJ7V3oh8R6bP1F/UWdE4vvZw1VS28L9iAAlr4hTuXv6wr9+26VEAzfIwPyNSSD3MHLqNEpcLuCLSKtdi3DHTVCO9Ps5UwfxBxp8XOklUO9B9SGCIzWeaLcohuAl5cTYijE1YmypH+UVA31YJEmuUGh1QguU2n/MdPtpdsKvJnlDzVIbFWq1p7u3QeNM7cQCMH1/+yp4IxnAPtptd/Ro5gajjBNrS8ai0xBjCAQK4mi/0uZUt5QUhz4Tppo206JeiHTwlwMwvE8re2xfktzmbiGuR83GnMW1L+KW6A89LcyUKdYH817ZW6YVaMNV26o3fz/WCWK7XvszXmiJ8HgIpTXOF2rp+HGRZMjcxQajwP9qBOy86IEcg== 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:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(136003)(82310400008)(451199021)(40470700004)(46966006)(36840700001)(40480700001)(41300700001)(5660300002)(8676002)(8936002)(4326008)(40460700003)(110136005)(70206006)(54906003)(70586007)(316002)(82740400003)(356005)(81166007)(2906002)(6666004)(2616005)(36756003)(426003)(7696005)(1076003)(26005)(186003)(16526019)(336012)(47076005)(36860700001)(478600001)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:55:03.1909 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c0489295-1caf-4fb3-f7ab-08db892088ee 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: BN8NAM11FT105.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6399 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Muralidhara M K Reported MCA address is DRAM address which needs to be converted to normalized address before Data fabric address translation. Some AMD systems have on-chip memory capable of OnDie ECC support. OnDie-ECC error address to MCA is a DRAM decoded address reported with a DRAM address (PC/SID/Bank/ROW/COL) instead of normalized address unlike MI200’s UMC ECC, as the implementation difference between HBM3 ODECC and HBM2 host ECC. Because OnDie-ECC address reporting is done in the back-end of UMC and it no longer has normalized address at that point. So software needs to convert the reported MCA Error Address back to normalized address. Signed-off-by: Muralidhara M K --- drivers/edac/amd64_edac.c | 160 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 74b2b47cc22a..304d104c25d8 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -3076,6 +3076,159 @@ static void umc_get_err_info(struct mce *m, struct err_info *err) err->csrow = m->synd & 0x7; } +static bool internal_bit_wise_xor(u32 inp) +{ + bool tmp = 0; + + for (int i = 0; i < 32; i++) + tmp = tmp ^ ((inp >> i) & 0x1); + + return tmp; +} + +/* mapping of MCA error address to normalized address */ +static const u8 umc_mca2na_mapping[] = { + 0, 5, 6, 8, 9, 14, 12, 13, + 10, 11, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, + 7, 29, 30, +}; + +/* + * Read AMD PPR UMC::AddrHashBank and + * UMC::CH::AddrHashPC/PC2 register fields + */ +static struct { + u32 xor_enable :1; + u32 col_xor :13; + u32 row_xor :18; +} addr_hash_pc, addr_hash_bank[4]; + +static struct { + u32 bank_xor :6; +} addr_hash_pc2; + +/* + * The location of bank, column and row are fixed. + * location of column bit must be NA[5]. + * Row bits are always placed in a contiguous stretch of NA above the + * column and bank bits. + * Bits below the row bits can be either column or bank in any order, + * with the exception that NA[5] must be a column bit. + * Stack ID(SID) bits are placed in the MSB position of the NA. + */ +static int umc_ondie_addr_to_normaddr(u64 mca_addr, u16 nid) +{ + u32 bank[4], bank_hash[4], pc_hash; + u32 col, row, rawbank = 0, pc; + int i, temp = 0; + u64 mca2na; + + u32 gpu_umc_base = 0x90000; + + /* + * the below calculation, trying to maps ondie error address + * to normalized address. logged ondie MCA address format is + * BEQ_MCA_RdDatAddr[27:0] = + * {SID[1:0],PC[0],row[14:0],bank[3:0],col[4:0],1'b0} + * The conversion mappings are: + * + * Normalized location ondie MCA error Address + * =================== ====================== + * NA[4] = 1'b0 + * NA[5] = col[0] = BEQ_MCA_RdDatAddr[1] + * NA[6] = col[1] = BEQ_MCA_RdDatAddr[2] + * NA[8] = col[2] = BEQ_MCA_RdDatAddr[3] + * NA[9] = col[3] = BEQ_MCA_RdDatAddr[4] + * NA[14] = col[4] = BEQ_MCA_RdDatAddr[5] + * NA[12] = bank[0] = BEQ_MCA_RdDatAddr[5] + * NA[13] = bank[1] = BEQ_MCA_RdDatAddr[6] + * NA[10] = bank[2] = BEQ_MCA_RdDatAddr[7] + * NA[11] = bank[3] = BEQ_MCA_RdDatAddr[8] + * + * row low is 12 bit locations, low lsb bit starts from 10 + * NA[15..26] = row[0..11] = BEQ_MCA_RdDatAddr[10..21] + * + * row high is 2 bit locations, high lsb bit starts from 22 + * NA[27..28] = row[12..13] = BEQ_MCA_RdDatAddr[22..23] + * + * NA[7] = PC[0] = BEQ_MCA_RdDatAddr[25] + * NA[29] = sid[0] = bank[4] = BEQ_MCA_RdDatAddr[26] + * NA[30] = sid[1] = bank[5] = BEQ_MCA_RdDatAddr[27] + * Basically, it calculates a locations to fit as shown in + * table umc_mca2na_mapping[]. + * + * XORs need to be applied based on the hash settings below. + */ + + /* Calculate column and row */ + col = FIELD_GET(GENMASK(5, 1), mca_addr); + row = FIELD_GET(GENMASK(23, 10), mca_addr); + + /* Apply hashing on below banks for bank calculation */ + for (i = 0; i < 4; i++) + bank_hash[i] = (mca_addr >> (6 + i)) & 0x1; + + /* bank hash algorithm */ + for (i = 0; i < 4; i++) { + /* Read AMD PPR UMC::AddrHashBank register*/ + if (!amd_smn_read(nid, gpu_umc_base + 0xC8 + (i * 4), &temp)) { + addr_hash_bank[i].xor_enable = temp & 1; + addr_hash_bank[i].col_xor = FIELD_GET(GENMASK(13, 1), temp); + addr_hash_bank[i].row_xor = FIELD_GET(GENMASK(31, 14), temp); + /* bank hash selection */ + bank[i] = bank_hash[i] ^ (addr_hash_bank[i].xor_enable & + (internal_bit_wise_xor(col & addr_hash_bank[i].col_xor) ^ + internal_bit_wise_xor(row & addr_hash_bank[i].row_xor))); + } + } + + /* To apply hash on pc bit */ + pc_hash = (mca_addr >> 25) & 0x1; + + /* Read AMD PPR UMC::CH::AddrHashPC register */ + if (!amd_smn_read(nid, gpu_umc_base + 0xE0, &temp)) { + addr_hash_pc.xor_enable = temp & 1; + addr_hash_pc.col_xor = FIELD_GET(GENMASK(13, 1), temp); + addr_hash_pc.row_xor = FIELD_GET(GENMASK(31, 14), temp); + } + /* Read AMD PPR UMC::CH::AddrHashPC2 register*/ + if (!amd_smn_read(nid, gpu_umc_base + 0xE4, &temp)) + addr_hash_pc2.bank_xor = FIELD_GET(GENMASK(5, 0), temp); + + /* Calculate bank value from bank[0..3], bank[4] and bank[5] */ + for (i = 0; i < 4; i++) + rawbank |= (bank[i] & 1) << i; + + rawbank |= (mca_addr >> 22) & 0x30; + + /* pseudochannel(pc) hash selection */ + pc = pc_hash ^ (addr_hash_pc.xor_enable & + (internal_bit_wise_xor(col & addr_hash_pc.col_xor) ^ + internal_bit_wise_xor(row & addr_hash_pc.row_xor) ^ + internal_bit_wise_xor(rawbank & addr_hash_pc2.bank_xor))); + + /* Mask b'25(pc_bit) and b'[9:6](bank) */ + mca_addr &= ~0x20003c0ULL; + + for (i = 0; i < 4; i++) + mca_addr |= (bank[i] << (6 + i)); + + mca_addr |= (pc << 25); + + /* NA[4..0] is fixed */ + mca2na = 0x0; + /* convert mca error address to normalized address */ + for (i = 1; i < ARRAY_SIZE(umc_mca2na_mapping); i++) + mca2na |= ((mca_addr >> i) & 0x1) << umc_mca2na_mapping[i]; + + mca_addr = mca2na; + pr_emerg(HW_ERR "Error Addr: 0x%016llx\n", mca_addr); + pr_emerg(HW_ERR "Error hit on Bank: %d Row: %d Column: %d\n", rawbank, row, col); + + return mca_addr; +} + static void decode_umc_error(int node_id, struct mce *m) { u8 ecc_type = (m->status >> 45) & 0x3; @@ -3115,6 +3268,13 @@ static void decode_umc_error(int node_id, struct mce *m) pvt->ops->get_err_info(m, &err); df_inst_id = pvt->ops->get_inst_id(mci, pvt, &err); + /* + * The reported MCA address(Error Addr) is DRAM decoded address which needs to be + * converted to normalized address before DF address translation. + */ + if (pvt->fam == 0x19 && (pvt->model >= 0x90 && pvt->model <= 0x9f)) + m->addr = umc_ondie_addr_to_normaddr(m->addr, pvt->mc_node_id); + if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, df_inst_id, &sys_addr)) { err.err_code = ERR_NORM_ADDR; goto log_error;