summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_rm_emulation.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-21 19:42:17 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-21 19:42:17 -0400
commit9b44eb71ca2392606b74a15f7f330482be3e826a (patch)
tree52fe50af7c66feb807ad1e82d768628e4b1ca4ca /kernel/gsp_rm_emulation.c
parent8ddb13c9d96be05b859056788740330b5653e72b (diff)
downloadopen-iov-9b44eb71ca2392606b74a15f7f330482be3e826a.tar.gz
open-iov-9b44eb71ca2392606b74a15f7f330482be3e826a.zip
kernel: INTR_GET_KERNEL_TABLE subtreeMap = intrInitSubtreeMap_TU102 values
Driver's intrCacheIntrFields requires subtree(ACCESS_CNTR=72)=1 within subtreeMap[UVM_OWNED] and UVM_SHARED to be a single subtree. Zeroed map failed RmInitNvDevice state load ('unexpected subtree'). Map matches intrInitSubtreeMap_TU102 (what physical-path guests get from real GSP-RM): ESCHED{3,3} ESCHED_NOTIF{0,0} UVM_OWNED{1,1} UVM_SHARED{2,2}, DEFAULT/RUNLIST/RUNLIST_NOTIF=INVALID(0xFF). Struct retyped to 7x2B; out_params_size spans full struct (driver reads subtreeMap at offset 2052). Verified: probe passes state load, /dev/nvidia0 persists.
Diffstat (limited to 'kernel/gsp_rm_emulation.c')
-rw-r--r--kernel/gsp_rm_emulation.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/kernel/gsp_rm_emulation.c b/kernel/gsp_rm_emulation.c
index 4ce65ba..5ad557f 100644
--- a/kernel/gsp_rm_emulation.c
+++ b/kernel/gsp_rm_emulation.c
@@ -734,12 +734,37 @@ static void gsp_rm_handle_intr_kernel_table(struct gsp_emu_context *ctx,
sizeof(struct tu104_intr_table_entry);
memcpy(intr_params->table, tu104_intr_kernel_table, copy_size);
- /* Subtree map: all entries in DEFAULT category (0) */
- memset(intr_params->subtreeMap, 0, sizeof(intr_params->subtreeMap));
+ /* Subtree map - must match intrInitSubtreeMap_TU102 (the values
+ * physical-path guests receive from real GSP-RM):
+ * ESCHED_DRIVEN_ENGINE = {3,3} (STALL_SUBTREE)
+ * ESCHED_DRIVEN_ENGINE_NOTIF = {0,0}
+ * UVM_OWNED = {1,1} (fault 64, access cntr 72)
+ * UVM_SHARED = {2,2} (doorbells/GSP/DISP)
+ * DEFAULT/RUNLIST/RUNLIST_NOTIF = INVALID (unset on Turing)
+ * intrCacheIntrFields requires accessCntrSubtree(=1) within
+ * UVM_OWNED and UVM_SHARED to be a single subtree. */
+ {
+ u32 c;
+
+ for (c = 0; c < TU104_INTR_CATEGORY_ENUM_COUNT; c++) {
+ intr_params->subtreeMap[c].subtreeStart = TU104_INTR_INVALID_SUBTREE;
+ intr_params->subtreeMap[c].subtreeEnd = TU104_INTR_INVALID_SUBTREE;
+ }
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_ESCHED_DRIVEN_ENGINE].subtreeStart = 3;
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_ESCHED_DRIVEN_ENGINE].subtreeEnd = 3;
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_ESCHED_DRIVEN_ENGINE_NOTIFICATION].subtreeStart = 0;
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_ESCHED_DRIVEN_ENGINE_NOTIFICATION].subtreeEnd = 0;
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_UVM_OWNED].subtreeStart = 1;
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_UVM_OWNED].subtreeEnd = 1;
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_UVM_SHARED].subtreeStart = 2;
+ intr_params->subtreeMap[TU104_INTR_CATEGORY_UVM_SHARED].subtreeEnd = 2;
+ }
+ /* The driver reads subtreeMap at offset 2052 (after the full
+ * 128-entry array), so the reply must span the whole struct -
+ * not just the used entries. */
*out_params_size = offsetof(struct tu104_intr_get_kernel_table_params,
- table) +
- copy_size +
+ subtreeMap) +
sizeof(intr_params->subtreeMap);
*out_status = 0;