From 36af41ae7460eac87b6a929a3b9af3a130507a26 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Wed, 23 Sep 2026 06:06:26 -0400 Subject: 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). --- kernel/main.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'kernel/main.c') diff --git a/kernel/main.c b/kernel/main.c index 177c729..637c79b 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -2115,6 +2115,38 @@ static const struct kernel_param_ops nv_vgpu_scan_seq_ops = { 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: -- cgit v1.2.3