diff options
Diffstat (limited to 'STATE.md')
| -rw-r--r-- | STATE.md | 44 |
1 files changed, 33 insertions, 11 deletions
@@ -1,6 +1,6 @@ # Open-IOV Project State -*Last updated: 2026-09-21* +*Last updated: 2026-09-21 (PM)* ## Mission @@ -21,11 +21,14 @@ proprietary GRID licenses — via host-side GSP emulation in | Refactor 5: Guest driver integration (mdev creation, VFIO registration) | ✅ Unblocked, in test | | Refactor 6-11: CUDA / graphics / benchmarks / migration / Windows / hardening | ⏳ Pending | -**Right now**: host stack (nvidia.ko 610.57.04-base + open-iov-vfio.ko) loads -cleanly, mdev device creates and removes cleanly, IOMMU group assignment -works, `/dev/vfio/<n>` appears. Guest VM (Ubuntu 24.04) is installed; guest -NVIDIA driver installation is in progress. Next: guest `nvidia.ko` probe -against the emulated vGPU, then `nvidia-smi`, then CUDA validation. +**Right now**: the **guest-probe hang root cause is found and fixed** (VFIO +mmap garbage PFN → KVM EPT livelock — see below) plus a sweep of correctness +fixes (mdev remove leaks, eventfd wiring, GSP shadow binding, RPC livelock). +Guest driver **570.144 stock runfile installed** in the VM. The fixed module +is built and pushed; it loads after the next host reboot (a leaked +`gsp_emu` kthread from the pre-fix remove path pins the old module — rmmod +would oops). Post-reboot: guest `nvidia.ko` probe → `nvidia-smi` → teardown +regression → unit test → CUDA validation (`docs/DEBUGGING.md` §5 checklist). ## Recently solved bugs @@ -38,24 +41,43 @@ against the emulated vGPU, then `nvidia-smi`, then CUDA validation. | `Unknown symbol nvidia_vgpu_vfio_probe` | NVIDIA OpenRM built without `KBUILD_EXTRA_SYMBOLS` | Build order automated in `stack_manager.sh` (kernel → nvidia → userspace) | | `vfio 1: No such file or directory` | VFIO device registration is NOT automatic for mdev | `vfio_register_emulated_iommu_dev()` in probe, unregister in remove (Intel kvmgt pattern) | | Guest-visible PCI config space wrong | BAR types/offsets, subsystem ID offsets, MSI-X table size | Config space rewritten to match physical TU104 (BAR0 16MB 32-bit non-prefetch, BAR1 256MB 64-bit prefetch VRAM, BAR3 32MB; 32 MSI-X vectors; subsystem IDs at 0x2C/0x2E) | +| **Guest driver probe hard-hangs whole VM (580 & 570.144)** | VFIO `mmap` used `virt_to_phys()` on `vzalloc`'d BAR0 shadow + ioremap'd BAR2/3 → garbage PFN → KVM `make_spte` reserved-bit WARN → EPT-violation livelock (diagnosed via QEMU GDB stub: one vCPU frozen on a single MMIO instruction) | BAR0 mapped per-page via `vmalloc_to_pfn()`; BAR2/3/4/5 map `bars[N].gpa` directly; `nv_vgpu_mmap_virt_to_pfn()` helper | +| **GSP emulation thread never saw guest RPCs** | Engine polled the *host physical* BAR0 doorbell + a local `dma_alloc_wc` buffer; guest writes land in the vzalloc `bar0_shadow` | `gsp_emu_init` binds exclusively to `bar0_shadow` (doorbell/mailbox/PBA aliases); also stopped PBA writes corrupting the host GPU's physical BAR0+0x3000 | +| **Guest never received MSI-X completions** | `SET_IRQS DATA_EVENTFD` handler discarded eventfds (`TODO` + `kfree`); `msix_trigger[]` all NULL; inject used an init-time (stale) copy | Full eventfd wiring: `eventfd_ctx_fdget` per vector, `-1` clears, close releases refs; inject looks up `vgpu->irqs[0].trigger` live | +| **BAR_TRAP/MIGRATE RPC livelock** | dispatch → `gsp_rpc_submit_raw` rings the same doorbell the thread polls → self-triggered infinite loop + 2–30 s stalls | emulation-mode guards return `-ENOTSUPP` with `pr_warn_ratelimited` | +| **mdev remove leaked everything** | remove never `list_del`'d (available_instances stuck), never ran cleanup (leaked `gsp_emu` kthread), never unregistered VFIO (leaked `/dev/vfio/N` + iommu group), never put pdev/freed struct | kvmgt-style remove: wait fds → `vfio_unregister_group_dev` → cleanup work → `list_del` → `pci_dev_put` → `vfio_put_device` | +| `dma_map_page` IOVA corruption | 64-bit `dma_addr_t` stored in `int ret` (truncates ≥4 GB IOVAs under IOMMU) | dedicated `dma_addr_t iova` in `gsp_rpc_alloc_emul` | +| config-space write returned `-1` (`SIZE_MAX`) | `while(count--)` wrap + bogus return expression; function was dead code while the live path did unfiltered byte copies | return fixed; VFIO write handler now routes through the per-register filter (guest can't rewrite vendor ID/BARs) | +| Misleading `MODULE_SOFTDEP("pre: nvidia")` | module has zero nvidia imports (it *exports* `nvidia_vgpu_vfio_*`) | removed; load order is open-iov-vfio **before** nvidia.ko | +| Kernel unit tests didn't build | written against a removed struct-based RPC API | rewritten to drive `gsp_emu_process_rpc()` with crafted mailbox messages; `depends: open-iov-vfio` | ## Known open bugs / limitations -- Guest `nvidia.ko` end-to-end probe not yet validated (in progress) -- Kernel test modules (`kernel/tests/`) need API updates to match final - driver headers (low priority) +- Guest `nvidia.ko` end-to-end probe not yet validated (fixed module loads + post-reboot; checklist in `docs/DEBUGGING.md` §5) +- **Memory-model gap**: guest VRAM (BAR1) maps directly to physical BAR1 gpa, + but `gsp_rpc_alloc_emul` services ALLOC with host system pages — the two + are not unified; must be resolved before CUDA/DMA-heavy workloads + (`docs/GSP_EMULATION_ARCHITECTURE.md` §3) +- BAR_TRAP / MIGRATE RPCs fail fast with `-ENOTSUPP` in emulation mode + (guest's normal BAR access is direct MMIO; real handlers TODO) +- `gsp_emu_process_rpc()` doesn't bump stats counters (only the kthread + path does) — cosmetic - WPR callback registration lacks kernel eventfd support - (`TODO` in driver/wpr) + (`TODO` in driver/wpr — legacy guest-driver tree) - Migration WPR state save/restore incomplete - BAR `force_access` path not fully wired (unused-function warning) - Kernel `SCHEDULE` emulation returns success without real work submission (userspace emulation works) - Async `NOTIFY` events not emulated in kernel (no eventfd/poll yet) -- `open-iov-vfio.ko` requires `nvidia.ko` loaded first (`MODULE_SOFTDEP`) - Single GPU validated so far: TU104 (RTX 2080 SUPER Mobile), GSP 570.144, kernel 6.8.0-139-generic - Live migration protocol implemented (4-phase) but not yet validated - Windows guest not yet validated (automation scaffolding present) +- MSI-X emulation has dual stores (guest-visible `bar0_shadow` table vs + `bar_emul_ctx.msix_table[]` used by the currently-unused trap path) — + documented in `docs/GSP_EMULATION_ARCHITECTURE.md`; harmless with the + direct-mmap design ## Reproducibility notes |
