lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5.4 150/453] EDAC/mce_amd: Use struct cpuinfo_x86.cpu_die_id for AMD NodeId
On Mon, Dec 28, 2020 at 01:46:26PM +0100, Greg Kroah-Hartman wrote:
> From: Yazen Ghannam <yazen.ghannam@amd.com>
>
> [ 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 <yazen.ghannam@amd.com>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Link: https://lkml.kernel.org/r/20201109210659.754018-4-Yazen.Ghannam@amd.com
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> 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 ea622c6f3a393..c19640a453f22 100644
> --- a/drivers/edac/mce_amd.c
> +++ b/drivers/edac/mce_amd.c
> @@ -975,7 +975,7 @@ static void decode_smca_error(struct mce *m)
> }
>
> 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)

I believe this one needs:

028c221ed190 ("x86/CPU/AMD: Save AMD NodeId as cpu_die_id")

to be backported too otherwise ->cpu_die_id will be uninitialized.

--
Regards/Gruss,
Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg

\
 
 \ /
  Last update: 2020-12-28 16:56    [W:1.979 / U:1.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site