代码拉取完成,页面将自动刷新
From 4cabfce1d55cf437b85ee10cd05504e88d4fa29b Mon Sep 17 00:00:00 2001
From: Ruidong Tian <[email protected]>
Date: Tue, 17 Dec 2024 14:39:42 +0800
Subject: [PATCH 83/85] rasdaemon: mce: decode io port for bus error
mcelog decode bus error with io port like:
...
MCA: BUS error: 0 0 Level-3 Generic IO Request-did-not-timeout
IO MCA reported by root port 0:7b:07.0
...
Introduce the code into rasdaemon.
Signed-off-by: Ruidong Tian <[email protected]>
---
mce-intel.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/mce-intel.c b/mce-intel.c
index 3006e8f..a18cce4 100644
--- a/mce-intel.c
+++ b/mce-intel.c
@@ -21,6 +21,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
@@ -233,6 +234,8 @@ static char *get_RRRR_str(uint8_t rrrr)
static void decode_mca(struct mce_event *e, uint64_t track, int *ismemerr)
{
uint32_t mca = e->status & 0xffffL;
+ uint64_t status = e->status;
+ uint64_t misc = e->misc;
if (mca & (1UL << 12)) {
mce_snprintf(e->mcastatus_msg,
@@ -282,6 +285,16 @@ static void decode_mca(struct mce_event *e, uint64_t track, int *ismemerr)
get_RRRR_str((mca & BUS_RRRR_MASK) >> BUS_RRRR_SHIFT),
decode_attr(II, (mca & BUS_II_MASK) >> BUS_II_SHIFT),
decode_attr(T, (mca & BUS_T_MASK) >> BUS_T_SHIFT));
+ if ((status & MCI_STATUS_MISCV) && (status & 0xefff) == 0x0e0b) {
+ int seg, bus, dev, fn;
+
+ seg = EXTRACT(misc, 32, 39);
+ bus = EXTRACT(misc, 24, 31);
+ dev = EXTRACT(misc, 19, 23);
+ fn = EXTRACT(misc, 16, 18);
+ mce_snprintf(e->mcastatus_msg, "IO MCA reported by root port %x:%02x:%02x.%x",
+ seg, bus, dev, fn);
+ }
} else if (test_prefix(7, mca)) {
decode_memory_controller(e, mca);
*ismemerr = 1;
--
2.33.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。