summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-05 14:03:48 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-05 14:03:48 -0400
commitaff698d003d256a41bf7d4062bb81792457d3219 (patch)
treea0cb796c505e0c0188b5845f747f2a38082ae33f /kernel/gsp_phys_booter.c
parent9575bcb9c69cdf0b166f0ad755f7f75a24bfbba6 (diff)
downloadopen-iov-aff698d003d256a41bf7d4062bb81792457d3219.tar.gz
open-iov-aff698d003d256a41bf7d4062bb81792457d3219.zip
vgsp: srv_ctxcommit mode 2 (V6 client combined init+VA entry)
Make gsp_phys_rmcall_srv_ctxcommit an int mode: 1 (default) = map + INITIALIZE_CTX + UVM-shape VA-only promote; 2 = V6 client variant, no INITIALIZE_CTX and one combined PA+VA MAIN entry with bInitialize=1 and bNonmapped=0 so the first ctxsw initializes from the golden image; 0 = pure server-managed. Lets the next supervised cycle bisect both entry shapes without a rebuild. Build clean; not hardware-tested (GPU wedged).
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 8a27edf..af91968 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -9183,7 +9183,8 @@ static int gsp_phys_rmcall_srv_ctx_commit(void __iomem *bar0)
* PA-only.
*/
if (!boot_stage.rmcall_srv_ctxva ||
- boot_stage.rmcall_srv_ctxva_client) {
+ (boot_stage.rmcall_srv_ctxva_client &&
+ gsp_phys_srv_ctxcommit_mode() != 2)) {
ic = kvzalloc(sizeof(*ic), GFP_KERNEL);
if (!ic)
return -ENOMEM;
@@ -9259,6 +9260,25 @@ static int gsp_phys_rmcall_srv_ctx_commit(void __iomem *bar0)
if (boot_stage.rmcall_srv_ctxva) {
u32 n = 0;
+ if (boot_stage.rmcall_srv_ctxva_client &&
+ gsp_phys_srv_ctxcommit_mode() == 2) {
+ /*
+ * V6 client variant: one combined PA+VA MAIN entry with
+ * bInitialize=1 and bNonmapped=0 (the init half plus the
+ * promote half of kgrobjPromoteContext) and no separate
+ * INITIALIZE_CTX, so the first ctxsw initializes the
+ * context from the golden image instead of restoring the
+ * zeroed client image.
+ */
+ gsp_phys_rmcall_promote_entry_fill(p, n++, 0,
+ main_pa, boot_stage.rmcall_ctx_va,
+ main_size, pa_attr, 1, 0);
+ p->entry_count = cpu_to_le32(n);
+ pr_info("vgsp-boot: rm-call: V6 client combined MAIN entry: pa=0x%llx va=0x%llx size=0x%llx attr=0x%x bInitialize=1 bNonmapped=0\n",
+ main_pa, boot_stage.rmcall_ctx_va,
+ main_size, pa_attr);
+ goto gr_promote_send;
+ }
if (boot_stage.rmcall_srv_patch_valid)
gsp_phys_rmcall_promote_entry_fill(p, n++, 2,
0, GSP_PHYS_RMCALL_VA_GR_PATCH,
@@ -9280,6 +9300,7 @@ static int gsp_phys_rmcall_srv_ctx_commit(void __iomem *bar0)
main_pa, 0, main_size, pa_attr, 1, 1);
p->entry_count = cpu_to_le32(1);
}
+gr_promote_send:
rpc_result = 0;
status = 0;
ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_subdevice,