summaryrefslogtreecommitdiffstats
path: root/kernel/main.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-28 15:20:04 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-28 15:20:04 -0400
commit042b8953823190623452c0539d1b6807450aa67a (patch)
treed009b3e6bcbe934d93fc794768fd7c53b3bd60bc /kernel/main.c
parent41520c6dbd39e0457dcf9bafa467f9c2827a5944 (diff)
downloadopen-iov-042b8953823190623452c0539d1b6807450aa67a.tar.gz
open-iov-042b8953823190623452c0539d1b6807450aa67a.zip
sema: add walk_probe - trace the page-table walk for a VA
New module parameter walk_probe <va> runs the recorded-va-space walks and the discovered-directory walk directly (pin/lat/pair map bypassed) with per-level tracing, and prints the result of each. This separates 'the page tables are not walkable' from 'the VA->PA pair map already answers' when a translation is missing. Baseline on a live boot: root PDB entries are zero (L0 e=0 idx=0) so the writes UVM issues into the level pages have no parent entry yet.
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 4f7f9ee..dcfdeed 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -2248,6 +2248,27 @@ 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: run the page-table walks for a GPU VA with per-level tracing,
+ * bypassing the pin/lat/pair map (see gsp_sema_service_walk_probe):
+ * echo 0x20400f000 > .../parameters/walk_probe
+ */
+static int nv_vgpu_walk_probe_set(const char *val, const struct kernel_param *kp)
+{
+ u64 va = 0;
+
+ if (kstrtoull(val, 0, &va))
+ return -EINVAL;
+ return gsp_sema_service_walk_probe(va);
+}
+
+static const struct kernel_param_ops nv_vgpu_walk_probe_ops = {
+ .set = nv_vgpu_walk_probe_set,
+};
+
+module_param_cb(walk_probe, &nv_vgpu_walk_probe_ops, NULL, 0200);
+MODULE_PARM_DESC(walk_probe, "Trace the page-table walks for a GPU VA (hex)");
+
+/*
* Debug: dump the semaphore service's channel table (GPFIFO/USERD state and
* the two NvNotification slots each channel exposes):
* echo 1 > .../parameters/chan_dump