diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/gsp_phys_booter.c | 85 |
1 files changed, 60 insertions, 25 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c index c7abdaf..75b00d1 100644 --- a/kernel/gsp_phys_booter.c +++ b/kernel/gsp_phys_booter.c @@ -570,6 +570,14 @@ bool gsp_phys_boot_requested(void) * is set; the default mask 0x3f leaves it off (skipped, logged). */ #define GSP_PHYS_RMCALL_GOLDEN9_MASK_VAS_COPY_PDES (1u << 8) +/* + * Golden9i: bind the golden channel to the ladder's SHARED_MANAGEMENT VAS + * (gsp_phys_rmcall_vas_shared=1) instead of the PTETABLE_HEAP_MANAGED golden + * VAS, and pre-install the page-table window on it with DMA_UPDATE_PDE_2 + * before the golden promote. Bit 9 selects this path; bits 8+9 together are + * invalid (the golden VAS controls are skipped when bit 9 is set). + */ +#define GSP_PHYS_RMCALL_GOLDEN9_MASK_LADDER_VAS (1u << 9) #define GSP_PHYS_RMCALL_GR_PROMOTE_MAX \ (GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN9) @@ -7991,26 +7999,48 @@ static int gsp_phys_rmcall_golden_replay(void __iomem *bar0) } /* - * Mode 25: the captured VAS construct control follows the VAS alloc, - * then golden9g installs the context window in the golden VAS's - * server walker. Both are gated off by default (fwclient mask bit 8) - * and abort the replay only when the gate is enabled and the server - * rejects a step. + * Mode 25 / golden9i: bind the golden channel to the ladder's + * SHARED_MANAGEMENT VAS and pre-install the ctx window in its server + * walker (DMA_UPDATE_PDE_2), the supported map path for a non-external + * VAS. Otherwise golden9g sends the captured VAS construct control to + * the PTETABLE_HEAP_MANAGED golden VAS and skips the walker install + * (refused 0x1f on a client-managed VAS). */ if (boot_stage.rmcall_gr_promote == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN9 && gsp_phys_rmcall_engine_is_gr()) { - ret = gsp_phys_rmcall_golden9_vas_control(bar0); - if (ret) { - pr_err("vgsp-boot: rm-call: GOLDEN9 VAS control failed (%d); the golden replay aborts with no retry\n", - ret); - return ret; - } - ret = gsp_phys_rmcall_golden9_vas_windows(bar0); - if (ret) { - pr_err("vgsp-boot: rm-call: GOLDEN9G golden VAS ctx window install failed (%d); the golden replay aborts with no retry\n", - ret); - return ret; + if (gsp_phys_rmcall_fwclient_mask_value() & + GSP_PHYS_RMCALL_GOLDEN9_MASK_LADDER_VAS) { + if (!boot_stage.rmcall_vas || + gsp_phys_rmcall_vas_shared_value() == 0) { + pr_err("vgsp-boot: rm-call: GOLDEN9I needs the ladder SHARED_MANAGEMENT VAS (rmcall_vas=0x%x shared=%u); aborting the golden replay with no retry\n", + boot_stage.rmcall_vas, + gsp_phys_rmcall_vas_shared_value()); + return -EINVAL; + } + ret = gsp_phys_rmcall_map_pt_window(bar0); + if (ret) { + pr_err("vgsp-boot: rm-call: GOLDEN9I shared-VAS ctx window install failed (%d); aborting the golden replay with no retry\n", + ret); + return ret; + } + } else { + ret = gsp_phys_rmcall_golden9_vas_control(bar0); + if (ret) { + pr_err("vgsp-boot: rm-call: GOLDEN9 VAS control failed (%d); the golden replay aborts with no retry\n", + ret); + return ret; + } + /* + * The walker install is attempted but non-fatal (0x1f on + * the client-managed golden VAS): the channel-alloc datum + * is still collected and the ladder aborts later if the + * promote cannot proceed. + */ + ret = gsp_phys_rmcall_golden9_vas_windows(bar0); + if (ret) + pr_warn("vgsp-boot: rm-call: GOLDEN9G golden VAS ctx window install failed (%d); continuing without the walker mapping (the golden VAS controls are non-fatal here)\n", + ret); } } @@ -8083,16 +8113,21 @@ static int gsp_phys_rmcall_golden_replay(void __iomem *bar0) ch.internal_flags = cpu_to_le32( GSP_PHYS_RMCALL_CHANNEL_INTERNALFLAGS_PRIV_KERNEL); /* - * Golden9f: bind the golden channel to the golden VAS (the - * captured shape), now that its page directory is installed - * above. The earlier golden9c workaround used the ladder VAS; - * that VAS is IS_EXTERNALLY_OWNED, so the server's promote - * defers channel-context binding to UVM and the engine ctxsw - * never becomes usable. The golden VAS is PTETABLE_HEAP_MANAGED - * (client page tables, not externally owned) and takes the full - * client-managed commit path. + * Golden9f/9i VAS binding: the captured shape runs on the + * PTETABLE_HEAP_MANAGED golden VAS; golden9i (mask bit 9) + * instead binds to the ladder's SHARED_MANAGEMENT VAS whose + * server walker takes the ctx-window DMA_UPDATE_PDE_2 install + * (the client-managed golden VAS refuses it 0x1f). The + * IS_EXTERNALLY_OWNED ladder default is the golden9c shape and + * is not used by either golden9 mode. */ - ch.h_va_space = cpu_to_le32(GSP_PHYS_RMCALL_HANDLE_GOLDEN_VAS); + if (gsp_phys_rmcall_fwclient_mask_value() & + GSP_PHYS_RMCALL_GOLDEN9_MASK_LADDER_VAS) + ch.h_va_space = + cpu_to_le32(boot_stage.rmcall_vas); + else + ch.h_va_space = + cpu_to_le32(GSP_PHYS_RMCALL_HANDLE_GOLDEN_VAS); ch.h_object_buffer = cpu_to_le32(0); /* * The captured golden wire carried client-local FBMEM |
