From: Smita Koralahalli Date: Thu, 3 Sep 2020 23:45:31 +0000 (-0500) Subject: x86/mce/dev-mcelog: Do not update kflags on AMD systems X-Git-Tag: v5.15~2766^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc0592b73715c8e84ad8ebbc50c6057d5e203aac;p=platform%2Fkernel%2Flinux-starfive.git x86/mce/dev-mcelog: Do not update kflags on AMD systems The mcelog utility is not commonly used on AMD systems. Therefore, errors logged only by the dev_mce_log() notifier will be missed. This may occur if the EDAC modules are not loaded, in which case it's preferable to print the error record by the default notifier. However, the mce->kflags set by dev_mce_log() notifier makes the default notifier skip over the errors assuming they are processed by dev_mce_log(). Do not update kflags in the dev_mce_log() notifier on AMD systems. Signed-off-by: Smita Koralahalli Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200903234531.162484-3-Smita.KoralahalliChannabasappa@amd.com --- diff --git a/arch/x86/kernel/cpu/mce/dev-mcelog.c b/arch/x86/kernel/cpu/mce/dev-mcelog.c index 03e51053..100fbee 100644 --- a/arch/x86/kernel/cpu/mce/dev-mcelog.c +++ b/arch/x86/kernel/cpu/mce/dev-mcelog.c @@ -67,7 +67,9 @@ static int dev_mce_log(struct notifier_block *nb, unsigned long val, unlock: mutex_unlock(&mce_chrdev_read_mutex); - mce->kflags |= MCE_HANDLED_MCELOG; + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) + mce->kflags |= MCE_HANDLED_MCELOG; + return NOTIFY_OK; }