From 007d1c9d51b607d9b3e1dd4b969e4e37f843d15d Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 17 Nov 2026 08:44:36 -0500 Subject: vgsp: phys_gr_dump_push_all (per-draw MME body scan); guest video harness - gsp_phys_booter: phys_gr_dump_push_all scans every beef and 0x1000013 push for the MME IR/SA ports (0x114/0x118/0x11c/0x120) with a one-line PUSH-SCAN receipt and full-dumps upload-bearing pushes. c1030/c1035 receipts: 14895-word beef push m114=0/m11c=0; draw push 0x400f9d8 m114=0 m1b00=6 (CALL(0) 0x3800 data=0xd48 present, no macro body). - cycle-r1780: kill QEMU by exact pidfile PID (never pkill -f), refuse a foreign qemu, poll the pidfile after daemonize, virtio-vga display. - params-r1624: enable dump-all + any-channel prelude capture + draw census; fix the stale gsp_phys_gr_dump_push parameter name. - tools/guest-diag: demo-video.sh (Xvfb+XFCE desktop, nvidia-smi, GZDoom segment, honest CUDA battery) and qmp_record.py (QMP screendump). --- tools/guest-diag/cycle-r1780.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'tools/guest-diag/cycle-r1780.sh') diff --git a/tools/guest-diag/cycle-r1780.sh b/tools/guest-diag/cycle-r1780.sh index 24bff12..dabeac3 100755 --- a/tools/guest-diag/cycle-r1780.sh +++ b/tools/guest-diag/cycle-r1780.sh @@ -41,9 +41,25 @@ s.close() PYEOF sleep 2 fi -sudo pkill -f qemu-system-x86_64 2>/dev/null || true -for i in $(seq 1 20); do pgrep -f qemu-system-x86_64 >/dev/null || break; sleep 0.5; done -sudo pkill -9 -f qemu-system-x86_64 2>/dev/null || true +# HARD RULE: kill by exact PID, never by command-line pattern. The only +# QEMU this script owns is the one named in /tmp/qemu-harness.pid; anything +# else is reported and left alone (one QEMU at a time, no collateral kills). +QPIDFILE="/tmp/qemu-harness.pid" +if [ -f "$QPIDFILE" ]; then + QPID=$(sudo cat "$QPIDFILE" 2>/dev/null | tr -dc '0-9') + if [ -n "${QPID:-}" ] && [ -r "/proc/$QPID/comm" ] && \ + [ "$(cat "/proc/$QPID/comm")" = "qemu-system-x86" ]; then + sudo kill -TERM "$QPID" 2>/dev/null || true + for i in $(seq 1 20); do [ -d "/proc/$QPID" ] || break; sleep 0.5; done + if [ -d "/proc/$QPID" ]; then sudo kill -KILL "$QPID" 2>/dev/null || true; fi + fi + rm -f "$QPIDFILE" +fi +for p in /proc/[0-9]*/comm; do + [ "$(cat "$p" 2>/dev/null)" = "qemu-system-x86" ] || continue + echo "FATAL: foreign qemu-system-x86 pid ${p#/proc/} (kill it by exact PID first)" >&2 + exit 1 +done sleep 1 # Always repair the guest root after a forced teardown (cheap when clean, @@ -114,6 +130,7 @@ exec /bin/qemu-system-x86_64 -D $QLOG -no-hpet \ -chardev socket,path=/tmp/qemu-guest-agent.sock,server=on,wait=off,id=qga0 \ -device virtio-serial-pci -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ -serial file:$SL -gdb tcp::1234 -display none \ + -device virtio-vga \ -device ivshmem-plain,id=shmem0,memdev=ivshmem_kvmfr \ -object memory-backend-file,id=ivshmem_kvmfr,mem-path=/dev/shm/kvmfr-$U,size=128M,share=yes \ -device ivshmem-plain,id=shmem1,memdev=ivshmem_kvmsr \ @@ -133,8 +150,12 @@ chmod +x "$QEMU_SCRIPT" echo "[cycle $TAG] launch QEMU (mdev $U)" sudo bash "$QEMU_SCRIPT" > "$RUNDIR/qemu-$TAG.log" 2>&1 -sleep 3 -if ! pgrep -f qemu-system-x86_64 >/dev/null; then +for i in $(seq 1 30); do + [ -r /tmp/qemu-harness.pid ] && break + sleep 0.5 +done +QPID=$(sudo cat /tmp/qemu-harness.pid 2>/dev/null | tr -dc '0-9') +if [ -z "${QPID:-}" ] || [ ! -d "/proc/$QPID" ]; then echo "FATAL: QEMU failed"; tail -5 "$RUNDIR/qemu-$TAG.log"; exit 1 fi -- cgit v1.2.3