summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/bpz9.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-30 02:05:53 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-30 02:05:53 -0400
commit6fd923c76fe40bbb04d737d695e33a72d3b21889 (patch)
treeb75e0d981d318583a2314d1667bd2981cc94d084 /tools/guest-diag/bpz9.py
parent86915397e51583514f2330a4976e1e0bad6e81c8 (diff)
downloadopen-iov-6fd923c76fe40bbb04d737d695e33a72d3b21889.tar.gz
open-iov-6fd923c76fe40bbb04d737d695e33a72d3b21889.zip
guest-diag: bpz9 - split the failing ucode image create (FUN_003e99d0)
Diffstat (limited to 'tools/guest-diag/bpz9.py')
-rw-r--r--tools/guest-diag/bpz9.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/tools/guest-diag/bpz9.py b/tools/guest-diag/bpz9.py
new file mode 100644
index 0000000..06c5d96
--- /dev/null
+++ b/tools/guest-diag/bpz9.py
@@ -0,0 +1,55 @@
+# gdb script: split the failing ucode image create (FUN_003e99d0).
+#
+# Run #9: FUN_00e21850 -> FUN_003e99d0 returned 1 for the membar-WAR blob.
+# FUN_003e99d0 (file 0x2e99d0) calls FUN_003d1e70 (blob parse) at 0x2e9a1e
+# and on success FUN_003e90c0 at 0x2e9a3a; break after each and stop on the
+# first non-zero status.
+#
+# Run: sudo gdb -p <cdt-pid> -batch -x /tmp/bpz9.py
+import gdb
+import time
+
+out = gdb.execute("info proc mappings", to_string=True)
+base = None
+for line in out.splitlines():
+ if "libcuda" in line and "r-xp" in line:
+ f = line.split()
+ base = int(f[0], 16) - int(f[3], 16)
+ break
+print("BASE=0x%x" % (base or 0))
+if base is None:
+ raise SystemExit
+
+gdb.execute("set pagination off")
+gdb.execute("set confirm off")
+SITES = [
+ (0x2e9a23, "PARSE_RET"),
+ (0x2e9a3f, "CREATE2_RET"),
+]
+for off, name in SITES:
+ gdb.execute("break *0x%x" % (base + off))
+
+t0 = time.time()
+for hit in range(60):
+ try:
+ gdb.execute("continue")
+ except gdb.error as e:
+ print("CONTINUE_END %s" % e)
+ break
+ rip = int(gdb.parse_and_eval("$rip")) & 0xffffffffffffffff
+ off = rip - base
+ name = dict(SITES).get(off, "?")
+ eax = int(gdb.parse_and_eval("$eax")) & 0xffffffff
+ print("HIT t=%.3f off=0x%x %s eax=0x%x" % (time.time() - t0, off, name, eax))
+ if eax != 0:
+ print(" >>> FAILED STEP %s status=0x%x" % (name, eax))
+ try:
+ print(gdb.execute("bt 10", to_string=True))
+ except Exception as e:
+ print("bt_fail %s" % e)
+ break
+
+try:
+ gdb.execute("detach")
+except Exception:
+ pass