summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_emulation.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-22 23:32:44 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-22 23:32:44 -0400
commit14283fe73fb5e432a7af45de94961655714910f6 (patch)
treee993bf56f3e2ef93195019ac0fd996d82204384a /kernel/gsp_emulation.c
parentb34e4531d8f0b984dc15660d3ab406ae48822931 (diff)
downloadopen-iov-14283fe73fb5e432a7af45de94961655714910f6.tar.gz
open-iov-14283fe73fb5e432a7af45de94961655714910f6.zip
kernel: FB/BUS info-list controls + PCIe link caps for the UVM path
CUDA (cuInit) now reaches UVM's device create: libcuda opens nvidia-uvm, UVM calls nvGpuOpsDeviceCreate/gpuGetGpuInfo, and the driver fails at getPCIELinkRateMBps -> calculatePCIELinkRateMBps ("Unknown PCIe speed", NV_ERR_INVALID_STATE) -> nv_open_device aborts -> cuInit returns CUDA_ERROR_NOT_INITIALIZED (3). Implemented along the way: - FB_GET_INFO_V2 (0x20801303): echo the requested FB info indices and answer TU104 values (256MB RAM/heap/BAR1, GDDR6, 8 LTCs, 4MB L2, ...). Fixes the kern_mem_sys_ctrl.c:911 asserts and gives CUDA/UVM real memory sizes. - BUS_GET_INFO_V2 (0x20801823): echo indices; PCIe Gen3 x16 link caps / GEN info / link status, SYSMEM_CONNECTION_TYPE=PCIE. UVM's gpuGetSysmemLinkInfo reads SYSMEM_CONNECTION_TYPE and the nominal link bandwidth from here. - PCIe Link Capabilities in the emulated config space (0x8C/0x92) and in the BAR0 PCFG mirror (gpuReadBusConfigReg -> NV_PCFG+0x84 = BAR0+ 0x88084): MAX_SPEED=3 (8GT/s Gen3), MAX_WIDTH=0x10 (x16); link status mirror at 0x88088. Also mirrored under the VF-window/low aliases. - Temporary change-watch on PCFG[0x88084] to see if the guest overwrites it (it does not - stays 0x103). Verified: guest nvidia-smi -L still works and reports PCIe Generation Max/Current = 3. cuInit still fails; the remaining question is which address the driver's kbifGetGpuLinkCapabilities read sees as zero (the PCFG shadow holds 0x103). Guest-side kprobe tracing of that function panicked the VM (free_swap_cache page fault on a corrupted pointer) - possible guest memory corruption to investigate separately.
Diffstat (limited to 'kernel/gsp_emulation.c')
-rw-r--r--kernel/gsp_emulation.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/gsp_emulation.c b/kernel/gsp_emulation.c
index 0b6bba0..969d4fd 100644
--- a/kernel/gsp_emulation.c
+++ b/kernel/gsp_emulation.c
@@ -305,6 +305,18 @@ static void gsp_emu_poll_boot(struct gsp_emu_context *ctx)
}
}
+ /* Temporary: watch the PCFG link-caps mirror for guest writes */
+ {
+ static u32 last_linkcap;
+ u32 v = gsp_emu_shadow_read32(ctx, 0x88084);
+
+ if (v != last_linkcap) {
+ nv_vgpu_info(ctx->vgpu, "GSP-BOOT: PCFG[0x88084] = 0x%x (was 0x%x)",
+ v, last_linkcap);
+ last_linkcap = v;
+ }
+ }
+
/* GSP ENGINE reset asserted -> falcon rebooted, restart stage tracking */
if ((engine & 0x1) && ctx->boot_stage != GSP_BOOT_STAGE_IDLE) {
nv_vgpu_info(ctx->vgpu, "GSP-BOOT: falcon reset, back to IDLE");