summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/pmap_va.sh
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-24 01:58:15 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-24 01:58:15 -0400
commit3b9432714a0515b89309ff2e6c1983690fb67761 (patch)
tree6ee1d2c33c6f0868e1f5316c2f2c9d6347a01f7f /tools/guest-diag/pmap_va.sh
parentdb34d52120055c927aad160b2c73c390485333ea (diff)
downloadopen-iov-3b9432714a0515b89309ff2e6c1983690fb67761.tar.gz
open-iov-3b9432714a0515b89309ff2e6c1983690fb67761.zip
kernel: validate learned semaphore maps and post guest GPU events
- admit {GPU VA -> PA} pairs only when the preceding bytes form a valid client memory descriptor header (type 0/1, CPU+GPU mapped bits), prefer validated pairs over headerless candidates under first-wins dedup, and invalidate the translation cache on every rebuild; fixes stale identity entries shadowing live pool pages and lets the guest UVM channel bring-up complete on its own - capture OS event allocations (class 0x79) and post event records (function 0x1003) into the guest status queue when a channel's busy notification is consumed, with a broadcast fallback, serialized with replies via a queue lock - add BAR0 shadow introspection (dump_bar0/scan_bar0) and guest-side diagnostic scripts for the VM cycle
Diffstat (limited to 'tools/guest-diag/pmap_va.sh')
-rwxr-xr-xtools/guest-diag/pmap_va.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/guest-diag/pmap_va.sh b/tools/guest-diag/pmap_va.sh
new file mode 100755
index 0000000..e5bcef4
--- /dev/null
+++ b/tools/guest-diag/pmap_va.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# pmap_va.sh <pid|name> <hex-va> [hex-va ...]
+# Push guest_pmap.py to the running VM and translate the VAs of the named
+# process through the guest's own pagemap (root in the guest).
+set -u
+cd "$(dirname "$0")/../.."
+
+TARGET="$1"; shift
+VAS="$*"
+
+B64=$(base64 -w0 tools/guest-diag/guest_pmap.py)
+timeout 30 ./scripts/vgpu_vm.py exec --timeout 25 \
+ "echo '$B64' | base64 -d > /tmp/pmap.py" >/dev/null 2>&1
+
+if ! [[ "$TARGET" =~ ^[0-9]+$ ]]; then
+ PID=$(timeout 20 ./scripts/vgpu_vm.py exec --timeout 15 "pgrep -x $TARGET | head -1" 2>/dev/null | tail -1)
+ [ -n "$PID" ] && TARGET="$PID"
+fi
+[ -n "$TARGET" ] || { echo "no pid found"; exit 1; }
+
+timeout 60 ./scripts/vgpu_vm.py exec --timeout 55 "sudo python3 /tmp/pmap.py $TARGET $VAS" 2>/dev/null | grep -E '^VA='