summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/semfix_watch.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 13:24:27 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 13:24:27 -0400
commit98031a7a8bc4b33e2ff8a362abcc739bae48779b (patch)
tree15544a5fc81605b1c3ae29673ee3591d1d87398f /tools/guest-diag/semfix_watch.py
parent9f811bcb791f324622b638dcb17283014dba10fa (diff)
downloadopen-iov-98031a7a8bc4b33e2ff8a362abcc739bae48779b.tar.gz
open-iov-98031a7a8bc4b33e2ff8a362abcc739bae48779b.zip
guest-diag: widen pushbuffer chain scan (256KB, slab-prefix filter)
Diffstat (limited to 'tools/guest-diag/semfix_watch.py')
-rw-r--r--tools/guest-diag/semfix_watch.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/guest-diag/semfix_watch.py b/tools/guest-diag/semfix_watch.py
index c4d45fc..ffadb05 100644
--- a/tools/guest-diag/semfix_watch.py
+++ b/tools/guest-diag/semfix_watch.py
@@ -154,14 +154,20 @@ def resolve_pushbuffer(q, sem):
"""Find the pushbuffer rm_mem near the channel and return (gpu_vas, cpu, gpa)."""
base = sem & ~0xFFF
words = []
- for i in range(9):
- chunk = q.read64(base - 0x8000 + i * 0x1000, 512)
+ for i in range(64):
+ chunk = q.read64(base - 0x40000 + i * 0x1000, 512)
if not chunk:
- break
+ continue
words += chunk
- cands = list(dict.fromkeys(w for w in words if is_kern(w)))
+ # The manager/pushbuffer live in the same slab region as the channel.
+ prefix = sem >> 32
+ cands = list(dict.fromkeys(w for w in words
+ if is_kern(w) and (w >> 32) == prefix))
# Chain 1: value is the channel manager; +8 pushbuffer, +8 rm_mem.
- for M in cands:
+ deadline = time.time() + 45
+ for M in cands[:1200]:
+ if time.time() > deadline:
+ break
pb = q.read64(M + 8)
if not pb or not is_kern(pb[0]):
continue