summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_rm_emulation.c
diff options
context:
space:
mode:
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;