From f874d709e5a45d63c8ee9ab6b0300195aa5d20a5 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Wed, 23 Sep 2026 12:11:04 -0400 Subject: userspace/cuda: add CUDA userspace driver analysis, tooling and name maps Add the analysis of the NVIDIA CUDA userspace driver used by Open-IOV VMs: * docs/01-08: architecture (layers, object model, threads, sync, memory, channels, launch), build and execution model, the driver/kernel/GPU interface contract, virtualization approaches, the 570.144 decompilation map with the corrected libcuda crash path and the current engine-topology blocker, tooling, and a version-upgrade playbook. * tools/: version-agnostic toolchain - stdlib ELF/interface toolkit (exports, unwind-table function map, wrapper resolution, version delta, crash address decode), callgraph walker, corpus annotator, and Ghidra analysis/decompilation/name-map scripts with resumable parallel drivers. * 570.144/annotations/: our name map (exports + resolved wrappers + verified internals) and subsystem index, tracked so naming work accumulates. * READ-ME-FIRST.md: reading guide with the fast lookup recipes. The full decompiled corpus and annotated corpus stay untracked (vendor- derived, gitignored under the version run/ tree). --- userspace/cuda/tools/ghidra_index_merge.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 userspace/cuda/tools/ghidra_index_merge.sh (limited to 'userspace/cuda/tools/ghidra_index_merge.sh') diff --git a/userspace/cuda/tools/ghidra_index_merge.sh b/userspace/cuda/tools/ghidra_index_merge.sh new file mode 100755 index 0000000..44479e9 --- /dev/null +++ b/userspace/cuda/tools/ghidra_index_merge.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# +# ghidra_index_merge.sh - merge the per-chunk decompiled_index.tsv files from +# ghidra_batch_decompile.sh into one sorted index and print coverage stats. +# +# Usage: ghidra_index_merge.sh +set -euo pipefail +OUTDIR="${1:?usage: $0 }" + +head -1 "$OUTDIR"/index/bucket_*.tsv | head -1 > "$OUTDIR/decompiled_index.tsv" +cat "$OUTDIR"/index/bucket_*.tsv | grep -v '^addr' | sort -t$'\t' -k1,1 >> "$OUTDIR/decompiled_index.tsv" + +total=$(grep -c . "$OUTDIR/decompiled_index.tsv" || true) +failed=$(grep -c $'\tfailed$' "$OUTDIR/decompiled_index.tsv" || true) +skipped=$(grep -c 'skipped-huge' "$OUTDIR/decompiled_index.tsv" || true) +echo "[index] rows=$((total-1)) failed=$failed skipped-huge=$skipped" +echo "[index] $OUTDIR/decompiled_index.tsv" -- cgit v1.2.3