summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* docs: add the full-system picture and interaction/scheduling diagramsArthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | - new 03-architecture/09-full-system-picture.md: end-state map, GSP boot, guest init, RPC lifecycle, memory model, work path (bridge and end state), scheduling, isolation levels, KVM/mdev/VFIO, BAR/engine/channel/GMMU, portability, performance model, implementation/test status - new 03-architecture/10-interaction-and-scheduling.md: interaction inventory, control-plane call path, msgq element lifecycle, channel pump, concurrency, timing budgets, multi-tenant scheduling, teardown ordering, versioning - README: mermaid system diagram replaces the ASCII block; reading list extended and renumbered - component docs: GSP boot sequence, mdev/VFIO lifecycle, end-state interaction sequence; STATE-CURRENT links
* sema-svc: auto-register GR counter slots from rank layout + pinned pageArthur Hanson Rasmusson13 days
|
* sema-svc: diagnostics for GR counter release/publish pathsArthur Hanson Rasmusson13 days
|
* sema-svc: learn GR counter PA from pinned release VA (auto-register, publish ↵Arthur Hanson Rasmusson13 days
| | | | puts)
* guest-diag: scan 512KB per 2MB region and start window at 0x200000000 (cover ↵Arthur Hanson Rasmusson13 days
| | | | GR GPFIFO rings)
* sema-svc: sema_skip_ops parameter (apply releases without running pushed ↵Arthur Hanson Rasmusson13 days
| | | | memsets)
* sema-svc: apply releases before push memsets; poller: bypass read cacheArthur Hanson Rasmusson13 days
|
* sema-svc: disable swept-page release writes (guest memory corruption); wake ↵Arthur Hanson Rasmusson13 days
| | | | on doorbell + tight pump loop while entries execute
* docs: record physical-GPU integration mechanism and refresh project statusArthur Hanson Rasmusson13 days
| | | | | | | | | | | - add docs/03-architecture/08-physical-gpu-integration.md: interfaces that exist, mechanism options A-E, chosen path (module-owned GPU driven through its real GSP firmware), sharing policy, decision record - update 06-host-module-and-hybrid-model, 02-practical-challenges, system overview, known-knowns, docs/README reading order and CUDA-side docs to match - correct stale engine-topology/COPY14 blocker claims across the tree - add STATE-CURRENT.md as the dated public status snapshot
* guest-diag: stream uvmt sems over vsock (no guest-agent race); dump channel ↵Arthur Hanson Rasmusson13 days
| | | | last release VA; larger push log budget
* sema-svc: never apply swept-page releases with no live channel (guest boot ↵Arthur Hanson Rasmusson13 days
| | | | corruption); tooling guards
* sema-svc: apply decoded releases to registered counter slots; single-QMP ↵Arthur Hanson Rasmusson13 days
| | | | semfix+uvmt watcher
* guest-diag: live tracking-sem poller (payload VA + raw fields)Arthur Hanson Rasmusson13 days
|
* guest-diag: print tracking-sem state (index, queued, payload) on changeArthur Hanson Rasmusson13 days
| | | | | | | The final cuCtxCreate stall is a UVM tracking semaphore whose completed value stays 0; the pool payload is the ground truth. semfix now prints idx/+0x10/+0x28/payload for every tracking sem it sees, whenever a field changes, so the last stall before a failure is visible in its log.
* guest-diag: sparse allocation-head scan in the pin streamArthur Hanson Rasmusson13 days
| | | | | | | | | The first deltas of a 15k-page window took tens of seconds to arrive while the client was mapping under load, so the pins still landed after the client's cuCtxCreate deadline. The scanner now reads only the first 64 KB of every 2 MB region - the pushes sit at the per-channel allocation heads - which cuts the per-loop page-table work ~50x, and it logs scan timing so the latency stays visible.
* guest-diag: vsock pin stream (guest pagemap -> host sema_map_add)Arthur Hanson Rasmusson13 days
| | | | | | | | | | The guest-agent exec path is too slow under driver-init load (a 15k-page window scan took 17-35 s to complete), so GR window pins landed after the channels' entries had been consumed and after the client's cuCtxCreate timeout. The guest now scans /proc/<pid>/pagemap locally and streams only delta runs over vsock (no agent on the hot path); the host listener pins them as they arrive. The scanner writes a pidfile so restarts do not kill the new instance.
* guest-diag: cheaper trace read, optional push sampler, bigger pagemap batchesArthur Hanson Rasmusson13 days
| | | | | | | | Under load the semfix poll grepped the whole (growing) trace file and the track_waits push block spawned three guest processes per sample, both of which slowed the pin path into the client's failure window. The trace read now tails 128 KB; track_waits.sh gates the push dump behind PUSH=0; the pagemap helper reads 32 KB chunks.
* kernel: grace window for untranslatable GR entries; tools: coalesce window ↵Arthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | | | | pin output The first GR window pin landed ~2 s after the pump consumed the freshly created channels' GPFIFO entries on the first failed read, so the pushes (and the tracking-semaphore releases they carry) were lost. GR entries with an unresolvable push page now stay pending for sema_gr_grace_ms (default 8 s) before the stale-entry consume; a pin landing in that window makes the entry readable and it executes normally. The completion counter is still published from put at the end of every pass, so the client's counter wait is not delayed. guest_pmap_win.py coalesces contiguous VA+PA pages into run lines, so a 15k-page window transfers as ~200 lines instead of ~15k and the pin batch lands within a second of the pages appearing.
* tools: pin GR push-buffer window from guest pagemap per boot; widen ↵Arthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | | | | injected-pin table The GR channel GPFIFO entries point at pushes in the client GPU VA window (observed 0x200400000 + stride, one allocation per channel) and the pump cannot read them: pushes_nomap grows and the tracking-semaphore releases they carry never land. The pushes are sysmem pages mapped into the client process, so /proc/<pid>/pagemap in the guest gives the GPA. New guest helper guest_pmap_win.py batch-reads the pagemap of a VA range (512 entries per pread). New host tool pin_gr_window.py rescans the window on an interval, follows cdt pid changes, and injects VA->PA runs through sema_map_add (same mechanism as the counters and the CE pushbuffer pins). The injected-pin table grows 8k -> 32k slots so the CE pushbuffer (4096) plus the GR window pages fit without drops.
* kernel: batch the map-add channel rewind; trust injected streams for opsArthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | | | | Two fixes for the CE data path. (1) svc_handle_map_add rewound every channel by 8 ring entries on every injected mapping; a 16 MB push-buffer pin is thousands of page injections, so the pump's last_get was pinned in place and it re-read the same entries for the whole batch (3645 submissions, zero ops). The rewind now runs once per drained batch. (2) The push-start heuristic (op=INC_METHOD at address 0) rejects UVM's real CE memop pushes, which start with an IMM method at address 8 (observed 0x60020002, PTE data words) or a release method at 0x700 (0x200381c0); a buffer read through a host-injected (ipin) translation is now decoded fully trusted, ops included. Result on the next boot: memset=2718/0/0 ringops=1794 (first sustained CE work), false 12k->1.9k. semfix_watch: bulk-pin contiguous runs via sema_map_add len, read rm_mem size, 16 MB (4096 page) cap, non-blocking QMP read (the fixed 30 ms sleep made 4096 gva2gpa calls take two minutes), and KEEP_TRACE=1 to preserve the guest trace for post-mortems.
* kernel: decode release pushes read through injected pins instead of rescuing ↵Arthur Hanson Rasmusson13 days
| | | | | | | | | | | | | them Real CE release pushes start with INC_METHOD addr 0x700 (0x200381c0, count 3, subch 4), and svc_method_stream_plausible requires method address 0, so every readable release push was treated as a false pairing, rescued (fails) and skipped - the client's tracking-semaphore release never applied and cuCtxCreate waited forever (slot payload 74 vs queued 75). A buffer read through a host-injected (ipin) translation is now decoded release-only (allow_ops=false) when it fails the push-start heuristic; self-discovered translations keep the strict rescue path.
* kernel: authoritative host-injected VA->PA pins (ipin table) + wider pin tableArthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | The CE push-buffer page 0x120000000 resolved to a zero-filled page even after sema_map_add injected the correct translation: the shared pin table silently dropped inserts once a hash cluster exceeded the 32-probe window (the page hashes to slot 0, a hot cluster), and lookups fell through to the content-scanned map and answered with a stale page - so every CE push read as implausible and memset stayed 0. Injected translations now live in a separate authoritative table checked before every other source and are never written by self-discovery; the general pin table is 4x larger with a 4x probe window and counts drops (pin_drop/ipin_drop) in the stats line. guest_kprobes.sh disables the kprobe group before removal (EBUSY) and matches p:kprobes/<name>; the guest wait sampler can run counters-only with GDB=0.
* guest-diag: deterministic channel->pool->manager->pushbuffer chain + ↵Arthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | | chunk-read diagnostics semfix_watch.py now resolves the CE pushbuffer from guest truth instead of scanning a wide raw window: it walks uvm_channel_t +0=pool, pool+0=manager, manager+8=pushbuffer, pushbuffer+8=rm_mem, rm_mem+0x10=vas[] and prefers the rm_mem whose GPU VA is in the 0x120000000 CE pushbuffer range. Three entry points: uvch probe on __uvm_push_begin_acquire_on_channel_with_info, uvbp probe on uvm_pushbuffer_begin_push, and the uvmt tracking-sem kptr (channel scan back from sem). Misses now print structured hop counters so a failed chunk read is distinguishable from a failed chain. guest_kprobes.sh (re)installs uvmt/uvch/uvbp/uvpbf after every guest boot (plain, module: and bare spellings).
* guest-diag: identify pushbuffer rm_mem by vmalloc CPU VA (any GPU VA)Arthur Hanson Rasmusson13 days
|
* guest-diag: widen pushbuffer chain scan (256KB, slab-prefix filter)Arthur Hanson Rasmusson13 days
|
* guest-diag: read trace before clearing (one-shot pushbuffer-create events)Arthur Hanson Rasmusson13 days
|
* guest-diag: per-page pushbuffer translation, per-client re-pinArthur Hanson Rasmusson13 days
|
* guest-diag: resolve pushbuffer from uvpbf kprobe pointer (deterministic)Arthur Hanson Rasmusson13 days
|
* guest-diag: bound pushbuffer fallback scan (400 candidates / 30s)Arthur Hanson Rasmusson13 days
|
* guest-diag: pushbuffer resolution fallback (direct pushbuffer pointer ↵Arthur Hanson Rasmusson13 days
| | | | candidates)
* guest-diag: semfix also resolves+pins the CE pushbuffer range (descending ↵Arthur Hanson Rasmusson13 days
| | | | GPA layout)
* sema-svc: fake_rel applies releases immediately (skip multi-second CE rescue ↵Arthur Hanson Rasmusson13 days
| | | | scans)
* sema-svc: learn the tracking-sem VA from readable pushes for the release ↵Arthur Hanson Rasmusson13 days
| | | | fallback
* guest-diag: injector handles slow chan_dump (3s wait, last-marker parse)Arthur Hanson Rasmusson13 days
|
* sema-svc: optional CE release fallback for unreadable pushes (sema_fake_rel)Arthur Hanson Rasmusson13 days
|
* guest-diag: semfix watcher (stale sem-pool VA->PA from guest truth); ↵Arthur Hanson Rasmusson13 days
| | | | injector marker-based handle discovery
* sema-svc: async VA->PA injection queue; guest-diag: fast counter+pin ↵Arthur Hanson Rasmusson13 days
| | | | injector, wait sampler
* tools: cuda_cycle.sh - detect channels from dmesg (client timeout is ~30 s)Arthur Hanson Rasmusson13 days
| | | | | | The client times out the context-init counter wait in ~30 s; the previous poll loop spent ~50 s on chan_dump round-trips before injecting. Count the per-channel first-pump log lines straight from dmesg every 0.5 s instead.
* tools: cuda_cycle.sh polls channels every 2 s to shrink publish latencyArthur Hanson Rasmusson13 days
|
* tools: inject_counters.sh - counter index order is descending by handleArthur Hanson Rasmusson13 days
| | | | | | | | Live verification: the trackers waiting on counter slots idx2/idx3 belong to the channels 2nd/3rd from the top of the ascending handle list, and the only channel whose GPFIFO put advanced to 2 was the 4th from the top, whose tracker polled idx3. Zip descending handles with ascending counter indices by default; ORDER=asc restores creation order.
* tools: cuda_cycle.sh - one-command CUDA bring-up attemptArthur Hanson Rasmusson13 days
| | | | | | | 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 scanerr.py, so each iteration is a single command. scanerr now loops over scanner hits until a hit carries a non-zero RM error record.
* tools: scanerr.py - dump the non-zero RM error record behind a forced 999Arthur Hanson Rasmusson13 days
| | | | | | | | The libcuda error scanner (FUN_0054fa00) walks a context list and returns 999 when its force flag is set and any context's RM error record has a non-zero class. ctx999 only shows the first (zeroed) record; scanerr walks the whole list and prints every non-zero record so the failing control or alloc is named. Pushed by push_guest_tools.sh.
* tools: durable guest counter enumeration/injection and VA readerArthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | | | | | | The counter enumeration/injection workflow lived in the guest's /tmp and was lost on every restart. Make it durable under tools/guest-diag: - sem_counters.py: translate a process's per-channel u32 completion counters (16-byte stride in the /dev/nvidiactl counter page) to guest PAs through /proc/<pid>/pagemap; --pairs emits handle,va,pa triples. - sem_slots.py: read/write the counter slots via /proc/<pid>/mem (fallback for the host counter publish). - read_va.py: hex dump a process VA (UVM sysmem GPU VAs are usually valid CPU VAs in the owning process); --u32 for method streams. - inject_counters.sh: host-side one-shot: push the tool, take the GR handles from the live chan_dump, enumerate, then register each counter with sema_counter and pin its VA with sema_map_add. - push_guest_tools.sh: push the new tools after every VM start. - launch_qemu_direct.sh: parameterized mdev UUID/paths instead of a stale hardcoded one; committed so it survives checkouts.
* sema: fix host stack-overflow hang; robust VA resolution; dispatcher lock fixArthur Hanson Rasmusson13 days
| | | | | | | | | | | | | | | | | | | | | | | - svc_handle_chan_dump()/svc_decode_stream(): static snapshot buffers. The 128-channel local array made an ~18 KB frame, which overflows the 16 KB kernel stack in the function prologue and panicked the host 2-3 s after a VM attached the vGPU (proven from EFI pstore: guard page hit at svc_handle_chan_dump+0x20, sub rsp,0x4850). - svc_pump_channels(): write-back now also persists expected_sem_payload, rescue_last and rescue_fail. The pump works on a snapshot copy, so without this the stale-entry skip and the rescue rate limit could never fire and the payload expectation was reinitialized every pass. - svc_targeted_resolve(): sliced scan (128 MB per call, one VA at a time, failed-VA cache) instead of a full-RAM scan per miss; no longer appends to the sorted map out of order. - svc_rebuild(): merges new scan results into the previous map (fresh translation wins in place, new VAs appended) instead of replacing it wholesale, so live translations survive a scan-yield collapse. - Warning fixes: misleading indentation, unused variable, jiffies typecheck. Frame audit: largest frame now 872 B. - Includes the previous session's uncommitted work: sema_counter / shadow_scan / shadow_dump debug params, exit stage markers, pdev ref fix, and the dynamic dispatcher request_firmware-out-of-spinlock fix.
* sema: consume stale GPFIFO entries after repeated rescue failuresArthur Hanson Rasmusson14 days
| | | | | | | | Entries whose push buffer was overwritten (the rescue cannot validate any candidate page) were retried forever, rescanning RAM every 5 s and leaving the ring stuck behind them. After three real rescue failures (rate-limited attempts do not count) the entry is consumed with a 'skipping stale entry' log and the pump moves on. New skip= stat.
* sema: rescue entries anywhere in a pushbuffer slotArthur Hanson Rasmusson2026-09-28
| | | | | | | | Mid-slot entry VAs were rejected by the alignment guard, leaving their false translations permanent. Candidate 2 (the group's page minus the push length) is the PA of the entry VA's page regardless of alignment; pin only the pages the push occupies for mid-slot entries and the whole 1 MB slot for slot-aligned ones. Validation by read-back is unchanged.
* sema: rescue by exact release group at any offset, with validated pin alignmentArthur Hanson Rasmusson2026-09-28
| | | | | | | | | | | | | | Kernel: the slot-aligned failing entries carry pushes whose release group is not at the page's fixed +0x10 offset, so the shape matcher found nothing. Scan every 4-byte offset for the exact group (hdr 0x20038090, hi==1, lo&0xfff==slot, follower LAUNCH_DMA sem-release; payload may lag the tracked expectation) with the header compared first. Each match yields two candidate pin bases - the group's page and the page implied by treating the group as the end of this entry's push - and each candidate is validated by pinning and reading the entry VA back before it is accepted. Live: 13 rescues pinned the MEMOPS slots; the 12700-byte push then decoded to 29 op-runs with a real release, and memset=338 fills (page-table clears) executed ~13 s before the client's rc=999.
* sema: strong rescue signature; rescue on false translations; slot pinArthur Hanson Rasmusson2026-09-28
| | | | | | | | | | | | The content rescue matched only the release group bytes and had matched GSP firmware pages. It now requires the full known push shape around the release (two SET_OBJECT class binds, the 3-word SET_SEMAPHORE_A run with this channel's next payload, and the LAUNCH_DMA semaphore-release follower), and it is also invoked when a trusted read resolves but the buffer does not parse as a push (false content-scanned pair; observed firmware/kernel-data pages), not only when the VA is unmapped. The rescue pins the whole 1 MB push-buffer slot, which is what the UVM MEMOPS channels' pushbuffer pool (0x1200_0000 + n*1MB) needs. New false= stat.
* sema: include the push VA in the per-push summaryArthur Hanson Rasmusson2026-09-28
| | | | | | The long bogus pushes (RISC-V tails) could not be tied back to the ring entry they came from; log the GPFIFO entry VA with each push so the false translations are identifiable and can be compared against probes.
* sema: refuse work from buffers that do not start like a pushArthur Hanson Rasmusson2026-09-28
| | | | | | | | | | The discovered VA->PA map is content-scanned and can hand a ring entry's push VA a false translation; observed: GSP firmware pages read as a 12700-byte method stream whose fills would have been executed into vidmem. Work now requires the buffer to start with a plausible first method (INC_METHOD, address 0, sane count that fits the length); releases still apply from such buffers so a shifted stream is not lost. New 'denied' counter in the sweep stats.