summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_gpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_phys_gpu.c')
-rw-r--r--kernel/gsp_phys_gpu.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel/gsp_phys_gpu.c b/kernel/gsp_phys_gpu.c
index f1d72f7..33fae68 100644
--- a/kernel/gsp_phys_gpu.c
+++ b/kernel/gsp_phys_gpu.c
@@ -1333,6 +1333,32 @@ int gsp_phys_rmcall_gr_ptr_guest_value(void)
EXPORT_SYMBOL_GPL(gsp_phys_rmcall_gr_ptr_guest_value);
/*
+ * r1625: relocate a CODESRC-SUSPECT program page (gsp_phys_gr_codesrc_reloc;
+ * default 1). The old conservative refusal left the QMD program pointer at
+ * the guest VA when the program page read empty/PTE-shaped. That VA is above
+ * every engine-PDB window, so the GPCCLIENT_GCC I-fetch raised a FAULT_PDE
+ * and the FIFO parked (the c361-c368 wedge). With this set, the builder
+ * instead copies the page into the window-0 shadow and rewrites
+ * qmd[48]/[49] to the shadow VA; an empty/unsafe source is replaced by the
+ * client's own known-good SPH+SASS image at the program offset (a raw
+ * EXIT stub would be rejected by the SPH validation). If the shadow mapping
+ * cannot be installed the launch is refused (fail-closed), so a QMD whose
+ * program pointer is not engine-mapped is never published. 0 restores the
+ * old guest-VA behaviour for a one-flip A/B.
+ */
+static int gsp_phys_gr_codesrc_reloc_param = 1;
+module_param_named(gsp_phys_gr_codesrc_reloc,
+ gsp_phys_gr_codesrc_reloc_param, int, 0644);
+MODULE_PARM_DESC(gsp_phys_gr_codesrc_reloc,
+ "Relocate a CODESRC-SUSPECT GR program page to an engine-mapped shadow page and rewrite the QMD pointer (default 1; 0 = keep the old guest-VA behaviour)");
+
+int gsp_phys_gr_codesrc_reloc_value(void)
+{
+ return gsp_phys_gr_codesrc_reloc_param;
+}
+EXPORT_SYMBOL_GPL(gsp_phys_gr_codesrc_reloc_value);
+
+/*
* m96: KIND (PTE bits 63:56) for the window-0 shadow pool PTEs. On Turing
* the v2 PTE has no PITCH kind; UVM sets GENERIC_MEMORY (0x06). A kind=0
* PTE is a candidate for the SM I-fetch MMU_NACK while the FE tolerates it.