All of lore.kernel.org
 help / color / mirror / Atom feed
* mcelog: Fix "--ascii" parsing to cope with change in kernel output since v4.10
@ 2018-05-22 16:39 Luck, Tony
  0 siblings, 0 replies; 2+ messages in thread
From: Luck, Tony @ 2018-05-22 16:39 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Tony Luck, Borislav Petkov, Jeffrin Thalakkottoor, linux-edac

Linux kernel now includes this change:

 commit cd9c57cad3fe ("x86/MCE: Dump MCE to dmesg if no consumers")

which has this fragment:

-       pr_emerg(HW_ERR "CPU %d: Machine Check Exception: %Lx Bank %d: %016Lx\n",
-              m->extcpu, m->mcgstatus, m->bank, m->status);
+       pr_emerg(HW_ERR "CPU %d: Machine Check%s: %Lx Bank %d: %016Lx\n",
+                m->extcpu,
+                (m->mcgstatus & MCG_STATUS_MCIP ? " Exception" : ""),
+                m->mcgstatus, m->bank, m->status);

that switched from always printing the word "Exception" to only
doing so for errors that were logged during aan exception (i.e. when
IA32_MSR_MCG_STATUS.MCIP is set to one).  This is helpful to human readers
of console logs to distinguish between errors that caused machine checks
from errors that were found later polling machine check banks.  But it
broke the "--ascii" parsing code in mcelog(8) :-(

The change went upstream 15 months ago in v4.10. So the horse has
left the stable and is over the hills and far away.

Fix the parsing code to treat the word "Exception" as optional.

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 mcelog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mcelog.c b/mcelog.c
index 8c09665810ba..2d46afbf9a41 100644
--- a/mcelog.c
+++ b/mcelog.c
@@ -719,7 +719,7 @@ restart:
 		if (!strncmp(s, "CPU ", 4)) { 
 			unsigned cpu = 0, bank = 0;
 			n = sscanf(s,
-	       "CPU %u: Machine Check Exception: %16Lx Bank %d: %016Lx%n",
+	       "CPU %u: Machine Check%*[ :Ec-x]%16Lx Bank %d: %016Lx%n",
 				   &cpu,
 				   &m.mcgstatus,
 				   &bank,

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

* mcelog: Fix "--ascii" parsing to cope with change in kernel output since v4.10
@ 2018-05-22 17:07 Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2018-05-22 17:07 UTC (permalink / raw)
  To: Tony Luck; +Cc: Borislav Petkov, Jeffrin Thalakkottoor, linux-edac

> Fix the parsing code to treat the word "Exception" as optional.

Applied thanks.

-Andi
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-05-22 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 16:39 mcelog: Fix "--ascii" parsing to cope with change in kernel output since v4.10 Luck, Tony
2018-05-22 17:07 Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.