summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag
diff options
context:
space:
mode:
Diffstat (limited to 'tools/guest-diag')
-rw-r--r--tools/guest-diag/bp999.py2
-rw-r--r--tools/guest-diag/bp999v2.py2
-rw-r--r--tools/guest-diag/bpwait.py2
-rw-r--r--tools/guest-diag/bpz.py2
-rw-r--r--tools/guest-diag/bpz10.py2
-rw-r--r--tools/guest-diag/bpz11.py2
-rw-r--r--tools/guest-diag/bpz12.py2
-rw-r--r--tools/guest-diag/bpz13.py2
-rw-r--r--tools/guest-diag/bpz14.py2
-rw-r--r--tools/guest-diag/bpz16.py2
-rw-r--r--tools/guest-diag/bpz18.py2
-rw-r--r--tools/guest-diag/bpz19.py2
-rw-r--r--tools/guest-diag/bpz2.py2
-rw-r--r--tools/guest-diag/bpz20.py2
-rw-r--r--tools/guest-diag/bpz21.py2
-rw-r--r--tools/guest-diag/bpz3.py2
-rw-r--r--tools/guest-diag/bpz4.py2
-rw-r--r--tools/guest-diag/bpz5.py2
-rw-r--r--tools/guest-diag/bpz6.py2
-rw-r--r--tools/guest-diag/bpz7.py2
-rw-r--r--tools/guest-diag/bpz8.py2
-rw-r--r--tools/guest-diag/bpz9.py2
-rwxr-xr-xtools/guest-diag/bridge_sems.sh2
-rw-r--r--tools/guest-diag/ctx999.py2
-rwxr-xr-xtools/guest-diag/cuda_cycle.sh2
-rwxr-xr-xtools/guest-diag/cycle_cdt.sh2
-rwxr-xr-xtools/guest-diag/dbg_seq.sh2
-rwxr-xr-xtools/guest-diag/dbg_seq2.sh2
-rw-r--r--tools/guest-diag/dumpctx.py2
-rw-r--r--tools/guest-diag/gdb_now.sh2
-rw-r--r--tools/guest-diag/guest_engines.c2
-rw-r--r--tools/guest-diag/guest_kprobes.sh2
-rw-r--r--tools/guest-diag/guest_pin_stream.py2
-rw-r--r--tools/guest-diag/guest_pmap.py2
-rw-r--r--tools/guest-diag/guest_pmap_all.py2
-rw-r--r--tools/guest-diag/guest_pmap_win.py2
-rwxr-xr-xtools/guest-diag/inject_counters.sh2
-rwxr-xr-xtools/guest-diag/inject_maps.sh2
-rwxr-xr-xtools/guest-diag/inject_tracker.sh2
-rw-r--r--tools/guest-diag/invd.py2
-rw-r--r--tools/guest-diag/ioctl_trace.c2
-rwxr-xr-xtools/guest-diag/kret.sh2
-rw-r--r--tools/guest-diag/kretprobes.sh2
-rwxr-xr-xtools/guest-diag/launch_qemu_rootport.sh2
-rw-r--r--tools/guest-diag/memprobe.py2
-rw-r--r--tools/guest-diag/nmi_catch.sh2
-rw-r--r--tools/guest-diag/oneshot_gdb.sh2
-rwxr-xr-xtools/guest-diag/pdwatch_cycle.sh2
-rw-r--r--tools/guest-diag/peek.c2
-rwxr-xr-xtools/guest-diag/phys_claim_cycle.sh2
-rwxr-xr-xtools/guest-diag/pin_client_sems.sh2
-rw-r--r--tools/guest-diag/pin_gr_stream.py2
-rw-r--r--tools/guest-diag/pin_gr_window.py2
-rwxr-xr-xtools/guest-diag/pin_miss_pages.sh2
-rwxr-xr-xtools/guest-diag/pin_sem_fast.sh2
-rwxr-xr-xtools/guest-diag/pmap_va.sh2
-rw-r--r--tools/guest-diag/ptrace_ioctl.c2
-rwxr-xr-xtools/guest-diag/push_guest_tools.sh2
-rwxr-xr-xtools/guest-diag/read_va.py2
-rw-r--r--tools/guest-diag/rmq_probe.c2
-rwxr-xr-xtools/guest-diag/run_cycle.sh2
-rwxr-xr-xtools/guest-diag/run_traced.sh2
-rw-r--r--tools/guest-diag/scan.c2
-rw-r--r--tools/guest-diag/scan2.c2
-rw-r--r--tools/guest-diag/scan3.c2
-rwxr-xr-xtools/guest-diag/scanerr.py2
-rwxr-xr-xtools/guest-diag/sem_counters.py2
-rwxr-xr-xtools/guest-diag/sem_slots.py2
-rwxr-xr-xtools/guest-diag/semfix_uvmt.py2
-rw-r--r--tools/guest-diag/semfix_watch.py2
-rwxr-xr-xtools/guest-diag/sempages.py2
-rwxr-xr-xtools/guest-diag/stack_sampler.sh2
-rw-r--r--tools/guest-diag/state_log.sh2
-rw-r--r--tools/guest-diag/sysc_shim.c2
-rw-r--r--tools/guest-diag/track_waits.sh2
-rw-r--r--tools/guest-diag/trkinfo.py2
-rwxr-xr-xtools/guest-diag/uvm_rmmem_probe.sh2
-rw-r--r--tools/guest-diag/uvmprobe.sh2
-rw-r--r--tools/guest-diag/uvmt_poll.py2
-rw-r--r--tools/guest-diag/uvmwait.sh2
-rwxr-xr-xtools/guest-diag/vmcycle.sh2
-rwxr-xr-xtools/guest-diag/vmrestart.sh2
-rw-r--r--tools/guest-diag/watch_ctx.sh2
83 files changed, 166 insertions, 0 deletions
diff --git a/tools/guest-diag/bp999.py b/tools/guest-diag/bp999.py
index ff7a23f..2729aac 100644
--- a/tools/guest-diag/bp999.py
+++ b/tools/guest-diag/bp999.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: break on the libcuda instructions that produce CUDA errors
# 719 (0x2cf) and 999 (0x3e7), then print the stack that led there and the
# error record the scanner reads (FUN_0054fa00 walks ctx[0x1291] -> +0x10 ->
diff --git a/tools/guest-diag/bp999v2.py b/tools/guest-diag/bp999v2.py
index 766bc3b..3bd9cd9 100644
--- a/tools/guest-diag/bp999v2.py
+++ b/tools/guest-diag/bp999v2.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: break at the 999/719 RETURN sites of the libcuda scanner
# FUN_0054fa00 and dump the record values the scanner actually read (they are
# still in its stack locals, so the host clearing the notification afterwards
diff --git a/tools/guest-diag/bpwait.py b/tools/guest-diag/bpwait.py
index 9b708c8..d44fd32 100644
--- a/tools/guest-diag/bpwait.py
+++ b/tools/guest-diag/bpwait.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: catch the tracker-gate exit with a NONZERO dispatcher status and
# dump the wait-entry array the gate polls. This names the wait that ends the
# client's context-init spin (the value that becomes the CUDA error).
diff --git a/tools/guest-diag/bpz.py b/tools/guest-diag/bpz.py
index 53d46a6..b61579a 100644
--- a/tools/guest-diag/bpz.py
+++ b/tools/guest-diag/bpz.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: name the silent-rollback 999 site in the cuCtxCreate path.
#
# Sites (file vaddr of libcuda.so.570.144; runtime = base + off):
diff --git a/tools/guest-diag/bpz10.py b/tools/guest-diag/bpz10.py
index 30aa1da..7766103 100644
--- a/tools/guest-diag/bpz10.py
+++ b/tools/guest-diag/bpz10.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: name the first failing call inside FUN_003e90c0 (ucode-image
# create, second half) after FUN_003d1e70 (blob parse) succeeded.
#
diff --git a/tools/guest-diag/bpz11.py b/tools/guest-diag/bpz11.py
index 601a73d..2fb5c02 100644
--- a/tools/guest-diag/bpz11.py
+++ b/tools/guest-diag/bpz11.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: split FUN_00391ee0 (ucode-image registration, file 0x291ee0).
#
# PART 76 + bpz10 run: FUN_003e90c0's failing call is FUN_00391ee0, which
diff --git a/tools/guest-diag/bpz12.py b/tools/guest-diag/bpz12.py
index 3a5767c..d4b4d8e 100644
--- a/tools/guest-diag/bpz12.py
+++ b/tools/guest-diag/bpz12.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: split FUN_00386b90 (ucode image section callback, file
# 0x286b90) - bpz11 showed FUN_00386020 returned 1 from this callback.
#
diff --git a/tools/guest-diag/bpz13.py b/tools/guest-diag/bpz13.py
index 6f2aa8f..3096f30 100644
--- a/tools/guest-diag/bpz13.py
+++ b/tools/guest-diag/bpz13.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: dump FUN_003e35f0 args at the call from FUN_00e0e970 (file
# 0xd0e970 -> call site 0xd0eb65, caller return 0xd0eb6a).
#
diff --git a/tools/guest-diag/bpz14.py b/tools/guest-diag/bpz14.py
index 24302c9..b960676 100644
--- a/tools/guest-diag/bpz14.py
+++ b/tools/guest-diag/bpz14.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: dump the device-object TPC/SM count fields in the guest at the
# FUN_003e3e80 call from FUN_00e0e970 (caller return 0xd0eae1).
#
diff --git a/tools/guest-diag/bpz16.py b/tools/guest-diag/bpz16.py
index c67175d..48b4a53 100644
--- a/tools/guest-diag/bpz16.py
+++ b/tools/guest-diag/bpz16.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: probe the guest's chip-info vtable call (ds->[0x4d38]) and the
# 0xc48/0xc4c fields at the FUN_003e3e80 call from FUN_00e0e970.
#
diff --git a/tools/guest-diag/bpz18.py b/tools/guest-diag/bpz18.py
index ed82084..7e955cd 100644
--- a/tools/guest-diag/bpz18.py
+++ b/tools/guest-diag/bpz18.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: trace the path through FUN_0042aec0 (GPU arch/config init) in
# the guest, launched as `gdb --args /tmp/cdt` so early device-init code is
# caught.
diff --git a/tools/guest-diag/bpz19.py b/tools/guest-diag/bpz19.py
index 9dfed68..82a9bd3 100644
--- a/tools/guest-diag/bpz19.py
+++ b/tools/guest-diag/bpz19.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: trace the path through FUN_0042aec0 (GPU arch/config init) by
# attaching to a running cdt at the CDT_PAUSE (bpz18 variant).
#
diff --git a/tools/guest-diag/bpz2.py b/tools/guest-diag/bpz2.py
index 2d399ff..1058de5 100644
--- a/tools/guest-diag/bpz2.py
+++ b/tools/guest-diag/bpz2.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: capture the post-pump failure call in FUN_00374240 (ctx init).
#
# From the previous run: the engine event pump FUN_0031a3b0 returned 0
diff --git a/tools/guest-diag/bpz20.py b/tools/guest-diag/bpz20.py
index cf8ee8c..d90bc20 100644
--- a/tools/guest-diag/bpz20.py
+++ b/tools/guest-diag/bpz20.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: catch the write that ZEROES ds+0xe94 after the CASE1 body set
# it to 0x18. Run via run_cycle.sh gdb-launch (device init happens during
# cuInit, before the CDT_PAUSE).
diff --git a/tools/guest-diag/bpz21.py b/tools/guest-diag/bpz21.py
index f9809a7..f56b066 100644
--- a/tools/guest-diag/bpz21.py
+++ b/tools/guest-diag/bpz21.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: dump param_2[] at FUN_00337e60 entry when called from
# FUN_00550ff0 (file 0x450ff0). bpz20 showed FUN_00550ff0 -> FUN_00337e60
# overwrites ds+0xe94 with param_2[0x23]; on the host that is 0x18 (24 TPC).
diff --git a/tools/guest-diag/bpz3.py b/tools/guest-diag/bpz3.py
index ae90f86..4528622 100644
--- a/tools/guest-diag/bpz3.py
+++ b/tools/guest-diag/bpz3.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: find the exact site that sets r14d=999 in FUN_00374240.
#
# Run #2 showed every post-pump call site up to 0x2755bf returning 0, then
diff --git a/tools/guest-diag/bpz4.py b/tools/guest-diag/bpz4.py
index eca9618..69cb2b0 100644
--- a/tools/guest-diag/bpz4.py
+++ b/tools/guest-diag/bpz4.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: identify the vtable slot that returns 999 in ctx bring-up.
#
# Run #3 found the failing store at file 0x275cec: the indirect call at
diff --git a/tools/guest-diag/bpz5.py b/tools/guest-diag/bpz5.py
index 568b2f2..d47968e 100644
--- a/tools/guest-diag/bpz5.py
+++ b/tools/guest-diag/bpz5.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: identify WHICH engine-setup hook returns 999.
#
# Run #4 named the target: file 0x4d1fa0 (the +0x4580 table slot) — an engine
diff --git a/tools/guest-diag/bpz6.py b/tools/guest-diag/bpz6.py
index 7742da2..c515878 100644
--- a/tools/guest-diag/bpz6.py
+++ b/tools/guest-diag/bpz6.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: at the membar-WAR hook failure, read the device arch/impl and
# test the FUN_0035a4d0(0x13, arch, rev) descriptor lookup in-process.
#
diff --git a/tools/guest-diag/bpz7.py b/tools/guest-diag/bpz7.py
index 2294298..02f29ed 100644
--- a/tools/guest-diag/bpz7.py
+++ b/tools/guest-diag/bpz7.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: split the membar-WAR hook failure into lookup vs ucode-load.
#
# The remap table at file 0x3dc5b80 maps (chip=7,rev=5)->(7,0) (real Turing
diff --git a/tools/guest-diag/bpz8.py b/tools/guest-diag/bpz8.py
index e0567e5..c44b028 100644
--- a/tools/guest-diag/bpz8.py
+++ b/tools/guest-diag/bpz8.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: localize the ucode-image load failure inside FUN_00e21850.
#
# Run #7: in the membar-WAR hook the descriptor lookup FUN_0035a4d0(0x13,7,5)
diff --git a/tools/guest-diag/bpz9.py b/tools/guest-diag/bpz9.py
index 06c5d96..bbed25f 100644
--- a/tools/guest-diag/bpz9.py
+++ b/tools/guest-diag/bpz9.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: split the failing ucode image create (FUN_003e99d0).
#
# Run #9: FUN_00e21850 -> FUN_003e99d0 returned 1 for the membar-WAR blob.
diff --git a/tools/guest-diag/bridge_sems.sh b/tools/guest-diag/bridge_sems.sh
index a024524..fee71ca 100755
--- a/tools/guest-diag/bridge_sems.sh
+++ b/tools/guest-diag/bridge_sems.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# bridge_sems.sh - bridge the guest's own page table view into the host service.
#
# The emulation cannot (yet) translate the CUDA client's sysmem semaphores
diff --git a/tools/guest-diag/ctx999.py b/tools/guest-diag/ctx999.py
index e5472c8..b99e455 100644
--- a/tools/guest-diag/ctx999.py
+++ b/tools/guest-diag/ctx999.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: catch where a hanging/failing cuCtxCreate goes.
#
# Arms the libcuda 999-scanner sites (FUN_0054fa00 entry/999/0x2cf returns)
diff --git a/tools/guest-diag/cuda_cycle.sh b/tools/guest-diag/cuda_cycle.sh
index cc333fb..fed6e98 100755
--- a/tools/guest-diag/cuda_cycle.sh
+++ b/tools/guest-diag/cuda_cycle.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# cuda_cycle.sh - one full CUDA bring-up attempt: restart the VM, push the
# guest tools, start cdt holding on failure, wait for the 20 GR channels,
# register/pin the completion counters, and arm the RM-error scanner so the
diff --git a/tools/guest-diag/cycle_cdt.sh b/tools/guest-diag/cycle_cdt.sh
index 3aaa723..9fc5b69 100755
--- a/tools/guest-diag/cycle_cdt.sh
+++ b/tools/guest-diag/cycle_cdt.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# cycle_cdt.sh - full test cycle: push tools, start cdt, inject the libcuda
# tracker page mapping when the tracker wait is reached, poke UVM's tracker
# when it stalls, and report where cdt ends up.
diff --git a/tools/guest-diag/dbg_seq.sh b/tools/guest-diag/dbg_seq.sh
index 247bc91..e222d3c 100755
--- a/tools/guest-diag/dbg_seq.sh
+++ b/tools/guest-diag/dbg_seq.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
/tmp/ptio /tmp/cdt > /dev/null 2>/tmp/tr.log
n=$(grep -n 'req=0x25' /tmp/tr.log | head -1 | cut -d: -f1)
echo "marker line: $n"
diff --git a/tools/guest-diag/dbg_seq2.sh b/tools/guest-diag/dbg_seq2.sh
index 8710fd9..28290eb 100755
--- a/tools/guest-diag/dbg_seq2.sh
+++ b/tools/guest-diag/dbg_seq2.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
/tmp/ptio /tmp/cdt > /dev/null 2>/tmp/tr.log
n=$(grep -n 'req=0x25' /tmp/tr.log | head -1 | cut -d: -f1)
echo "=== controls AFTER register (line $n), first 40: ==="
diff --git a/tools/guest-diag/dumpctx.py b/tools/guest-diag/dumpctx.py
index 983997e..4f433a3 100644
--- a/tools/guest-diag/dumpctx.py
+++ b/tools/guest-diag/dumpctx.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script (run with: sudo gdb -p <pid> -batch -x /tmp/dumpctx.py)
# Dumps the libcuda client wait-loop context: the ctx object's queue/entry
# array (ctx+0x10 = count, ctx+0x18 = array of 0x28-byte entries) plus each
diff --git a/tools/guest-diag/gdb_now.sh b/tools/guest-diag/gdb_now.sh
index b58fe3d..4aa394e 100644
--- a/tools/guest-diag/gdb_now.sh
+++ b/tools/guest-diag/gdb_now.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb_now.sh <pid> - attach gdb once immediately (root), dump all threads,
# detach, CONT. Used when the host has seen the final RM control, so the
# attach is timed to the post-control window instead of state sampling.
diff --git a/tools/guest-diag/guest_engines.c b/tools/guest-diag/guest_engines.c
index 10209e2..e04de76 100644
--- a/tools/guest-diag/guest_engines.c
+++ b/tools/guest-diag/guest_engines.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* guest_engines.c - query the guest client RM for the data UVM's register
* path depends on: virtualization mode, subdevice count, ENGINE LIST,
* CLASS LIST, CE caps and CE->PCE masks. Uses the NVOS64 serialized alloc
diff --git a/tools/guest-diag/guest_kprobes.sh b/tools/guest-diag/guest_kprobes.sh
index d3db7b3..58c539a 100644
--- a/tools/guest-diag/guest_kprobes.sh
+++ b/tools/guest-diag/guest_kprobes.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# guest_kprobes.sh - (re)install the UVM trace probes used by semfix_watch.py.
# Runs in the guest as root; kprobes do not survive a guest boot, so this must
# run after every VM restart.
diff --git a/tools/guest-diag/guest_pin_stream.py b/tools/guest-diag/guest_pin_stream.py
index 581dc9d..6c22e62 100644
--- a/tools/guest-diag/guest_pin_stream.py
+++ b/tools/guest-diag/guest_pin_stream.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# guest_pin_stream.py - stream the CUDA client's push-buffer VA->PA pairs to
# the host over vsock, continuously and without the guest agent on the hot
# path. Runs in the guest as root (pagemap reads).
diff --git a/tools/guest-diag/guest_pmap.py b/tools/guest-diag/guest_pmap.py
index 96b7ddc..e2622c4 100644
--- a/tools/guest-diag/guest_pmap.py
+++ b/tools/guest-diag/guest_pmap.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# guest-side helper: translate GPU/user VAs of a process through its pagemap.
# Usage: sudo python3 guest_pmap.py <pid> <hex-va> [hex-va ...]
import os
diff --git a/tools/guest-diag/guest_pmap_all.py b/tools/guest-diag/guest_pmap_all.py
index 1a4df34..a1766c1 100644
--- a/tools/guest-diag/guest_pmap_all.py
+++ b/tools/guest-diag/guest_pmap_all.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# guest-side helper: dump present pages of the target's /dev/nvidia* mappings
# as "va,pa" lines (root in the guest), starting at or above va-min and
# stopping after max-pairs lines so the guest agent's output stays small.
diff --git a/tools/guest-diag/guest_pmap_win.py b/tools/guest-diag/guest_pmap_win.py
index 501e7bc..8732859 100644
--- a/tools/guest-diag/guest_pmap_win.py
+++ b/tools/guest-diag/guest_pmap_win.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# guest_pmap_win.py - dump present pages of a process's VA range through the
# guest's own pagemap (root in the guest). Batched reads (512 entries per
# pread) so a 256 MB window takes about a second, not minutes.
diff --git a/tools/guest-diag/inject_counters.sh b/tools/guest-diag/inject_counters.sh
index 5ee60fd..5bec72a 100755
--- a/tools/guest-diag/inject_counters.sh
+++ b/tools/guest-diag/inject_counters.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# inject_counters.sh - register the running CUDA client's per-channel GPU
# completion counters with the host sema service (the PART 45/46 manual
# procedure, made durable). The host then tracks each GR channel's consumed
diff --git a/tools/guest-diag/inject_maps.sh b/tools/guest-diag/inject_maps.sh
index 6dcabb5..3f018db 100755
--- a/tools/guest-diag/inject_maps.sh
+++ b/tools/guest-diag/inject_maps.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# inject_maps.sh - while cdt runs, collect pushbuffer/ring VAs from the host
# dmesg (sema-chan entry logs) plus channel GPFIFO ring VAs, translate them
# through the guest's own pagemap, and inject the VA->PA pairs into the
diff --git a/tools/guest-diag/inject_tracker.sh b/tools/guest-diag/inject_tracker.sh
index 0a292e4..5438a6d 100755
--- a/tools/guest-diag/inject_tracker.sh
+++ b/tools/guest-diag/inject_tracker.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# inject_tracker.sh - find the libcuda tracker slot the stuck cdt is polling,
# translate its page through the guest pagemap, pin the mapping in the service.
set -u
diff --git a/tools/guest-diag/invd.py b/tools/guest-diag/invd.py
index 313daa3..5838947 100644
--- a/tools/guest-diag/invd.py
+++ b/tools/guest-diag/invd.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: read the device arch/impl and test the membar-WAR descriptor
# lookup (FUN_0035a4d0) live on the parked cdt.
#
diff --git a/tools/guest-diag/ioctl_trace.c b/tools/guest-diag/ioctl_trace.c
index 661636f..4835b10 100644
--- a/tools/guest-diag/ioctl_trace.c
+++ b/tools/guest-diag/ioctl_trace.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* ioctl_trace.c - log the NVIDIA driver ioctls of a child process.
*
* libcuda issues raw syscall instructions, so LD_PRELOAD/ltrace never see
diff --git a/tools/guest-diag/kret.sh b/tools/guest-diag/kret.sh
index 9ed1220..ba374f8 100755
--- a/tools/guest-diag/kret.sh
+++ b/tools/guest-diag/kret.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# kret.sh - kretprobe the nvGpuOps* call chain in the guest's nvidia.ko and
# capture return values while /tmp/cdt runs. Run with sudo.
set -u
diff --git a/tools/guest-diag/kretprobes.sh b/tools/guest-diag/kretprobes.sh
index a5357db..4945c51 100644
--- a/tools/guest-diag/kretprobes.sh
+++ b/tools/guest-diag/kretprobes.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# kretprobes.sh - return-value probes for the UVM API entry points, so the
# failing UVM operation names itself in the trace tail.
TR=/sys/kernel/tracing
diff --git a/tools/guest-diag/launch_qemu_rootport.sh b/tools/guest-diag/launch_qemu_rootport.sh
index 1ddcb92..d7ef097 100755
--- a/tools/guest-diag/launch_qemu_rootport.sh
+++ b/tools/guest-diag/launch_qemu_rootport.sh
@@ -1,2 +1,4 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
exec /bin/qemu-system-x86_64 -D /home/rmcore/.local/libvf.io/logs/qemu/e726ba0b-204f-4ec9-91da-983ed7f41d06-session.txt -no-hpet -mem-prealloc -qmp unix:/tmp/qemu-qmp.sock,server,nowait -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:/tmp/vgpu-guest-serial.log -gdb tcp::1234 -display none -device ivshmem-plain,id=shmem0,memdev=ivshmem_kvmfr -object memory-backend-file,id=ivshmem_kvmfr,mem-path=/dev/shm/kvmfr-e726ba0b-204f-4ec9-91da-983ed7f41d06,size=128M,share=yes -device ivshmem-plain,id=shmem1,memdev=ivshmem_kvmsr -object memory-backend-file,id=ivshmem_kvmsr,mem-path=/dev/shm/kvmsr-e726ba0b-204f-4ec9-91da-983ed7f41d06,size=2M,share=yes -object memory-backend-file,id=pc.ram,size=4096M,mem-path=/dev/shm/vgpu-guest-ram,share=yes,prealloc=on -uuid e726ba0b-204f-4ec9-91da-983ed7f41d06 -machine pc-q35-4.2,accel=kvm,usb=off,vmport=off,dump-guest-core=off,memory-backend=pc.ram -cpu host,ss=on,vmx=on,pcid=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaveopt=on,pdpe1gb=on,ibpb=on,amd-stibp=on,amd-ssbd=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,hv-vapic,hv_time,hv-spinlocks=0x1fff,hv-vendor-id=null,kvm=on,topoext=on -rtc clock=host,base=localtime -m 4096 -smp cores=4,threads=1,sockets=1 -hda /home/rmcore/.local/libvf.io/kernel/linux.qcow2 --enable-kvm -device pcie-root-port,id=rp0,chassis=1,slot=30,bus=pcie.0 -device vfio-pci,id=hostdev0,bus=rp0,sysfsdev=/sys/bus/mdev/devices/<MDEV-UUID>,display=off -device rtl8139,netdev=net0 -netdev user,id=net0 -net user,hostfwd=tcp::2222-:22 -net nic -device vhost-vsock-pci,guest-cid=50718 -qmp unix:/tmp/sockets/e726ba0b-204f-4ec9-91da-983ed7f41d06/main.sock,server,nowait -qmp unix:/tmp/sockets/e726ba0b-204f-4ec9-91da-983ed7f41d06/master.sock,server,nowait
diff --git a/tools/guest-diag/memprobe.py b/tools/guest-diag/memprobe.py
index c2bab9f..f246476 100644
--- a/tools/guest-diag/memprobe.py
+++ b/tools/guest-diag/memprobe.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# memprobe.py - read/write another process's memory through /proc/<pid>/mem
# (root only, no gdb/ptrace attach needed).
#
diff --git a/tools/guest-diag/nmi_catch.sh b/tools/guest-diag/nmi_catch.sh
index 3afa895..af46a23 100644
--- a/tools/guest-diag/nmi_catch.sh
+++ b/tools/guest-diag/nmi_catch.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# nmi_catch.sh [rounds] [sleep] - trigger sysrq-l NMI backtraces and append a
# compact summary of the nvidia frames seen in each round (guest side, root).
#
diff --git a/tools/guest-diag/oneshot_gdb.sh b/tools/guest-diag/oneshot_gdb.sh
index 9161ee4..c272acc 100644
--- a/tools/guest-diag/oneshot_gdb.sh
+++ b/tools/guest-diag/oneshot_gdb.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# oneshot_gdb.sh <pid> - catch the client's USERSPACE spin (state R and
# /proc/<pid>/syscall == "running"; a kernel busy-wait shows its syscall
# number). Fires gdb ONCE, dumps all threads, detaches, CONTs.
diff --git a/tools/guest-diag/pdwatch_cycle.sh b/tools/guest-diag/pdwatch_cycle.sh
index fe758fd..d1cbe41 100755
--- a/tools/guest-diag/pdwatch_cycle.sh
+++ b/tools/guest-diag/pdwatch_cycle.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# pdwatch_cycle.sh - TASK 2: watch every write landing in the root PD pages
# 0x200000..0x204000 (and the 0x208000 table) through a full cdt2 run, with
# the walk state sampled during the CP park and after completion.
diff --git a/tools/guest-diag/peek.c b/tools/guest-diag/peek.c
index 857afd0..7c959ec 100644
--- a/tools/guest-diag/peek.c
+++ b/tools/guest-diag/peek.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* peek.c - print RIP/RBX/RSP/RDI of every thread of a process (root).
usage: peek PID [lo_off hi_off] (offsets from the libcuda r-xp base)
Flags threads whose RIP is inside [base+lo, base+hi) with SPIN. */
diff --git a/tools/guest-diag/phys_claim_cycle.sh b/tools/guest-diag/phys_claim_cycle.sh
index e89fbfc..6ce7cff 100755
--- a/tools/guest-diag/phys_claim_cycle.sh
+++ b/tools/guest-diag/phys_claim_cycle.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# phys_claim_cycle.sh - supervised physical-GPU claim/release cycle harness.
#
# Drives one or more full "D0 pre-lock" cycles of the physical-ownership
diff --git a/tools/guest-diag/pin_client_sems.sh b/tools/guest-diag/pin_client_sems.sh
index af39fd1..9d5cdac 100755
--- a/tools/guest-diag/pin_client_sems.sh
+++ b/tools/guest-diag/pin_client_sems.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# pin_client_sems.sh - bridge the CUDA client's device mappings into the
# emulation for the live cdt process.
#
diff --git a/tools/guest-diag/pin_gr_stream.py b/tools/guest-diag/pin_gr_stream.py
index 7f8e4b8..aba3912 100644
--- a/tools/guest-diag/pin_gr_stream.py
+++ b/tools/guest-diag/pin_gr_stream.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# pin_gr_stream.py - pin the CUDA client's GR push-buffer pages from a vsock
# stream produced by guest_pin_stream.py (guest truth via /proc/<pid>/pagemap).
#
diff --git a/tools/guest-diag/pin_gr_window.py b/tools/guest-diag/pin_gr_window.py
index 71f73d0..194ac9d 100644
--- a/tools/guest-diag/pin_gr_window.py
+++ b/tools/guest-diag/pin_gr_window.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# pin_gr_window.py - pin the CUDA client's GR push-buffer pages from guest
# truth, per boot (host-side dev tool, no guest changes beyond the helper).
#
diff --git a/tools/guest-diag/pin_miss_pages.sh b/tools/guest-diag/pin_miss_pages.sh
index fd7722a..34786ac 100755
--- a/tools/guest-diag/pin_miss_pages.sh
+++ b/tools/guest-diag/pin_miss_pages.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# pin_miss_pages.sh - adaptive tracker-sem pinner.
#
# Watches the host journal for "release miss va=0x..." lines, resolves those
diff --git a/tools/guest-diag/pin_sem_fast.sh b/tools/guest-diag/pin_sem_fast.sh
index 16cecc4..c4493f3 100755
--- a/tools/guest-diag/pin_sem_fast.sh
+++ b/tools/guest-diag/pin_sem_fast.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# pin_sem_fast.sh - low-latency tracker-sem pinner (2 s poll vs 15 s).
#
# Pins the client tracker-sem page (0x20400f000, covers 0x20400fec0..ff70)
diff --git a/tools/guest-diag/pmap_va.sh b/tools/guest-diag/pmap_va.sh
index e5bcef4..dbe91df 100755
--- a/tools/guest-diag/pmap_va.sh
+++ b/tools/guest-diag/pmap_va.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# 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).
diff --git a/tools/guest-diag/ptrace_ioctl.c b/tools/guest-diag/ptrace_ioctl.c
index 5f96b31..1762d4c 100644
--- a/tools/guest-diag/ptrace_ioctl.c
+++ b/tools/guest-diag/ptrace_ioctl.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* ptrace_ioctl.c - follow a child with PTRACE_SYSCALL and dump the buffer
* results of selected UVM ioctls. Needed because libcuda issues raw syscall
* instructions (LD_PRELOAD/ltrace never see these).
diff --git a/tools/guest-diag/push_guest_tools.sh b/tools/guest-diag/push_guest_tools.sh
index 9a45fd3..f19f30d 100755
--- a/tools/guest-diag/push_guest_tools.sh
+++ b/tools/guest-diag/push_guest_tools.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# push_guest_tools.sh - (re)build the guest-side diagnostic binaries from the
# sources kept in this directory. The guest's /tmp is wiped on boot, so run
# this after every VM start; the sources here are the persistent copies.
diff --git a/tools/guest-diag/read_va.py b/tools/guest-diag/read_va.py
index fca3994..ef65672 100755
--- a/tools/guest-diag/read_va.py
+++ b/tools/guest-diag/read_va.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# read_va.py - dump a guest process's memory at a VA (GPU VAs of UVM sysmem
# objects are usually also valid CPU VAs in the owning process).
#
diff --git a/tools/guest-diag/rmq_probe.c b/tools/guest-diag/rmq_probe.c
index 7554309..8acf1c3 100644
--- a/tools/guest-diag/rmq_probe.c
+++ b/tools/guest-diag/rmq_probe.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* rmq_probe.c - minimal legacy-ioctl RM client to read device controls:
* 0x800289 NV0080_CTRL_CMD_GPU_GET_VIRTUALIZATION_MODE
* 0x800280 NV0080_CTRL_CMD_GPU_GET_NUM_SUBDEVICES
diff --git a/tools/guest-diag/run_cycle.sh b/tools/guest-diag/run_cycle.sh
index 28ea18d..53ebf52 100755
--- a/tools/guest-diag/run_cycle.sh
+++ b/tools/guest-diag/run_cycle.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# run_cycle.sh - one instrumented CUDA bring-up cycle with full capture.
#
# Recipe (PART 70 + PART 71): restart VM/module, push tools, install kprobes
diff --git a/tools/guest-diag/run_traced.sh b/tools/guest-diag/run_traced.sh
index 009e20b..cb7228c 100755
--- a/tools/guest-diag/run_traced.sh
+++ b/tools/guest-diag/run_traced.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# run_traced.sh - run cdt under the ioctl tracer, keep the libcuda tracker page
# mapped (pagemap + sema_map_add) and poke UVM's tracking semaphore forward as
# the sweep completes pushes, so the run reaches the rc=999 rollback where the
diff --git a/tools/guest-diag/scan.c b/tools/guest-diag/scan.c
index d229dc8..1608ba0 100644
--- a/tools/guest-diag/scan.c
+++ b/tools/guest-diag/scan.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* scan.c - find the libcuda tracker objects in a process without ptrace.
Tracker layout (object p): p+0x9418 submitted, p+0x9420 completed,
p+0x9428 mirror, p+0x9430 sem object; sem object +0x10 -> sem VA (a
diff --git a/tools/guest-diag/scan2.c b/tools/guest-diag/scan2.c
index 6220038..dfc1ae7 100644
--- a/tools/guest-diag/scan2.c
+++ b/tools/guest-diag/scan2.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* scan2.c - find qwords whose value points into a /dev/nvidia* mapping of
the target process, and report the u32 stored there (semaphore hunt).
usage: scan2 PID [max_print] */
diff --git a/tools/guest-diag/scan3.c b/tools/guest-diag/scan3.c
index 94f6a42..2683e89 100644
--- a/tools/guest-diag/scan3.c
+++ b/tools/guest-diag/scan3.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* scan3.c - scan all writable memory of a process for qwords equal to any
of the given 64-bit needles; print every hit address.
usage: scan3 PID 0xNEEDLE [0xNEEDLE ...] */
diff --git a/tools/guest-diag/scanerr.py b/tools/guest-diag/scanerr.py
index 96c4170..cca649b 100755
--- a/tools/guest-diag/scanerr.py
+++ b/tools/guest-diag/scanerr.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script: at the libcuda error-scanner entry (FUN_0054fa00), walk the
# context list and dump every non-zero RM error record (magic words,
# errorClass at +0x8, shorts at +0xc/+0xe). The scanner is called often with
diff --git a/tools/guest-diag/sem_counters.py b/tools/guest-diag/sem_counters.py
index 66af258..94a01f4 100755
--- a/tools/guest-diag/sem_counters.py
+++ b/tools/guest-diag/sem_counters.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# sem_counters.py - enumerate a guest process's per-channel GPU completion
# counters (the u32 slots the client polls to observe push completion).
#
diff --git a/tools/guest-diag/sem_slots.py b/tools/guest-diag/sem_slots.py
index 70d184c..f405771 100755
--- a/tools/guest-diag/sem_slots.py
+++ b/tools/guest-diag/sem_slots.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# sem_slots.py - read or write the per-channel u32 completion counters of a
# guest process (verification and fallback for the host's counter publish).
#
diff --git a/tools/guest-diag/semfix_uvmt.py b/tools/guest-diag/semfix_uvmt.py
index ba4f4f7..cf54445 100755
--- a/tools/guest-diag/semfix_uvmt.py
+++ b/tools/guest-diag/semfix_uvmt.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# semfix_uvmt.py - single-QMP tracking-semaphore/resolution watcher.
#
# One QMP client does everything semfix_watch.py and uvmt_poll.py did, because
diff --git a/tools/guest-diag/semfix_watch.py b/tools/guest-diag/semfix_watch.py
index 0a2a6fb..049a612 100644
--- a/tools/guest-diag/semfix_watch.py
+++ b/tools/guest-diag/semfix_watch.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# semfix_watch.py - keep UVM VA->PA translations fresh from guest truth
# (host-side dev tool, no guest changes).
#
diff --git a/tools/guest-diag/sempages.py b/tools/guest-diag/sempages.py
index f8d15b2..f74edb1 100755
--- a/tools/guest-diag/sempages.py
+++ b/tools/guest-diag/sempages.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# Print the distinct pages of the semaphore VAs a process references
# (reuses memprobe.py's scanner; run in the guest as root). The VA window is
# derived from the process's /dev/nvidia* mappings unless lo/hi are given.
diff --git a/tools/guest-diag/stack_sampler.sh b/tools/guest-diag/stack_sampler.sh
index f210422..af6f57d 100755
--- a/tools/guest-diag/stack_sampler.sh
+++ b/tools/guest-diag/stack_sampler.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# stack_sampler.sh - per-thread kernel stack sampler for the CUDA client.
#
# The client's failing wait is not always visible in strace: libcuda runs
diff --git a/tools/guest-diag/state_log.sh b/tools/guest-diag/state_log.sh
index de3d6ed..aa5f0f6 100644
--- a/tools/guest-diag/state_log.sh
+++ b/tools/guest-diag/state_log.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# state_log.sh <pid> - 200ms sampler of state/syscall/wchan for the whole run.
PID="$1"
: > /tmp/state.log
diff --git a/tools/guest-diag/sysc_shim.c b/tools/guest-diag/sysc_shim.c
index 9b07e4c..e2ab6f0 100644
--- a/tools/guest-diag/sysc_shim.c
+++ b/tools/guest-diag/sysc_shim.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2026 Open-IOV contributors */
/* sysc_shim.c - intercept syscall() so we can dump ioctl buffer *results*
* for UVM ioctls (libcuda calls syscall(SYS_ioctl, ...) directly, so an
* ioctl() wrapper is bypassed but syscall() is not).
diff --git a/tools/guest-diag/track_waits.sh b/tools/guest-diag/track_waits.sh
index 54c4905..50d67c1 100644
--- a/tools/guest-diag/track_waits.sh
+++ b/tools/guest-diag/track_waits.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# track_waits.sh - guest-side wait sampler: while a CUDA client (cdt) runs,
# repeatedly dump the per-channel completion counters (values), the tracker
# wait entries (trkinfo.py, every 2nd pass) and the push pages the host could
diff --git a/tools/guest-diag/trkinfo.py b/tools/guest-diag/trkinfo.py
index 0d6d629..0b4498f 100644
--- a/tools/guest-diag/trkinfo.py
+++ b/tools/guest-diag/trkinfo.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# gdb script (run with: sudo gdb -p <pid> -batch -x /tmp/trkinfo.py)
# Drills into the libcuda tracker wait: dumps every wait entry, the tracker
# objects they reference (channel/context layout at p+0x9410 with the sem
diff --git a/tools/guest-diag/uvm_rmmem_probe.sh b/tools/guest-diag/uvm_rmmem_probe.sh
index 15ad73f..9778689 100755
--- a/tools/guest-diag/uvm_rmmem_probe.sh
+++ b/tools/guest-diag/uvm_rmmem_probe.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# uvm_rmmem_probe.sh - guest-side kprobe that dumps every UVM rm_mem mapping
# as it is used: {type, CPU VA, GPU0 VA, GPU1 VA, size} for each call to
# uvm_rm_mem_get_cpu_va. This is the ground truth for VA -> physical
diff --git a/tools/guest-diag/uvmprobe.sh b/tools/guest-diag/uvmprobe.sh
index de7293c..fd26c63 100644
--- a/tools/guest-diag/uvmprobe.sh
+++ b/tools/guest-diag/uvmprobe.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# uvmprobe.sh - guest-side: probe UVM's external-range/map API return statuses
# while cdt runs, and capture UVM's own debug-print output.
nvidia-modprobe -c 0
diff --git a/tools/guest-diag/uvmt_poll.py b/tools/guest-diag/uvmt_poll.py
index d145e6c..668435a 100644
--- a/tools/guest-diag/uvmt_poll.py
+++ b/tools/guest-diag/uvmt_poll.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# uvmt_poll.py - poll the live state of the tracking semaphores the CUDA
# client spins on, from the guest trace kptrs, via QMP (no guest agent
# besides the trace read). Prints the payload word the client actually
diff --git a/tools/guest-diag/uvmwait.sh b/tools/guest-diag/uvmwait.sh
index 06b2dc7..cb1fe69 100644
--- a/tools/guest-diag/uvmwait.sh
+++ b/tools/guest-diag/uvmwait.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# uvmwait.sh - guest-side: run cdt with UVM debug prints on, and snapshot the
# UVM tracker-wait messages early (before any teardown floods dmesg).
nvidia-modprobe -c 0
diff --git a/tools/guest-diag/vmcycle.sh b/tools/guest-diag/vmcycle.sh
index d3dcbec..8177300 100755
--- a/tools/guest-diag/vmcycle.sh
+++ b/tools/guest-diag/vmcycle.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# vmcycle.sh - reload cycle for the emulated vGPU stack:
# stop QEMU -> remove mdevs -> rmmod/insmod vgsp.ko -> create a
# fresh mdev -> patch its UUID into the runtime launch script -> relaunch.
diff --git a/tools/guest-diag/vmrestart.sh b/tools/guest-diag/vmrestart.sh
index f94521c..62402ba 100755
--- a/tools/guest-diag/vmrestart.sh
+++ b/tools/guest-diag/vmrestart.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# vmrestart.sh - stop QEMU, reload vgsp.ko from the tree, fresh mdev,
# relaunch the vGPU VM. Everything bounded so a stuck step cannot hang the
# caller.
diff --git a/tools/guest-diag/watch_ctx.sh b/tools/guest-diag/watch_ctx.sh
index 0968571..0af95ca 100644
--- a/tools/guest-diag/watch_ctx.sh
+++ b/tools/guest-diag/watch_ctx.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
# watch_ctx.sh - guest-side watcher: (re)start cdt, snapshot the ioctl stream
# (fd paths), attach gdb to the libcuda wait as soon as cuCtxCreate is reached
# and POKE the per-entry trackers (p+0x9410+0x10/0x18 = 1) to test whether that