From 064e7ea00f41f463a6c8d6c66a06e01c449eac22 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Mon, 16 Nov 2026 02:05:30 -0400 Subject: [PATCH] diag: unmap_fault_order pins the padded kernel stamp again (#2625 dropped the arm) #2622 fixed BOOT_RE for the kernel's padded `[ 321.308031]` stamp and pinned it with an arm. #2625 rewrote the self-test block and dropped that arm, so on main the pre-#2622 regex (`^\s*\[(\d+\.\d+)\]`, every real fault line untimed, nothing correlates) passes every arm: 0 FAIL. Arm 8 restores it at both levels: - two- and four-space padded stamps parse (321.308031, 0.0); - a padded fault correlates with an unmap of the same iova 31 us earlier, as BEFORE, at the current 30 s default window. With the pre-#2622 regex, both checks fail and --self-test exits 1. (Review of #2625, whose CHANGES was still open when it merged.) Co-Authored-By: Claude Opus 5.5 --- tools/diag/unmap_fault_order.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/diag/unmap_fault_order.py b/tools/diag/unmap_fault_order.py index 3ad4f007a..eff6e0a0b 100755 --- a/tools/diag/unmap_fault_order.py +++ b/tools/diag/unmap_fault_order.py @@ -190,6 +190,20 @@ def chk(cond, msg): "a negative names the window it used and the measured interval, not 'nothing correlated' bare") chk("+-5000 us" in " ".join(render(correlate(unm, [(100.500, 0x4128000, "f3")], 5000), unm, 5000)), "a sub-second window still reads in microseconds") + # 8. the REAL kernel stamp is PADDED: `[ 321.308031]` (two spaces; one at >= 1000 s, four in early dmesg). Written + # without the inner `\s*`, BOOT_RE matched only the unpadded shape the doc example uses, so every real line parsed + # as untimed and nothing could correlate (#2622). #2625 rewrote the arms above and dropped this one, and with it + # the pre-#2622 regex passed every arm again -- so it is pinned here, at both the parse and the correlation. + padded = ["[ 321.308031] strixhalo kernel: nvme 0000:c4:00.0: AMD-Vi: Event logged " + "[IO_PAGE_FAULT domain=0x0015 address=0x4128000 flags=0x0000]", + "[ 0.000000] strixhalo kernel: nvme 0000:c4:00.0: AMD-Vi: Event logged " + "[IO_PAGE_FAULT domain=0x0015 address=0x4129000 flags=0x0000]"] + pf = parse_faults(padded, lambda _s: None) + chk([f[0] for f in pf] == [321.308031, 0.0], "padded boot stamps parse (two- and four-space padding)") + near = parse_trace([" bash-1 [002] .... 321.308000: unm: (iommu_unmap_fast+0x4/0x10) iova=0x4128000 size=0x1000"]) + hit = correlate(near, pf[:1], 30_000_000) + chk(hit and hit[0][3] is not None and hit[0][3][1] < 0, + "a padded fault correlates with an unmap 31 us earlier (BEFORE), not an uncorrelated negative") return 0 if ok else 1