x86/mce: Correct the machine check vendor for Hygon
PATCH 1/1 x86/mce: Correct the machine check vendor for Hygon
Currently the xl dmesg output on Hygon platforms will be "(XEN) CPU0: AMD Fam18h machine check reporting enabled", which is misleading as AMD does not have family 18h (Hygon negotiated with AMD to confirm that only Hygon has family 18h).
To correct this, add Hygon machine check type and vendor string.
Signed-off-by Pu Wen <[email protected]>
--- xen/arch/x86/cpu/mcheck/mce.c | 4 +++- xen/arch/x86/cpu/mcheck/mce.h | 3 ++- xen/arch/x86/cpu/mcheck/mce_amd.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)
xen/arch/x86/cpu/mcheck/mce.c +3 -1
@@ -610,7 +610,8 @@ int show_mca_info(int inited, struct cpuinfo_x86 *c)static const char *const type_str[] = { [mcheck_amd_famXX] ="AMD" , [mcheck_amd_k8] ="AMD K8" , - [mcheck_intel] ="Intel" + [mcheck_intel] ="Intel" , + [mcheck_hygon] ="Hygon" }; snprintf(prefix, ARRAY_SIZE(prefix), "%sCPU%u: ",
@@ -625,6 +626,7 @@ int show_mca_info(int inited, struct cpuinfo_x86 *c)break ;case mcheck_amd_famXX: +case mcheck_hygon:printk ("%s%s Fam%xh machine check reporting enabled\n" , prefix, type_str[inited], c->x86);break ;
xen/arch/x86/cpu/mcheck/mce.h +2 -1
@@ -36,7 +36,8 @@ enum mcheck_type { mcheck_none, mcheck_amd_famXX, mcheck_amd_k8, - mcheck_intel + mcheck_intel, + mcheck_hygon };extern uint8_t cmci_apic_vector;
xen/arch/x86/cpu/mcheck/mce_amd.c +2 -1
@@ -339,5 +339,6 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)mce_recoverable_register (mc_amd_recoverable_scan);mce_register_addrcheck (mc_amd_addrcheck); -return mcheck_amd_famXX; +return ci->x86_vendor ==X86_VENDOR_HYGON ? + mcheck_hygon : mcheck_amd_famXX; }
Signature · 1 line
2.23.0
Quoted 8 lines · Pu Wen
Currently the xl dmesg output on Hygon platforms will be "(XEN) CPU0: AMD Fam18h machine check reporting enabled", which is misleading as AMD does not have family 18h (Hygon negotiated with AMD to confirm that only Hygon has family 18h).
To correct this, add Hygon machine check type and vendor string.
Signed-off-by Pu Wen <[email protected]>
Reviewed-by Jan Beulich <[email protected]>