From 6a482b3d73cbdf23c59705e97934ca71cad8df71 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 15 Jul 2024 14:40:26 +0000 Subject: [PATCH] Cleanup MCE error log on non-x86 args We can only register for MCE on x86 arch. Signed-off-by: Mauro Carvalho Chehab --- ras-events.c | 2 +- ras-mce-handler.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ras-events.c b/ras-events.c index 2b4130b..7fe98c5 100644 --- a/ras-events.c +++ b/ras-events.c @@ -988,7 +988,7 @@ int handle_ras_events(int record_events) #ifdef HAVE_MCE rc = register_mce_handler(ras, cpus); - if (rc) + if (rc && rc != -ENOENT) log(ALL, LOG_INFO, "Can't register mce handler\n"); if (ras->mce_priv) { rc = add_event_handler(ras, pevent, page_size, diff --git a/ras-mce-handler.c b/ras-mce-handler.c index 0f09132..f58e291 100644 --- a/ras-mce-handler.c +++ b/ras-mce-handler.c @@ -186,6 +186,11 @@ static int detect_cpu(struct mce_priv *mce) seen |= CPU_FLAGS; } } + if (!seen) { + log(ALL, LOG_INFO, "Can't find a x86 CPU at /proc/cpuinfo. Disabling MCE handler.\n"); + ret = -ENOENT; + goto ret; + } if (seen != CPU_ALL) { log(ALL, LOG_INFO, "Can't parse /proc/cpuinfo: missing%s%s%s%s%s\n",