summaryrefslogtreecommitdiffstats
path: root/kernel/main.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 10:13:04 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 10:13:04 -0400
commit582696da869374455c3bcdaf63cbcd28352da14e (patch)
treece0832a6c1caf050d3fdb4706d13a738e3fbbdcc /kernel/main.c
parentb589a88ff559833a80ff60c86d1e2c823bd66839 (diff)
downloadopen-iov-582696da869374455c3bcdaf63cbcd28352da14e.tar.gz
open-iov-582696da869374455c3bcdaf63cbcd28352da14e.zip
gsp-phys: command-queue TX and the GSP-RM unload RPC for clean teardown
Adds a minimal msgq producer on the command queue (element layout, checksum, sequence, dma_wmb before writePtr, doorbell) and submits the UNLOADING_GUEST_DRIVER RPC so GSP-RM shuts down and sets the scratch14 handoff bit the Booter Unload gate needs. Release attempts the RPC once before quiescing when a boot ran; on-demand testing is available through the debugfs file gsp-phys-unload-rpc while the module owns the GPU. GSP-RM processor suspend is polled on the GSP mailbox.
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c
index f86dc98..30156ab 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -32,6 +32,7 @@
#include "nv-vgpu-vfio-interface.h"
#include "gsp_phys_gpu.h"
+#include "gsp_phys_booter.h"
#define NV_VERSION_STRING "550.163.01"
@@ -1453,6 +1454,12 @@ static int __init nv_vgpu_init(void)
ret);
}
+ /* Test-enabling trigger for the GSP-RM unload RPC; inert unless a
+ * stage-3d boot ran on a live claim (gsp_phys_boot=1). Removed on
+ * module exit. Creation failure is non-fatal. */
+ if (gsp_phys_boot_debugfs_init())
+ pr_warn("gsp-resman-vfio: gsp-phys-unload-rpc debugfs trigger unavailable\n");
+
pr_info("NVIDIA vGPU VFIO driver loaded (version %s)\n", NVIDIA_VGPU_VFIO_VERSION);
/* Start the emulated-GPU progress service: it discovers the guest's
* GPU-VA -> guest-PA map and applies copy-engine semaphore releases so
@@ -1488,6 +1495,7 @@ static void __exit nv_vgpu_exit(void)
pr_info("gsp-resman-vfio: nv_vgpu_exit: clearing VFIO ops to break circular dependency\n");
g_vgpu_vfio_ops = NULL;
+ gsp_phys_boot_debugfs_fini();
gsp_phys_gpu_release();
if (nv_vgpu_driver.device_count > 0) {