linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/MCE/AMD, EDAC/mce_amd
@ 2020-08-09  4:35 Feng zhou
  2020-08-10 19:10 ` Yazen Ghannam
  0 siblings, 1 reply; 3+ messages in thread
From: Feng zhou @ 2020-08-09  4:35 UTC (permalink / raw)
  To: bp, mchehab, tony.luck, james.morse, rrichter
  Cc: linux-edac, linux-kernel, liuxian.1, zhoufeng.zf

From: zhoufeng <zhoufeng.zf@bytedance.com>

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. so this will cause the address translation function to
fail or report incorrect results.

Signed-off-by: zhoufeng <zhoufeng.zf@bytedance.com>
---
 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 325aedf46ff2..73c805113322 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -996,7 +996,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_physical_package_id(m->extcpu), m);
 }
 
 static inline void amd_decode_err_code(u16 ec)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/MCE/AMD, EDAC/mce_amd
  2020-08-09  4:35 [PATCH] x86/MCE/AMD, EDAC/mce_amd Feng zhou
@ 2020-08-10 19:10 ` Yazen Ghannam
  2020-08-12  4:08   ` [External] " zhoufeng
  0 siblings, 1 reply; 3+ messages in thread
From: Yazen Ghannam @ 2020-08-10 19:10 UTC (permalink / raw)
  To: Feng zhou
  Cc: bp, mchehab, tony.luck, james.morse, rrichter, linux-edac,
	linux-kernel, liuxian.1

On Sun, Aug 09, 2020 at 12:35:59PM +0800, Feng zhou wrote:
> From: zhoufeng <zhoufeng.zf@bytedance.com>
> 
> 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. so this will cause the address translation function to
> fail or report incorrect results.
> 
> Signed-off-by: zhoufeng <zhoufeng.zf@bytedance.com>
> ---
>  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 325aedf46ff2..73c805113322 100644
> --- a/drivers/edac/mce_amd.c
> +++ b/drivers/edac/mce_amd.c
> @@ -996,7 +996,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_physical_package_id(m->extcpu), m);

This will break on Naples systems, because the NodeId and the physical
package ID will not match.

I can send a patch soon that will work for Naples, Rome, and later
systems.

Thanks,
Yazen

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [External] Re: [PATCH] x86/MCE/AMD, EDAC/mce_amd
  2020-08-10 19:10 ` Yazen Ghannam
@ 2020-08-12  4:08   ` zhoufeng
  0 siblings, 0 replies; 3+ messages in thread
From: zhoufeng @ 2020-08-12  4:08 UTC (permalink / raw)
  To: Yazen Ghannam
  Cc: bp, mchehab, tony.luck, james.morse, rrichter, linux-edac,
	linux-kernel, liuxian.1

Ok, as more AMD servers are used in bytedance, we hope to issue a patch 
to the community as soon as possible. Thank you very much.

在 2020/8/11 上午3:10, Yazen Ghannam 写道:
> On Sun, Aug 09, 2020 at 12:35:59PM +0800, Feng zhou wrote:
>> From: zhoufeng <zhoufeng.zf@bytedance.com>
>>
>> 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. so this will cause the address translation function to
>> fail or report incorrect results.
>>
>> Signed-off-by: zhoufeng <zhoufeng.zf@bytedance.com>
>> ---
>>   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 325aedf46ff2..73c805113322 100644
>> --- a/drivers/edac/mce_amd.c
>> +++ b/drivers/edac/mce_amd.c
>> @@ -996,7 +996,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_physical_package_id(m->extcpu), m);
> This will break on Naples systems, because the NodeId and the physical
> package ID will not match.
>
> I can send a patch soon that will work for Naples, Rome, and later
> systems.
>
> Thanks,
> Yazen

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-12  4:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-09  4:35 [PATCH] x86/MCE/AMD, EDAC/mce_amd Feng zhou
2020-08-10 19:10 ` Yazen Ghannam
2020-08-12  4:08   ` [External] " zhoufeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).