summaryrefslogtreecommitdiffstats
path: root/kernel/main.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 02:07:52 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 02:07:52 -0400
commit129991a063cbef7cdfc7f10faafdb97107d15e14 (patch)
treeafab2def10f5505b11df84a3724811dbf29bcd73 /kernel/main.c
parentfe3055491bfa7d0753fae8069cf6ed30d1b668dd (diff)
downloadopen-iov-129991a063cbef7cdfc7f10faafdb97107d15e14.tar.gz
open-iov-129991a063cbef7cdfc7f10faafdb97107d15e14.zip
gsp-phys: freeze-safe release, boot-proof READY, and guest-wiring P2/P3/P5-wave1
Host-freeze fix bundle (validated 2/2 supervised cycles): - power unlock now latches D0/D3cold by default (new gsp_phys_repower, default 0); releasing the claim can no longer power-gate the board and hard-freeze the host on resume - bounded post-rebind readiness gate before dropping the locks; bounded D0 settle/verify before the unbind - READY means a live GSP-RM session: the async worker and the module-owned join only expose READY when init-done is seen and no unload was sent; otherwise the claim is released fail-open - FWSEC reads DMEM0/IMEM back before STARTCPU and fails fast when the staging is not visible - the claim harness leaves the board latched by default and takes --restore-power to opt back into the old restore Guest-wiring: - P2: generation-keyed fn65 static-config snapshot cache plus a default-off identity overlay (new gsp_phys_static_live) for name/short-name/VBIOS; the probe cycle runs once per backend generation at READY - P3: default-off read-only RM_CONTROL forwarding whitelist (new gsp_phys_ctrl_forward) with emulated-handle translation to the adopted server handles and full emulation fallback - P5 wave 1: default-off shadow execution of guest CE pushes on the ladder channel (new gsp_phys_work_forward) via a dedicated ordered work item; the ladder stage-4 submission is refactored into a shared bounded helper and the software release path stays authoritative Live: module-owned boot to init-done, guest smoke ALL OK 64/64 with P2/P3 enabled, 514 shadow copies observed on the physical CE; all cycles released cleanly with WPR2 down and no reboot.
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/kernel/main.c b/kernel/main.c
index f47ef69..3784a70 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -1452,9 +1452,23 @@ static int __init nv_vgpu_init(void)
if (gsp_phys_gpu_param && !gsp_phys_mdev_owned_enabled()) {
ret = gsp_phys_gpu_claim();
- if (ret)
+ if (ret) {
pr_warn("gsp-resman-vfio: physical GPU claim failed: %d\n",
ret);
+ } else {
+ /*
+ * G0.4 (P2 prep): expose the load-time module-owned
+ * claim as a READY backend session. The join path only
+ * marks the state and schedules the static-config
+ * snapshot probe (a work item); failure is non-fatal,
+ * module load keeps the emulation path. The claim
+ * itself is still released at rmmod.
+ */
+ ret = gsp_phys_backend_start();
+ if (ret)
+ pr_warn("gsp-resman-vfio: physical backend start failed: %d\n",
+ ret);
+ }
} else if (gsp_phys_gpu_param) {
pr_info("gsp-resman-vfio: gsp_phys_mdev_owned=1: physical GPU claim+boot deferred to the first mdev create\n");
} else if (gsp_phys_mdev_owned_enabled()) {
@@ -1518,10 +1532,12 @@ static void __exit nv_vgpu_exit(void)
gsp_phys_backend_begin_stop();
} else {
/*
- * Module-owned claim (gsp_phys_gpu=1, mdev_owned=0): keep
- * today's position relative to the debugfs teardown and the
- * emulation threads; module-owned sessions never forward live.
+ * Module-owned claim (gsp_phys_gpu=1, mdev_owned=0): flush the
+ * static-config probe work item (begin_stop's only effect for a
+ * module-owned session), then keep today's release position
+ * relative to the debugfs teardown and the emulation threads.
*/
+ gsp_phys_backend_begin_stop();
gsp_phys_gpu_release();
}