Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9127678pxu; Mon, 28 Dec 2020 07:17:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuQR5g+3OChJScKr9Uln3e/xYs2ctEvEOyVhbSC1I8teu1f+yCxALC86i4D01oxpPc8pIq X-Received: by 2002:a05:6402:541:: with SMTP id i1mr43356582edx.289.1609168666183; Mon, 28 Dec 2020 07:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168666; cv=none; d=google.com; s=arc-20160816; b=I24Ll+zYc5u+DzOKzMt5AMxTmeF8M+Q7nm1kXcvkheqbCksLD9/IY5oAhfqDLtNJXz sDX0xomfZssZH+aRrV+LNU9xHoF/OpFFyDXxztVdTrBcOzJQJa092txyTROL58aIhhCo 6xtsw81IPUK6P4AVdXIuCjkN8X7KX04bYqeVP5sld00acZHh4LddL8G54zmxeuhbmb8u 38QUh7+Ha6iEms3XF2H2dCWBKi5ntGIQ20wZTLoXyzybc7sRgNQwTYkJNL/CmT+0MBtR aJvyouMzk9fRZqQ+dwv3B0C37lmvz5SthhWAcxHbscNA+9Iw9WwRFYhuFgCSlSUTadTO xL5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lFZT9ZR6Png7Naounl5X8YpdBhwQ1oht9+7v/ln/IQ8=; b=j3JuPB05tUczn6B1023EuJ+eEB+yClkIC+erqU8Dv6eaHupHFrLMpQ3Vgwwivs4l/Q mpIkh94ooX1T1Ummd4vyc1VEUvlkdDdinvRx1+IH6ZnVhbWFXCmp670ADc/b8idJWoSP hMtWCpnkHLMnh9gNi6HS/fqNXLWdYM+oMRP6+TL0v94Ha/9mdOSZ0ZWiK0hNWPTKDNYj VQGceYgfj06vHY39aJl2vsjLd182+beo5JgfTtvAfq7dWN1ddnu+BqfMz1OVHnLhX4SQ QEWo2TyuAGEw+w8Cdiy1hkvKRtBQA3AvjydGF60XiR5eF04F1ZkX32yX4SEgATCdp/XS VitA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KfjUHDV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si20813444edm.117.2020.12.28.07.17.22; Mon, 28 Dec 2020 07:17:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KfjUHDV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408407AbgL1POK (ORCPT + 99 others); Mon, 28 Dec 2020 10:14:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:40542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438212AbgL1OGs (ORCPT ); Mon, 28 Dec 2020 09:06:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E65DD20715; Mon, 28 Dec 2020 14:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164392; bh=YmMrc9hE929foF7U//7EufubjpTA/I5izZgP3Ec/q7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KfjUHDV2NGb/rFtQYc/K29ERq4pzyp9HqLQ1j+3ShD5LSVpe4IjDiCQfFy8gbEi6y LbjqdJ/+mqOLvrmzez5+yv1L5SwCOz3/1l+CHiv532RxUc9Ru1Xz0j9fhkveGOREzJ lqHxiaXKOZw3Ac5usT9aKzHBSiCponKTjUHQw0BQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yazen Ghannam , Borislav Petkov , Sasha Levin Subject: [PATCH 5.10 164/717] EDAC/mce_amd: Use struct cpuinfo_x86.cpu_die_id for AMD NodeId Date: Mon, 28 Dec 2020 13:42:42 +0100 Message-Id: <20201228125028.813749024@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yazen Ghannam [ Upstream commit 8de0c9917cc1297bc5543b61992d5bdee4ce621a ] The edac_mce_amd module calls decode_dram_ecc() on AMD Family17h and later systems. This function is used in amd64_edac_mod to do system-specific decoding for DRAM ECC errors. The function takes a "NodeId" as a parameter. In AMD documentation, NodeId is used to identify a physical die in a system. This can be used to identify a node in the AMD_NB code and also it is used with umc_normaddr_to_sysaddr(). However, the input used for decode_dram_ecc() is currently the NUMA node of a logical CPU. In the default configuration, the NUMA node and physical die will be equivalent, so this doesn't have an impact. But the NUMA node configuration can be adjusted with optional memory interleaving modes. This will cause the NUMA node enumeration to not match the physical die enumeration. The mismatch will cause the address translation function to fail or report incorrect results. Use struct cpuinfo_x86.cpu_die_id for the node_id parameter to ensure the physical ID is used. Fixes: fbe63acf62f5 ("EDAC, mce_amd: Use cpu_to_node() to find the node ID") Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20201109210659.754018-4-Yazen.Ghannam@amd.com Signed-off-by: Sasha Levin --- drivers/edac/mce_amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index 7f28edb070bd0..6c474fbef32af 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c @@ -1003,7 +1003,7 @@ static void decode_smca_error(struct mce *m) pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]); if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc) - decode_dram_ecc(cpu_to_node(m->extcpu), m); + decode_dram_ecc(topology_die_id(m->extcpu), m); } static inline void amd_decode_err_code(u16 ec) -- 2.27.0