From 09f241601423b1ae98e97846ee451768ff8a0a9e Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Fri, 2 Oct 2026 10:58:17 -0400 Subject: gsp-phys: GR engine context allocate/map/promote before the GR sem push (default off; live-unverified at promote) --- kernel/gsp_phys_gpu.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'kernel/gsp_phys_gpu.h') diff --git a/kernel/gsp_phys_gpu.h b/kernel/gsp_phys_gpu.h index f34d7a2..4e5e823 100644 --- a/kernel/gsp_phys_gpu.h +++ b/kernel/gsp_phys_gpu.h @@ -175,6 +175,29 @@ bool gsp_phys_fault_inject_enabled(void); */ int gsp_phys_rmcall_engine_value(void); +/* + * GR context-promote bisection selector (gsp_phys_rmcall_gr_promote; default + * 0). Returns the module-parameter value, one of: + * 0 = never send NV2080_CTRL_CMD_GPU_PROMOTE_CTX. The GR ladder still runs + * the engine-context geometry queries, allocates and PDB-maps the MAIN + * buffer, allocates the channel/compute object, then stops before BIND + * with a clear log (the whole safe half; reviewable without a promote); + * 1 = single MAIN entry, bInitialize=1/bNonmapped=0, size = + * ALIGN_UP(raw save size, 4 KB) + maxSubctx * 4 KB (the p6h1b shape + * that asserted GSP-RM with errorCode 0x52a8b04); + * 2 = reference external-VAS two-phase shape: a PA-only nonmapped entry + * (bInitialize=1/bNonmapped=1, no VA) first, then a VA-only entry + * (bInitialize=0/bNonmapped=0) with the same PA/VA/size; + * 3 = single MAIN entry like 1 but with size = the exact raw save size. + * The parameter's set callback clamps any value outside 0..3 to 0 with a + * warning and warns on every nonzero enable (a failed promote can assert + * GSP-RM and wedge the device; recovery needs a reboot with human approval). + * The booter snapshots the value when the rm-call ladder's stage 3 starts + * and ignores later changes, so this accessor is for the snapshot and + * diagnostics only. + */ +int gsp_phys_rmcall_gr_promote_value(void); + /* * Translate a guest GPA to the pinned host PA (gsp_phys_guest_mem ladder * support). The mdev is registered with vfio_register_emulated_iommu_dev(): -- cgit v1.2.3