diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-07 12:03:02 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-07 12:03:02 -0400 |
| commit | 98d204a990148e08dbbf99f356b11ab377e0fdf2 (patch) | |
| tree | 71d742895320794ac4e1ba235e95b250f311f012 | |
| parent | 4409247a4fc5cd5c0db6b85f157f85fcd962c51a (diff) | |
| download | open-iov-98d204a990148e08dbbf99f356b11ab377e0fdf2.tar.gz open-iov-98d204a990148e08dbbf99f356b11ab377e0fdf2.zip | |
vgsp: m86 - sticky gsp_phys_rmcall_gr_override_hex module parameter
The override blob can now be supplied at load (hex string, <= 1 page) and is
parsed at the first forwarded launch, so the minimal-kernel experiment no
longer depends on a debugfs write racing the guest's launch. Also observed in
the m86 attempt: after many failed launches the forwarded ring desynced
(USERD GP_PUT rewound to 1 while the engine's GP_GET was 513; IQ2M sentinel
intact, no FE fetch) - a fresh boot is required per experiment.
| -rw-r--r-- | kernel/gsp_phys_booter.c | 33 | ||||
| -rw-r--r-- | kernel/gsp_phys_gpu.c | 17 | ||||
| -rw-r--r-- | kernel/gsp_phys_gpu.h | 4 |
3 files changed, 54 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c index d7ba43d..ee433e1 100644 --- a/kernel/gsp_phys_booter.c +++ b/kernel/gsp_phys_booter.c @@ -15539,6 +15539,38 @@ static u64 gsp_phys_gr_pool_exhausted; /* m86: program-page override blob (see gsp-phys-gr-override). */ static u8 gsp_phys_gr_override[GSP_PHYS_PAGE_SIZE]; static u32 gsp_phys_gr_override_len; +static bool gsp_phys_gr_override_parsed; + +/* m86: parse the sticky hex override parameter once, before first use. */ +static void gsp_phys_gr_override_apply_param(void) +{ + const char *h = gsp_phys_rmcall_gr_override_hex_value(); + u32 n, i; + + if (gsp_phys_gr_override_parsed) + return; + gsp_phys_gr_override_parsed = true; + if (!h || !h[0] || READ_ONCE(gsp_phys_gr_override_len)) + return; + n = (u32)strlen(h); + if (n % 2 || n / 2 > GSP_PHYS_PAGE_SIZE) { + pr_warn("vgsp-boot: gr-override hex param ignored (bad length %u)\n", + n); + return; + } + for (i = 0; i < n; i += 2) { + unsigned int b; + + if (sscanf(h + i, "%2x", &b) != 1) { + pr_warn("vgsp-boot: gr-override hex param bad at %u\n", + i); + return; + } + gsp_phys_gr_override[i / 2] = (u8)b; + } + WRITE_ONCE(gsp_phys_gr_override_len, n / 2); + pr_info("vgsp-boot: gr-override hex param: %u bytes stored\n", n / 2); +} void gsp_phys_backend_gr_counters(u64 *submitted, u64 *ok, u64 *refused, u64 *timed_out, u64 *pool_exhausted) @@ -16114,6 +16146,7 @@ int gsp_phys_backend_guest_gr_submit(const struct gsp_phys_gr_submit *req, } gsp_phys_gr_submitted++; + gsp_phys_gr_override_apply_param(); mutex_lock(&gsp_phys_rm_lock); if (!gsp_phys_backend_gr_ready()) { mutex_unlock(&gsp_phys_rm_lock); diff --git a/kernel/gsp_phys_gpu.c b/kernel/gsp_phys_gpu.c index e3ca2e8..ee6625c 100644 --- a/kernel/gsp_phys_gpu.c +++ b/kernel/gsp_phys_gpu.c @@ -796,6 +796,23 @@ unsigned int gsp_phys_rmcall_gr_lmem_tpc_size_value(void) EXPORT_SYMBOL_GPL(gsp_phys_rmcall_gr_lmem_tpc_size_value); /* + * m86 sticky override (gsp_phys_rmcall_gr_override_hex; default empty): hex + * bytes stored into the program-page override at first forwarded launch, so + * the override survives every module reload without a debugfs write. + */ +static char *gsp_phys_rmcall_gr_override_hex_param; +module_param_named(gsp_phys_rmcall_gr_override_hex, + gsp_phys_rmcall_gr_override_hex_param, charp, 0644); +MODULE_PARM_DESC(gsp_phys_rmcall_gr_override_hex, + "Hex bytes applied to the forwarded launch's program page at the QMD offset (default empty)"); + +const char *gsp_phys_rmcall_gr_override_hex_value(void) +{ + return gsp_phys_rmcall_gr_override_hex_param; +} +EXPORT_SYMBOL_GPL(gsp_phys_rmcall_gr_override_hex_value); + +/* * m84 ctx-image probe (gsp_phys_rmcall_gr_img_probe; default 0). After the * stage-4 GR sem proof the ladder re-binds the rmcall channel to COPY0, * copies the first 4 KB of the MAIN context image and of the VEID0 subctx diff --git a/kernel/gsp_phys_gpu.h b/kernel/gsp_phys_gpu.h index 1b0bac3..0b85758 100644 --- a/kernel/gsp_phys_gpu.h +++ b/kernel/gsp_phys_gpu.h @@ -370,6 +370,10 @@ int gsp_phys_rmcall_gr_notifier_sys_value(void); * (default 0). */ int gsp_phys_rmcall_gr_img_probe_value(void); +/* m86: hex bytes applied to the forwarded launch's program page at the QMD + * program offset (default empty). */ +const char *gsp_phys_rmcall_gr_override_hex_value(void); + /* * Ladder VAS ownership selector (gsp_phys_rmcall_vas_shared; default 0). * 0 = FERMI_VASPACE_A is allocated IS_EXTERNALLY_OWNED (historical ladder |
