Cluster 2 (RMAPI/UVM/Locking/Memory P0s):
- Convert runtime_start_users to atomic_t so wait_event() in
nv_rs_rmapi_node_gpu_remove never calls mutex_lock while !TASK_RUNNING.
- Guard all 6 unlocked nv_rs_alloc_reg_find() call sites in rmapi_node.c with
nv_rs_rmapi_alloc_lock.
- Run nv_rs_rmapi_rc_recover_fault while nv_rs_rmapi_lock is held from
nv_rs_rmapi_node_trylock() in nv_rs_uvm_fault_work_fn (no blocking re-lock).
- Filter MANAGED_RANGES and PAGE_TREES by UvmFile owner in uvm_node.rs to
prevent cross-process managed_unmap UAF; use flush_gpu_tlb_trylock() +
TLB_FLUSH_PENDING deferral so .mmap/vm_ops->close never touch LIVE_ENGINES
without nv_rs_rmapi_lock.
- Pin FD-exported memory backings in memory::Table::export_pins and check via
shared backing_shares_resource() so export -> free original -> import never
UAFs; release orphaned backings on FD owner close.
- Fix Backing::System map_protection(flags), deduplicate video_allocated_bytes,
and unmap Backing::Register in drop_mappings.
Cluster 4 (Kernel Build Hygiene & Linux 5.15-7.3 Compat P0s):
- Factor shared kernel-open/compat_probes.mk for Kbuild + build_guest_test.sh
(fixing Linux 5.15 char *date probe and Linux 7.0+ guest_build).
- Extend tools/prepare_kernel_archive.py to strip all kernel-exported
compiler_builtins mem/string members (strlen/memcpy/memmove/memset/memcmp/bcmp)
and wire it into tools/vm/build_guest_test.sh.
- Fix tools/check_kernel_module.py no_unhardened_sls_return to check per-ret
int3 succession instead of file-wide has_int3.
- Set AR=llvm-ar / NM=llvm-nm under LLVM=1 in utils.mk, LC_ALL=C and non-rustup
fallback in verify_rust_guest.py/check_native_codegen.py, and 1024 MiB guest RAM.
Validated: cargo fmt/clippy/test (958+2), test_gate_cases.py (24/24),
test_kernel_archive.py (5/5), NV_RS_KERNEL_IBT=0 & 1 make modules +
check_kernel_module.py (largest_stack=1000), QEMU EDU verify_rust_guest.py.
nv_rs_uvm_ioctl() and nv_rs_uvm_release() took nv_rs_uvm_lock and then
nv_rs_rmapi_lock. Two other orders already exist:
rmapi -> mmap_lock nv_rs_rmapi_os_lock_user_pages() calls
pin_user_pages_fast() with the RM API lock held
(NV01_MEMORY_SYSTEM_OS_DESCRIPTOR, cudaHostRegister)
mmap_lock -> uvm the kernel calls nv_rs_uvm_mmap() and
nv_rs_uvm_vma_close() with mmap_lock held
so uvm -> rmapi closes a cycle. lockdep reports it as soon as a CUDA
process pins host memory while another thread mmaps the UVM node, and a
multi-threaded process can really deadlock on it:
WARNING: possible circular locking dependency detected
cuda_dmabuf_exp/4377 is trying to acquire lock:
(&mm->mmap_lock){++++}-{4:4}, at: gup_fast_fallback+0x51f/0x2bc0
but task is already holding lock:
(nv_rs_rmapi_lock){+.+.}-{4:4}, at: nv_rs_rmapi_ioctl+0x64c/0x2f50
Chain exists of:
&mm->mmap_lock --> nv_rs_uvm_lock --> nv_rs_rmapi_lock
Take the RM API lock first in both places. Nothing under the RM API lock
takes the UVM lock (only the UVM file operations and module init/exit
do), so the order is now rmapi -> mmap_lock -> uvm everywhere. The fault
worker only trylocks, so it could not deadlock, but it now tries the two
locks in the same order as well.
The other way out would be to pin the pages before taking the RM API
lock in the OS-descriptor path; this keeps the change local to the UVM
node.
Observed on an RTX 3050 Laptop (GA107) under a lockdep kernel
(7.4.0-rc2) running a CUDA dma-buf test.
- Zero-friction first-run UX (#133): default runtime_engines=1 and pci_target=*
in nvidia_rs.ko (with explicit bringup=N precedence via resolve_bringup_mode);
install.sh auto-extracts pre-GSP firmware packs + GSP blobs, installs
/etc/modprobe.d/nvdriver.conf (install nvidia /bin/false, char-major-195-*
alias), /etc/modules-load.d/nvdriver.conf, and /etc/udev/rules.d/70-nvdriver.rules,
and enables BIND_DEV_NODES=1 by default.
- Maxwell & Pascal real firmware loading (GM10x-GP108): extend
tools/extract_gv100_firmware.py (--family gm20x|gp100|gp10x|all) using
REA-verified 580.178.04 ACR/PMU bundles (_nv016827rm/_nv016828rm/_nv016888rm)
with a shared pack_container() builder; wire LoadedPack::request_legacy and
HS Falcon IMEM/DMEM upload + execution into boot_maxwell_pascal_pre_gsp.
- Unified Hopper/Blackwell split-RM routing: add GspFirmwareChipFamily::boot_mode()
(FwsecBooter vs Fmc) as a single source of truth; integrate GH100/GB10x/GB20x
FMC BootROM handshake into Ga10xGsp::boot/unload via PciRegIo so every GSP-RM
GPU from Turing through Blackwell runs on the unified gsp_route.rs split-RM.
- Issue #142 Phases 3-4: add FileMappingLedger and GpuSlotLedger (+ unit tests)
to src/nvidia/src/rmapi/alloc_registry.rs + rmapi_memory.rs FFI, removing
struct nv_rs_rmapi_mapping and redundant bar0/bar1/numa_status fields from
kernel-open/nvidia/rmapi_node.c.
Validated: cargo fmt/clippy/test (957+2), NV_RS_KERNEL_IBT=0 & 1 make modules +
check_kernel_module.py (largest_stack=1000), test_gate_cases.py (18/18),
extract_gv100_firmware.py --check, and QEMU EDU verify_rust_guest.py (non-IOMMU
and --iommu, maxframe=984).
Wave 1 (c553930f) moved list_del_init(&alloc->link) into
nv_rs_rmapi_alloc_put() and updated nv_rs_rmapi_os_free_pages() to set
alloc->freed = true instead of unlinking early.
Two remaining callers still ran bare list_del(&alloc->link) right before
nv_rs_rmapi_alloc_put(alloc):
- nv_rs_rmapi_os_unlock_user_pages(): poisons alloc->link before
nv_rs_rmapi_alloc_put() checks !list_empty(&alloc->link) and calls
list_del_init(&alloc->link), causing a GPF on LIST_POISON2
(0xdead000000000122) during Server::free (reproduced live with
llama-server on a V100-PCIE-32GB under Linux 7.0). Mark
alloc->freed = true to match nv_rs_rmapi_os_free_pages().
- nv_rs_rmapi_node_exit(): same poison hazard when draining leaked
allocations on module exit. Use list_del_init(&alloc->link) so
nv_rs_rmapi_alloc_put() sees list_empty(&alloc->link) == true.
Refs #117
When the RM API node's lock stayed busy past an IRQ thread's tries (about 200 ms in one go), the event slots stayed
pending until the next interrupt of one of the GPU's engines; on an idle GPU the waiter then woke only on libcuda's
own 100 ms re-check. The tries are bounded on purpose (on a V100 the same thread runs nvdriver's stall service, and
teardown waits for it), so the thread now hands over instead: it schedules a delayed work item (rmapi_node.c) that
takes the lock with a trylock, posts every slot still pending on a GA10x GPU or a V100 whose events are on
(nv_rs_gpu_events_retry), and tries again every 5 ms while the node stays busy. It never blocks on the lock, so a
teardown holding it cannot wait on the work; GA10x GPUs are found through the slot table under the lock (a GPU is
freed only under it), V100 entries are static. Node exit cancels the work after the GPUs are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
74ce0e5 raised the device's DMA mask with dma_set_mask_and_coherent and recorded the new width as the lease width.
With the probe's 32-bit lease still held, every later 32-bit lease (nv_rs_pci_dma_acquire) then failed with EBUSY, and
a DMA context opened at 32 bits could get coherent memory above 4 GiB, which its own range check refuses.
The swiotlb bounce that 74ce0e5 fixes is in the streaming path only (dma_map_page of client pages). So
nv_rs_pci_widen_dma now raises just the streaming mask (dma_set_mask, never lowered) and leaves the coherent mask and
dma_bits alone: existing and new 32-bit leases keep working, coherent allocations stay where their context expects them.
On a GA10x GPU the boot's own buffers come from a 32-bit context then (the 47-bit request is refused while the probe's
lease holds; the existing fallback takes 32 bits). The host fixture covers it (mock gets a separate streaming mask).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The C port (ga102_gsp.c, ga102_rm.c, ga102_glue.c) is replaced by Rust under src/nvidia/ with a thin MIT C adapter:
- src/nvidia/src/gpu/ga10x_gsp.rs (core, no unsafe): VBIOS / FWSEC / Booter parsing with every offset
bounds-checked, signature choice from the fuse version, FWSEC DMEM patch (FRTS, SB), FB and WPR2 layout, radix3,
LibOS arguments, queue headers, element framing and checksum, system info, registry, static info. Unit tests use
the 3090's numbers.
- src/nvidia/src/gpu/gsp_ucode.rs: GA10x bootloader and Booter Load/Unload from NVIDIA's MIT bindata at 580.178.04
(licenses/gsp-rm-boot-ga102-mit.txt).
- src/nvidia/kernel/ga10x_gsp.rs: the live boot (FWSEC-FRTS, Booter Load, RISC-V bootloader, LibOS, CPU sequencer,
INIT_DONE), the RPC transport on GSP-RM's shared-memory queues, and the unload (UNLOADING_GUEST_DRIVER,
FWSEC-SB, Booter Unload; falcons reset before any DMA memory is freed).
- src/nvidia/kernel/ga10x.rs: per-GPU state and RM RPCs. The slot table publishes a GPU with a release store only
after every field is written (FREE -> BOOTING -> ACTIVE -> ENDING); readers acquire; a second boot of the same
GPU backs off. This replaces install_external_session and its publication race.
- src/nvidia/kernel/ga10x_mem.rs, ga10x_objects.rs: the kernel side of split RM (heap split, BAR1 1:1, VA spaces,
TSG, ctxshare, channel, golden context, work submit token, time correlation).
- src/nvidia/kernel/ga10x_events.rs: RM events through irq_adapter (GA10x MSI; GV100 chained around
LIVE_IRQ_OPS), posted from the IRQ thread.
- src/nvidia/kernel/gsp_route.rs: routing of the client's RM calls, with NVIDIA's control flags enforced (INTERNAL
refused, PRIVILEGED needs admin, kernel-only refused, parameter size, owner).
- kernel-open/nvidia/ga10x_adapter.c: log lines, sleep, PCI info and config, BAR0 fill, CPU clocks, credentials,
three module parameters: ga10x_gsp (default 1; 0 leaves GA10x to gsp_bringup's own path), ga10x_events,
gsp_route_trace.
rmapi/gpu.rs: the usermode window (0xc561) is allowed on GA10x too; c9c4706 allowed the class but not the window.
Tested on an RTX 3090 + V100: CUDA on both, P2P both ways, NCCL all_reduce over P2P, blocking sync through RM
events, NVIDIA's 580 back after every unload, 0 Xid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nv_rs_rmapi_gpu_negotiate_dma asked nv_rs_pci_negotiate_dma for a new mask, which refuses any change while a DMA
lease exists, and every GPU keeps its probe's 32-bit lease for its lifetime: the mask stayed at 32 bits. With the
strict IOMMU DMA path (#16) each client system-memory page is mapped with dma_map_page, so on a host with memory
above 4 GiB every such page goes through swiotlb. The GPU's semaphore writes land in the bounce buffer, the CPU
never sees them and libcuda spins at context creation (seen on a V100 with plain master on an 8 GB host: 26,624
swiotlb slabs in use during the hang).
nv_rs_pci_widen_dma raises the mask under the same lock and never lowers it, so every address handed out under the
old mask stays valid. nv_rs_rmapi_gpu_negotiate_dma uses it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fixes#47: dispatch wait_for_rm_init_done_with_abi, execute_gsp_boot_with_abi,
boot_gsp_rm, and GspRpcSession::rpc_call through the active session
GspAbiVersion (matching REA _nv041450rm dispatching via pRpc->rpcRecvPoll),
with end-to-end R620 MCTP/NVDM boot unit test.
- Fixes#52: guard <linux/unaligned.h> vs <asm/unaligned.h> on 6.12+ in
tests/vm/edu_adapter_test.c so validate_all.sh guest_build passes on 6.12+/7.x.
- Fixes#49: clarify in MODULE_PARM_DESC and README.md that driver_version
(default 580.178.04 for userspace NVML/libcuda matching) is independent of
gsp_abi (GSP-RM wire protocol framing).
The module parameter selects the GSP-RM wire framing, but the setter treated
every value other than 580 as 620, so a typo such as gsp_abi=0 or gsp_abi=62073
silently switched protocols with nothing in dmesg to explain it.
Parse the parameter strictly in GspAbiVersion::from_module_param, leave the
active ABI untouched on an unknown value, and warn once from module init.
Fixes#48.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
- Add root LICENSE (MIT License, Copyright (c) 2026 QuixiAI / Eric Hartford).
- Set license = "MIT" in workspace Cargo.toml and member crates (zero non-MIT dependencies).
- Update all kernel-open/ and tests/vm/ SPDX headers to MIT and EXPORT_SYMBOL_GPL -> EXPORT_SYMBOL.
- Use MODULE_LICENSE("Dual MIT/GPL") in Linux .ko modules so Linux modpost permits linking against the kernel's own EXPORT_SYMBOL_GPL symbols while keeping the repository source 100% MIT.
Closes#12.
Cherry-picked and adapted from PR #9 onto master:
- RHEL 9.8+ backport guards: #ifndef PCI_IRQ_INTX in irq_adapter.c, RHEL_RELEASE_CODE in vm_flags_set/clear (rmapi_node.c, uvm_node.c) and DMA_BUF namespace import (dmabuf_p2p.c). (nano_timer_adapter.c container_of() and rom_fw_adapter.c MAX_PAGE_ORDER were already landed on master.)
- install.sh: install extracted target/firmware/nvidia-rs/*/*.fw packs into /lib/firmware before depmod.
- contrib/rhel-5.14-boot/: boot persistence setup for RHEL 9 (modprobe/dracut/udev/systemd/nodes.sh), with empty-vs-wildcard pci_target guard in nodes.sh.
- driver_version= module parameter (default 580.178.04): overrides /proc/driver/nvidia/version, NV_ESC_CHECK_VERSION_STR, and RM 0x101/0x13e identity replies at load time so hosts running newer 580.x userspace (e.g. driver_version=580.196.07) work without breaking 580.178.04 parity.
Co-authored-by: Gaël STEPHAN <gstephan@wyplay.com>
Recheck that the GPU device is still live under nv_rs_rmapi_alloc_lock before inserting a new DMA record in nv_rs_rmapi_os_page_dma(), and hold a struct page reference across each cached UVM CPU-to-DMA mapping until after dma_unmap_page() completes.
Require CAP_SYS_ADMIN for NV_RS_ESC_EXPORT_TO_DMABUF_FD now that RMAPI nodes are 0666, unmap retained RMAPI and UVM DMA mappings in nv_rs_rmapi_node_gpu_remove() before PCI teardown, bump the nv_vma_start_write() guard to Linux 6.4+ (6.3 doesn't have vma_start_write), and switch bind_dev_nodes.sh from lsmod|grep to /sys/module checks so pipefail SIGPIPE can't bypass the stock-driver guard.
Route the 47-bit DMA mask negotiation in rmapi_node.c and uvm_node.c through nv_rs_pci_negotiate_dma() under p->access so active DMA leases and dma_bits stay consistent. Also require the faulting GPU's own page tree to map before returning Mapped in ManagedFaultMapper, and keep set_gpu_pma_base() monotonic on re-registration.
btop queries nvmlDeviceGetPowerManagementLimit, which hits RM control 0x2080a61d and was falling through to NOT_SUPPORTED. Wire it up next to 0x2080a61f to return the 300W limit.
Also switch the RMAPI and UVM misc devices to mode 0666 (matching stock /dev/nvidia*) and add a small bind-mount helper (wired optionally via BIND_DEV_NODES=1 in install.sh) so tools like btop, nvidia-smi, and non-root services can use nvidia_rs directly without a mount namespace.
Tested on 4x Tesla V100-SXM2-16GB (Dell PowerEdge C4130) running Ubuntu
7.0.0-44-generic with Intel VT-d enabled (no iommu=pt).
Fixes#2 and a few other things that showed up once 16GB cards came up:
- Derive the GV100 runtime VRAM window, RMAPI VideoRegion ceiling, NVENC
ucode staging address, and UVM descriptor/PMA base from the real FB size
in placement::Placement::usable instead of hardcoding 32 GiB constants.
Also pass the detected VRAM size through fb_info_v2_with_usable so
cards with a smaller BAR1 still report the right total memory.
- Switch LiveEngine::irq_top_half, live_irq_mask, and live_irq_unmask to
the lockless nv_rs_pci_{read,write}32_irq helpers. Using the normal
nv_rs_pci_{read,write}32 path acquires p->access inside hardirq context
and self-deadlocks when an IRQ lands on the same CPU running
irq_thread_service.
- DMA-map sysmem pages per GPU instead of putting raw physical addresses
in GPU page tables and rings: lazy per-GPU dma_map_page for RMAPI
allocations and CPU-mapped UVM semaphore/managed pages, dma_alloc_coherent
for SysmemPageTree and the replayable fault ring, and a live coherent
flush page in 0x100c10 across ACR load/runtime/unload so SYS_MEMBAR does
not hit stale unmapped IOVAs left behind by stock nvidia.ko.
- Add version-guarded compatibility wrappers for Linux 6.3-7.0 API changes
(noop_llseek, vm_flags_set/clear, PCI_IRQ_INTX, timer_container_of,
hrtimer_setup, MAX_PAGE_ORDER, MODULE_IMPORT_NS("DMA_BUF"), and
drm_driver.date).
Verified with cargo fmt/clippy/test (918 passed), make modules +
check_kernel_module.py (10/10, largest_stack 1000), native-hello,
uvm-replayable-fault-test, 4-GPU cuda-multigpu-parity (matches stock
580.178.04), and llama-bench on 1 and 4 GPUs with zero DMAR faults and
clean unbind/rmmod.
- utils.mk: search ~/.cargo/bin in rustup lookup and fall back to ~/.cargo/bin/rustc; auto-gate -Z cf-protection=branch -C jump-tables=no on CONFIG_X86_KERNEL_IBT=y (overridable via NV_RS_KERNEL_IBT=0/1).
- rust-toolchain.toml: restore default stable 1.100.0 (IBT kernels build with RUSTUP_TOOLCHAIN=nightly-2026-11-29).
- tools/check_kernel_module.py: resolve section-symbol relocation targets against disassembled function-entry addresses (avoiding false mid-function failures on valid .text+<entry_off> relocs) and enforce the x86 endbr64 gate when IBT is configured or emitted.
- Stock 580.178.04 parity: omit .llseek across fops (matching nv.c/uvm.c), use container_of() in nano_timer_adapter.c (matching nv-timer.h), use #if defined(MAX_PAGE_ORDER) in rom_fw_adapter.c (matching nv-linux.h), and pass FOLL_LONGTERM in nv_rs_rmapi_os_lock_user_pages (matching os-mlock.c).
- Docs: remove scratch docs/HISTORY.md and update docs/KERNEL_COMPAT.md.
- Boundary proven by fetching mm.h at the tags: vm_flags_set/vm_flags_clear absent at v6.2, present at v6.3, and the running 7.3.6 kernel has them. rmapi_node.c x4 and uvm_node.c x1 take the helpers on the >=6.3 side, plain |= / &= below.
- Reads be untouched: a const member is still readable, so vm_get_page_prot(vma->vm_flags) and the shared_rw test stand as they was.
- The kernel took no_llseek out tree-wide in cb787f4ac0c2 (v6.12, 2024-09-27); the 7.3.6-gentoo build choked on the dead name, same as the in-tree drivers mechanically scrubbed.
- All 5 file_operations llseek initializers in kernel-open (diagnostic.c, gpu_owner.c, uvm_node.c, rmapi_node.c x2) now take no_llseek on kernels < 6.12 and noop_llseek on >= 6.12, with <linux/version.h> pulled in.
- Boundary proven from the kernel git itself + headers at the tags: 868941b14441 (v6.0) turned no_llseek into #define NULL, cb787f4ac0c2 (v6.12) took the name out. noop_llseek survived and is what in-tree DRM/accel use.
- Galley scroll docs/KERNEL_COMPAT.md + mast pointer line, per the chart law.
- The lseek behavior difference (noop_llseek returns f_pos, old side failed with -ESPIPE) is documented in the scroll — no silent semantics smuggled aboard.
Apply PR #7 review: UVM node keeps stock -ESPIPE, docs stop lying about seek mode
- uvm_node.c ≥6.12 branch: noop_llseek -> NULL. Verified stock 580.178.04 uvm.c uvm_fops carries NO llseek callback, so stock lseek() be -ESPIPE; noop_llseek returned f_pos — a bloody parity break against the exact-parity law. NULL keeps -ESPIPE because fs/open.c clears FMODE_LSEEK for nodes with NULL llseek (verified at the v6.12 tag and the running 7.3.6 kernel).
- docs/KERNEL_COMPAT.md: the behavior difference applies ONLY to nodes whose open path leaves seek mode enabled. The diagnostic node and both RMAPI nodes call nonseekable_open() in their open callbacks (diagnostic.c:78, rmapi_node.c:740,800), so they keep returning -ESPIPE on ≥6.12 — the old blanket claim was a lie. The GPU open node (open_gpu clears no seek mode) be the only node where lseek succeeds on ≥6.12.
- Other kernel branches unchanged, as the review asked.
GPU open node keeps stock -ESPIPE: kill the lie that stock used no_llseek
- gpu_owner.c >=6.12 branch: noop_llseek -> NULL. Stock ground truth at tag 580.178.04 (kernel-open/nvidia/nv.c:236 nvidia_fops) carries NO .llseek field at all -> NULL -> FMODE_LSEEK cleared at open -> lseek() = -ESPIPE, on every kernel version. Tags 470.256.02/535.104.05/550.144.03 show zero llseek references, so stock never had a llseek handler. Our noop_llseek there made lseek() SUCCEED (returns f_pos) — a real parity break, and CodeRabbit let it slide because it only looked at the handler name, not the open path. open_gpu clears no seek mode, so the handler actually runs.
- Retracted: 'U no_llseek' in reports/kernel-module-codegen-validation.json is OUR OWN module's undefined-symbol list, not stock evidence. No blob-level proof exists on this box: nv-kernel.o_binary is not shipped in the repo, no stock nvidia*.ko under /lib/modules/7.3.6-gentoo, and reports/original-live-init-pt-3/runtime-code/kcore covers only 2 PT_LOAD segments (0xffffffffaea00000+0x1003000, 0xffffffffc03a0000+0x25bc000) — nvidia_fops at 0xffffffffc7858ee0 falls outside, so the struct bytes can't be read. Only kallsyms proves the symbol exists in the live module.
- Docs seek-mode law rewritten: noop_llseek may only be used where seek mode is already disabled (the three nonseekable_open() nodes); nodes leaving FMODE_LSEEK set (uvm_node.c, gpu_owner.c) must take NULL. Verified mechanism: fs/open.c:969 clears FMODE_LSEEK for NULL llseek at v6.12; vfs_llseek returns -ESPIPE when the mode is clear and dereferences the handler only when set; on v5.15 no_llseek is the fallback for a NULL handler. no_llseek (NULL since v6.0) and NULL be behaviorally identical, so the pre-6.12 side be untouched as the review asked.
With system_memory_pool_retain_mb=-1 released pages stay in the pool and
left nv_rs_rmapi_alloc_total, so pins and allocations could exceed 7/8 of
RAM. Pin admission now adds the pool; allocation admission counts the pool
once as max(pool, count), since the pool is reused first.
Not compiled locally (no kernel toolchain).
gstephan-enhanced
The previous commit gave pinned user pages their own 7/8-of-RAM limit next
to the RAM/2 budget of the driver's own allocations, so the two together
could reach ~1.4x RAM. Both now also count against one combined ceiling of
7/8 of RAM (nv_rs_rmapi_total_max_pages), checked in os_lock_user_pages and
os_alloc_pages.
gstephan-enhanced
nv_rs_rmapi_os_lock_user_pages (class 0x71, cudaHostRegister) checked the
request against nv_rs_rmapi_memory_max_pages(), the RAM/2 budget meant for
pages this driver allocates itself. On a 125 GiB host that caps every pinned
host buffer together at ~62 GiB: registering a 71.7 GiB arena returned
NO_MEMORY, the application fell back to pinning slices (41 GiB) and left the
rest pageable, where the stock driver registers the whole arena.
User pins now have their own counter and limit (7/8 of RAM); the RAM/2
budget of nv_rs_rmapi_os_alloc_pages only counts the driver's own pages, so
large user pins can no longer underflow it either.
gstephan-enhanced
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime
- Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after)
- Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps