From b38797b110301d6a097897247a37f8d0ab81842c Mon Sep 17 00:00:00 2001 From: Ruidong Tian Date: Tue, 17 Dec 2024 14:39:42 +0800 Subject: [PATCH] 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 --- mce-intel.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mce-intel.c b/mce-intel.c index e67254f..69b99e8 100644 --- a/mce-intel.c +++ b/mce-intel.c @@ -221,6 +221,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, @@ -265,6 +267,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;