summaryrefslogtreecommitdiffstats
path: root/kernel
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
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')
-rw-r--r--kernel/gsp_rm_emulation.c33
-rw-r--r--kernel/gsp_rm_tu104.h19
2 files changed, 47 insertions, 5 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;
diff --git a/kernel/gsp_rm_tu104.h b/kernel/gsp_rm_tu104.h
index ddd735f..d05d453 100644
--- a/kernel/gsp_rm_tu104.h
+++ b/kernel/gsp_rm_tu104.h
@@ -74,10 +74,27 @@ struct tu104_intr_table_entry {
u32 vectorNonStall;
};
+/* NV2080_INTR_CATEGORY_SUBTREE_MAP (ctrl2080internal.h) - 2 bytes */
+struct tu104_intr_subtree_map {
+ u8 subtreeStart;
+ u8 subtreeEnd;
+};
+
+/* NV2080_INTR_CATEGORY enum */
+#define TU104_INTR_CATEGORY_DEFAULT 0
+#define TU104_INTR_CATEGORY_ESCHED_DRIVEN_ENGINE 1
+#define TU104_INTR_CATEGORY_ESCHED_DRIVEN_ENGINE_NOTIFICATION 2
+#define TU104_INTR_CATEGORY_RUNLIST 3
+#define TU104_INTR_CATEGORY_RUNLIST_NOTIFICATION 4
+#define TU104_INTR_CATEGORY_UVM_OWNED 5
+#define TU104_INTR_CATEGORY_UVM_SHARED 6
+#define TU104_INTR_CATEGORY_ENUM_COUNT 7
+#define TU104_INTR_INVALID_SUBTREE 0xFF
+
struct tu104_intr_get_kernel_table_params {
u32 tableLen;
struct tu104_intr_table_entry table[TU104_INTR_TABLE_MAX_SIZE];
- u32 subtreeMap[7]; /* NV2080_INTR_CATEGORY_* count */
+ struct tu104_intr_subtree_map subtreeMap[TU104_INTR_CATEGORY_ENUM_COUNT];
};
/* NV2080_CTRL_GPU_CONSTRUCTED_FALCON_INFO (ctrl2080gpu.h) - 20 bytes */