From f359b91af0b7ee1660a38856bbff05d0132bd50f Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Thu, 24 Sep 2026 08:58:59 -0400 Subject: kernel: aperture-aware pinning and UVM CE channel USERD discovery Debug injections could only teach sysmem translations, but the UVM CE channel rings and USERDs live in the frame buffer window, and the progress service had no candidate for their USERD (the allocation parameters carry an offset relative to a client pool, not the FB offset). Add an aperture field to the pinned translations and to the sema_map_add debug parameter (va,pa[,len[,aperture]]), and probe the observed UVM layout as well: the USERD sits one 0x10000 block after the ring for the data-path channels. With the rings pinned, the pump now resolves and decodes the CE rings (the entries point at 1 MB pushbuffer regions); only the pushbuffer VA->PA translation is still missing, so the entries are kept pending. --- kernel/main.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'kernel/main.c') diff --git a/kernel/main.c b/kernel/main.c index 25bd5eb..63657f3 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -2256,8 +2256,8 @@ MODULE_PARM_DESC(sema_probe, "Dump sema-service map + slot values for a GPU VA") static int nv_vgpu_sema_map_add_set(const char *val, const struct kernel_param *kp) { char buf[64]; - char *comma, *comma2; - u64 va = 0, pa = 0, len = 0; + char *comma, *comma2, *comma3; + u64 va = 0, pa = 0, len = 0, ap = 0; strscpy(buf, val, sizeof(buf)); comma = strchr(buf, ','); @@ -2269,10 +2269,17 @@ static int nv_vgpu_sema_map_add_set(const char *val, const struct kernel_param * *comma2 = '\0'; if (kstrtoull(buf, 0, &va) || kstrtoull(comma + 1, 0, &pa)) return -EINVAL; - if (comma2 && kstrtoull(comma2 + 1, 0, &len)) - return -EINVAL; + if (comma2) { + comma3 = strchr(comma2 + 1, ','); + if (comma3) + *comma3 = '\0'; + if (kstrtoull(comma2 + 1, 0, &len)) + return -EINVAL; + if (comma3 && kstrtoull(comma3 + 1, 0, &ap)) + return -EINVAL; + } - return gsp_sema_service_add_map(va, pa, len); + return gsp_sema_service_add_map(va, pa, len, (u32)ap); } static const struct kernel_param_ops nv_vgpu_sema_map_add_ops = { -- cgit v1.2.3