diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-23 06:06:26 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-23 06:06:26 -0400 |
| commit | d7e578b41b3c9d1ff6f5f705a27fe80c6e3a6520 (patch) | |
| tree | fe9e8419f245f68e4619f6f957fc5f0ce3a9cd3d /kernel/main.c | |
| parent | 49f6cc35af91e2a403490cd9319166dd14f5f64e (diff) | |
| download | open-iov-d7e578b41b3c9d1ff6f5f705a27fe80c6e3a6520.tar.gz open-iov-d7e578b41b3c9d1ff6f5f705a27fe80c6e3a6520.zip | |
kernel: semaphore service forward-jump completion, stats, sema_probe
Relax the in-order rule to forward progress (payload > current), with the
jump bounded and counted: UVM tolerates forward jumps up to 2M
(2 * UVM_CHANNEL_NUM_GPFIFO_ENTRIES_MAX), and push buffers are recycled so
intermediate pushes can be missed. Add miss/stale/jump counters to the
rebuild log and a sema_probe module parameter to dump the service's map
entry and live slot values for a GPU VA (diagnostics for tracker stalls).
Diffstat (limited to 'kernel/main.c')
| -rw-r--r-- | kernel/main.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c index 177c729..637c79b 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -2116,6 +2116,38 @@ module_param_cb(scan_seq, &nv_vgpu_scan_seq_ops, NULL, 0200); MODULE_PARM_DESC(scan_seq, "Scan vidmem for a u32 sequence (hex,comma separated)"); /* + * Debug: dump the semaphore service's view of a GPU VA (VA->PA map entry and + * the current semaphore slot values): + * echo 0x121000010[,count] > .../parameters/sema_probe + */ +static int nv_vgpu_sema_probe_set(const char *val, const struct kernel_param *kp) +{ + char buf[64]; + char *comma; + u64 va = 0; + u32 n = 8; + + strscpy(buf, val, sizeof(buf)); + comma = strchr(buf, ','); + if (comma) { + *comma = '\0'; + if (kstrtou32(comma + 1, 0, &n)) + return -EINVAL; + } + if (kstrtoull(buf, 0, &va)) + return -EINVAL; + + return gsp_sema_service_probe(va, n); +} + +static const struct kernel_param_ops nv_vgpu_sema_probe_ops = { + .set = nv_vgpu_sema_probe_set, +}; + +module_param_cb(sema_probe, &nv_vgpu_sema_probe_ops, NULL, 0200); +MODULE_PARM_DESC(sema_probe, "Dump sema-service map + slot values for a GPU VA"); + +/* * Debug: find page-table entries pointing at a physical address, in guest RAM * and emulated vidmem: * echo 0x12442b000 > .../parameters/scan_pt |
