diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-02 10:58:17 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-02 10:58:17 -0400 |
| commit | 2f249817df327f5dcccf0464ad517fa60d6071d3 (patch) | |
| tree | e939b19b183dbd1691770d7811087508a02a6737 /kernel/gsp_phys_gpu.c | |
| parent | ead34850aa8ba623b097b403830f3d793bddbdf7 (diff) | |
| download | open-iov-2f249817df327f5dcccf0464ad517fa60d6071d3.tar.gz open-iov-2f249817df327f5dcccf0464ad517fa60d6071d3.zip | |
gsp-phys: GR engine context allocate/map/promote before the GR sem push (default off; live-unverified at promote)
Diffstat (limited to 'kernel/gsp_phys_gpu.c')
| -rw-r--r-- | kernel/gsp_phys_gpu.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/kernel/gsp_phys_gpu.c b/kernel/gsp_phys_gpu.c index 227246b..a52714c 100644 --- a/kernel/gsp_phys_gpu.c +++ b/kernel/gsp_phys_gpu.c @@ -342,6 +342,62 @@ int gsp_phys_rmcall_engine_value(void) EXPORT_SYMBOL_GPL(gsp_phys_rmcall_engine_value); /* + * H1 GR context-promote bisection selector (default 0). The p6h1b single + * entry (value 1, size raw+subctx) made GSP-RM assert on submission (NOCAT + * recType=5 errorCode=0x52a8b04, no fn76 reply) and WPR2 could not be + * cleared afterwards, so every other promote shape is opt-in here: + * 0 = PROMOTE_CTX is never sent (the GR ladder still runs the geometry + * queries, the context buffer/PT allocation, the PDB mapping and the + * channel/compute alloc, then stops before BIND with a clear log); + * 1 = single MAIN entry, bInitialize=1/bNonmapped=0, size raw+subctx; + * 2 = two-phase external-VAS shape (PA-only nonmapped first, then VA-only); + * 3 = single MAIN entry like 1 but with size = the exact raw save size. + * The set callback clamps out-of-range values to 0 and warns on every nonzero + * enable: a failed GR context promote can wedge the device and needs a reboot + * with human approval, so run it only when reboot readiness is confirmed. + * The value is snapshotted when stage 3 starts; later sysfs changes are noted + * once and ignored, so a session can never mix promote shapes. + */ +static int gsp_phys_rmcall_gr_promote_param; + +static int gsp_phys_rmcall_gr_promote_set(const char *val, + const struct kernel_param *kp) +{ + int ret; + + ret = param_set_int(val, kp); + if (ret) + return ret; + if (gsp_phys_rmcall_gr_promote_param < 0 || + gsp_phys_rmcall_gr_promote_param > 3) { + pr_warn("gsp-phys: gsp_phys_rmcall_gr_promote=%d is outside 0..3; clamping to 0 (no PROMOTE_CTX)\n", + gsp_phys_rmcall_gr_promote_param); + gsp_phys_rmcall_gr_promote_param = 0; + } + if (gsp_phys_rmcall_gr_promote_param != 0) + pr_warn("gsp-phys: WARNING: gsp_phys_rmcall_gr_promote=%d enabled: a failed GR context promote can assert GSP-RM (NOCAT recType=5 errorCode=0x52a8b04) and wedge the device with WPR2 left up and teardown unable to clear it; recovery requires a reboot with human approval - run only when reboot readiness is confirmed\n", + gsp_phys_rmcall_gr_promote_param); + return 0; +} + +static const struct kernel_param_ops gsp_phys_rmcall_gr_promote_ops = { + .set = gsp_phys_rmcall_gr_promote_set, + .get = param_get_int, +}; + +module_param_cb(gsp_phys_rmcall_gr_promote, + &gsp_phys_rmcall_gr_promote_ops, + &gsp_phys_rmcall_gr_promote_param, 0644); +MODULE_PARM_DESC(gsp_phys_rmcall_gr_promote, + "GR context-promote bisection (default 0: never send PROMOTE_CTX; 1: single entry init+nonmapped=0 size=raw+subctx, the p6h1b shape; 2: two-phase PA-only nonmapped then VA-only; 3: single entry size=raw); values outside 0..3 clamp to 0 with a warning"); + +int gsp_phys_rmcall_gr_promote_value(void) +{ + return gsp_phys_rmcall_gr_promote_param; +} +EXPORT_SYMBOL_GPL(gsp_phys_rmcall_gr_promote_value); + +/* * One-way power latch (default). Re-enabling runtime PM and D3cold after a * claim lets the board power-gate and the host hard-freeze on resume * (observed 2026-10-01); keep the pre-claim D0 policy instead and require |
