From 2a59dcb768541b759ada9cd6f24986e2c234bd37 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Wed, 23 Sep 2026 14:03:27 -0400 Subject: kernel: track channels and execute host-class pushed work The guest's CUDA stack was stuck inside context creation because the work it submits is never executed by the emulated GPU. Two forms of pushed work were missing, and the completion path had grown far too slow to be useful: - Channel tracking: on a channel allocation parse the GPFIFO GPU VA and entry count, the USERD address/aperture and the instance block, hand them to the progress service and drop them again when the channel is freed. - Host-class (C46F) semaphore releases: pushes on a compute channel signal progress with a five-dword method run (SEM_ADDR_LO/HI, PAYLOAD_LO/HI, EXECUTE) rather than the copy-engine group the service already understood, so those releases were never applied. Decode both forms. - Emulated vidmem: channel blocks (USERD/instance) and some client semaphores live in the emulated frame buffer, whose VAs are a window over the BAR1 backing rather than guest RAM; access them through the right aperture. - Latency: the service's full-RAM sweep took seconds per pass, so guests' progress waits took whole seconds and the driver tore its own setup back down in the meantime. Sweep guest RAM in bounded, chunked windows on every pass, remember the pages pushes are actually found in and revisit those first, and keep the VA->PA map complete (dedup, sort, binary search) so semaphores resolve reliably. Also add a vidmem poke parameter for bringing up and debugging emulated frame-buffer state. --- kernel/gsp_rm_tu104.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'kernel/gsp_rm_tu104.h') diff --git a/kernel/gsp_rm_tu104.h b/kernel/gsp_rm_tu104.h index 74d1ba3..3ac01b7 100644 --- a/kernel/gsp_rm_tu104.h +++ b/kernel/gsp_rm_tu104.h @@ -293,7 +293,7 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_ENG_DESC] = TU104_ENG_CE0, [EI_FIFO_TAG] = TU104_TAG_CE0, [EI_RM_ENGINE_TYPE] = TU104_RM_ENGINE_CE0, - [EI_RUNLIST] = 1, + [EI_RUNLIST] = 0, [EI_MMU_FAULT_ID] = TU104_FAULT_ID_CE0, [EI_RC_MASK] = TU104_RC_CE0, [EI_RESET] = 1, @@ -318,7 +318,7 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_ENG_DESC] = TU104_ENG_CE1, [EI_FIFO_TAG] = TU104_TAG_CE1, [EI_RM_ENGINE_TYPE] = TU104_RM_ENGINE_CE1, - [EI_RUNLIST] = 2, + [EI_RUNLIST] = 1, [EI_MMU_FAULT_ID] = TU104_FAULT_ID_CE1, [EI_RC_MASK] = TU104_RC_CE1, [EI_RESET] = 2, @@ -332,8 +332,8 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_CHRAM_PRI_BASE] = 0, [EI_KERNEL_RM_MAX] = 0, }, - .pbdmaIds = {2, 0}, - .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 2, 0}, + .pbdmaIds = {1, 0}, + .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 1, 0}, .numPbdmas = 1, .engineName = "CE1", }, @@ -343,7 +343,7 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_ENG_DESC] = TU104_ENG_CE2, [EI_FIFO_TAG] = TU104_TAG_CE2, [EI_RM_ENGINE_TYPE] = TU104_RM_ENGINE_CE2, - [EI_RUNLIST] = 3, + [EI_RUNLIST] = 2, [EI_MMU_FAULT_ID] = TU104_FAULT_ID_CE2, [EI_RC_MASK] = TU104_RC_CE2, [EI_RESET] = 3, @@ -357,8 +357,8 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_CHRAM_PRI_BASE] = 0, [EI_KERNEL_RM_MAX] = 0, }, - .pbdmaIds = {3, 0}, - .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 3, 0}, + .pbdmaIds = {2, 0}, + .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 2, 0}, .numPbdmas = 1, .engineName = "CE2", }, @@ -368,7 +368,7 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_ENG_DESC] = TU104_ENG_CE3, [EI_FIFO_TAG] = TU104_TAG_CE3, [EI_RM_ENGINE_TYPE] = TU104_RM_ENGINE_CE3, - [EI_RUNLIST] = 4, + [EI_RUNLIST] = 3, [EI_MMU_FAULT_ID] = TU104_FAULT_ID_CE3, [EI_RC_MASK] = TU104_RC_CE3, [EI_RESET] = 4, @@ -382,8 +382,8 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_CHRAM_PRI_BASE] = 0, [EI_KERNEL_RM_MAX] = 0, }, - .pbdmaIds = {4, 0}, - .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 4, 0}, + .pbdmaIds = {3, 0}, + .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 3, 0}, .numPbdmas = 1, .engineName = "CE3", }, @@ -393,7 +393,7 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_ENG_DESC] = TU104_ENG_CE4, [EI_FIFO_TAG] = TU104_TAG_CE4, [EI_RM_ENGINE_TYPE] = TU104_RM_ENGINE_CE4, - [EI_RUNLIST] = 5, + [EI_RUNLIST] = 4, [EI_MMU_FAULT_ID] = TU104_FAULT_ID_CE4, [EI_RC_MASK] = TU104_RC_CE4, [EI_RESET] = 5, @@ -407,8 +407,8 @@ static const struct tu104_fifo_device_entry tu104_engine_table[] = { [EI_CHRAM_PRI_BASE] = 0, [EI_KERNEL_RM_MAX] = 0, }, - .pbdmaIds = {5, 0}, - .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 5, 0}, + .pbdmaIds = {4, 0}, + .pbdmaFaultIds = {TU104_PBDMA_FAULT_ID_BASE + 4, 0}, .numPbdmas = 1, .engineName = "CE4", }, -- cgit v1.2.3