Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5712650rwd; Mon, 5 Jun 2023 07:35:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68IXowRVFRMO8BZhdN9Qf0FrKm8YZ8SgguzuORG8Qi1UFsBvedxpK8yGNQeTfl77+HHs7j X-Received: by 2002:a17:902:7c97:b0:1aa:f6e9:4cb3 with SMTP id y23-20020a1709027c9700b001aaf6e94cb3mr2282465pll.52.1685975751124; Mon, 05 Jun 2023 07:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685975751; cv=none; d=google.com; s=arc-20160816; b=i3kz+HRDGy+s5IB5VSlYFeqziAfQNZNNpFevmCEBS28re/bB8sY0oQMNyB3Z13uLe0 Gap8YYY3tQMvHoirhG0qRwpac1xIsEHEvWs1pvuiS+MKkbB9GWB0ArfWt4YdZlTz8Oyx 68H/ijcVyMQLVV6wdFYbHFblmRCKUPqkf3R8pkt1Ux1+jg+Wou05t+SeEL2FtKDaLscL bK+QAdEgJHQI49M0jfPuYPVtGbKFxh1nfi3e1psprLEL9tD2qQgjL5tjK9ITXhE5cLtg 4vqQfpDOnbGoX0WzTkn7SU7qFT4Q+9sAn6wWA90yN3wL8WAcu5bojXes3C5Jzd5aKJUe XqOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=VVgxaiIKvFP0oHomVY1t2np/+ULxBfnbtlCnIwdpbWU=; b=0QLxuEMNK3Y/+jtkuJYf/BFQg4ic3J2bDFJyB3woGhDBa1b8VaS87Tk5qN3htM/UDK 2xheNzRpOcNKZfhapJt45zJClRyijWuefjaoaEUbWW2HojP8nnweRvrUK9SEo5Jasl0A C/gEKL5r8Cv0oPCUbj8nfNiAipun4UtAIivTMDeKr3iXqWSSqrCCdzv5bq+KDFNg+un7 WsRO+E72n1x2gEMvQiTlHB0N+pnQDwTZsphZS2bHyTBW+eyh2tnwV1JQTpi3SJVEQoZn A32eAaA3go/4BjHFoTcNIDqrK05wJWNMWfCLTkij+YnpKZz6UdldFUWu/3JU34sPycFX PVFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FGmH2R7c; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a170902f54c00b001b045d65af0si5816022plf.76.2023.06.05.07.35.39; Mon, 05 Jun 2023 07:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FGmH2R7c; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233492AbjFEOUw (ORCPT + 99 others); Mon, 5 Jun 2023 10:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234909AbjFEOPJ (ORCPT ); Mon, 5 Jun 2023 10:15:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3046C10FB; Mon, 5 Jun 2023 07:14:44 -0700 (PDT) Date: Mon, 05 Jun 2023 14:14:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685974482; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VVgxaiIKvFP0oHomVY1t2np/+ULxBfnbtlCnIwdpbWU=; b=FGmH2R7cPw5zRKQMa6NHEmPvtC5TtxPpukqwbV4Cb1ja7l+OvC52Hqz9PH+HRuUVuytA/T kDXJVNZsNYn/3S0L9zBSnqtkSlWSg9T+FLflLB/MGaNPTBq8q5/nTd+POlzGMUFCD6ST6Y Tuf3dBoiwRWbiUMI46Pt9TPjGpfmfb4yGL7emT+mk8T0vPGHLi8v+zW2D73fDOexR31L1r I+ru1MVWCtBNodFDqHMj6/q1ciON6sYmG/3uIus3FGEru3QUCNO5MK6utO/3RFcJ0MOq4V yuPFoWjzGAJ7JW2YnfeTPeL5qNAbKUgjkt6SAJpKAZo0fZhs4rgTpfrvWHFkGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685974482; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VVgxaiIKvFP0oHomVY1t2np/+ULxBfnbtlCnIwdpbWU=; b=TlyNvPAZgDfstRqPBtmT0Kt2rQbiGO3YS4ENC3cjSwxCZjsSYJNDVA9IhIap9Ilx/LHnIU GVej7GEK+QUcsDDQ== From: "tip-bot2 for Yazen Ghannam" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: ras/core] x86/MCE/AMD, EDAC/mce_amd: Decode UMC_V2 ECC errors Cc: Yazen Ghannam , Muralidhara M K , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230515113537.1052146-3-muralimk@amd.com> References: <20230515113537.1052146-3-muralimk@amd.com> MIME-Version: 1.0 Message-ID: <168597448218.404.15334027157988488803.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the ras/core branch of tip: Commit-ID: c35977b00fa76ce5f3fe9afdb9cffda970c943d5 Gitweb: https://git.kernel.org/tip/c35977b00fa76ce5f3fe9afdb9cffda970c943d5 Author: Yazen Ghannam AuthorDate: Mon, 15 May 2023 11:35:34 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 05 Jun 2023 12:27:11 +02:00 x86/MCE/AMD, EDAC/mce_amd: Decode UMC_V2 ECC errors The MI200 (Aldebaran) series of devices introduced a new SMCA bank type for Unified Memory Controllers. The MCE subsystem already has support for this new type. The MCE decoder module will decode the common MCA error information for the new bank type, but it will not pass the information to the AMD64 EDAC module for detailed memory error decoding. Have the MCE decoder module recognize the new bank type as an SMCA UMC memory error and pass the MCA information to AMD64 EDAC. Signed-off-by: Yazen Ghannam Co-developed-by: Muralidhara M K Signed-off-by: Muralidhara M K Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515113537.1052146-3-muralimk@amd.com --- arch/x86/kernel/cpu/mce/amd.c | 6 ++++-- drivers/edac/mce_amd.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c index 0b971f9..5e74610 100644 --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -715,11 +715,13 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) bool amd_mce_is_memory_error(struct mce *m) { + enum smca_bank_types bank_type; /* ErrCodeExt[20:16] */ u8 xec = (m->status >> 16) & 0x1f; + bank_type = smca_get_bank_type(m->extcpu, m->bank); if (mce_flags.smca) - return smca_get_bank_type(m->extcpu, m->bank) == SMCA_UMC && xec == 0x0; + return (bank_type == SMCA_UMC || bank_type == SMCA_UMC_V2) && xec == 0x0; return m->bank == 4 && xec == 0x8; } @@ -1050,7 +1052,7 @@ static const char *get_name(unsigned int cpu, unsigned int bank, struct threshol if (bank_type >= N_SMCA_BANK_TYPES) return NULL; - if (b && bank_type == SMCA_UMC) { + if (b && (bank_type == SMCA_UMC || bank_type == SMCA_UMC_V2)) { if (b->block < ARRAY_SIZE(smca_umc_block_names)) return smca_umc_block_names[b->block]; return NULL; diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index cc5c63f..9215c06 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c @@ -1186,7 +1186,8 @@ static void decode_smca_error(struct mce *m) 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 && xec == 0 && decode_dram_ecc) + if ((bank_type == SMCA_UMC || bank_type == SMCA_UMC_V2) && + xec == 0 && decode_dram_ecc) decode_dram_ecc(topology_die_id(m->extcpu), m); }