summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_gpu.h
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-05 13:06:39 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-05 13:06:39 -0400
commitae507e6f241c7e3498728f9d1ffc2d41ede5cd64 (patch)
treeb65dad7a98cc5812915b53196517ce9e5a55626f /kernel/gsp_phys_gpu.h
parentd647c93e9375dc47613e0a554445e4b49467f119 (diff)
downloadopen-iov-ae507e6f241c7e3498728f9d1ffc2d41ede5cd64.tar.gz
open-iov-ae507e6f241c7e3498728f9d1ffc2d41ede5cd64.zip
vgsp: guest GR forwarding backend and capture (gsp_phys_gr_forward, default off)gr-forwarding
Add a default-off guest GR (compute) forwarding path so a guest CUDA launch submitted on its GR channel can be executed by the physical GR engine on the ladder channel, with fail-closed fallback to the host CUDA bridge and the unchanged software release path. - New module parameter gsp_phys_gr_forward (default 0) and accessor. - New GR execution gate: boot_stage.rmcall_gr_exec_ok, latched only after a real GR submission logs REAL GR SEM OK; the backend refuses while it is unset. - Sema capture: a completed 64-word inline QMD on a trusted, non-replay GR decode becomes an svc_gr_cand (push identity, decoded release0, parameter/program/pointer fields, up to 8 captured inline-write records); the CUDA bridge stays authoritative while the parameter is off and is reached in order forward -> bridge -> software release. - Backend: gsp_phys_backend_guest_gr_submit() maps pages at their own guest VAs through fresh Tier-1 small-PT pages/PDE installs or relocates inline-captured pages to ladder shadow pages (Tier 2), builds SET_OBJECT + the inline-QMD method run + REPORT_SEMAPHORE on the compute subchannel, reuses the shared GPFIFO/USERD/doorbell publish tail (extracted from the CE submit path, CE bytes unchanged) and polls the QMD release and/or module semaphore, draining the epoch-gated fault queue on timeout. - Sema wiring: GR requests reuse the INFLIGHT/hold/deferral machinery so the guest channel release applies only on the submit's success/failure edge; hold shims preserve the channel engine type. - Counters and a work_gr state line plus a stats accessor. - Bounds are fixed: 16 pages, 8 inline records, 64 QMD words; every pointer/size checked, pool exhaustion and stale mappings fail closed. - New ABI layouts pinned with static_asserts. Compile-only change: no device test performed.
Diffstat (limited to 'kernel/gsp_phys_gpu.h')
-rw-r--r--kernel/gsp_phys_gpu.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/gsp_phys_gpu.h b/kernel/gsp_phys_gpu.h
index 74e3103..b204961 100644
--- a/kernel/gsp_phys_gpu.h
+++ b/kernel/gsp_phys_gpu.h
@@ -92,6 +92,18 @@ bool gsp_phys_srv_ctxbuf_value(void);
bool gsp_phys_work_forward_enabled(void);
/*
+ * True when the gsp_phys_gr_forward module parameter is set (default 0: guest
+ * GR (compute) launches stay on the existing host CUDA bridge / software
+ * path). When set, the sema service captures a completed guest inline QMD and
+ * the booter submits it as real work on the ladder's physical GR channel,
+ * but only after boot_stage.rmcall_gr_exec_ok proved a real GR submission at
+ * boot (gsp_phys_backend_gr_ready() enforces the gate). Every forward
+ * refusal/failure falls back to the CUDA bridge (when enabled) and then the
+ * unchanged software release path. One-line rollback: gsp_phys_gr_forward=0.
+ */
+bool gsp_phys_gr_forward_enabled(void);
+
+/*
* True when the gsp_phys_guest_mem module parameter is set (default 0: the
* debugfs rm-call ladder stays entirely on module-owned buffers, exactly as
* before). When set, ladder triggers 6 (W2G) and 7 (G2H) may point the real