summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_rm_emulation.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_rm_emulation.h')
-rw-r--r--kernel/gsp_rm_emulation.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/gsp_rm_emulation.h b/kernel/gsp_rm_emulation.h
index a82656f..1ab0a83 100644
--- a/kernel/gsp_rm_emulation.h
+++ b/kernel/gsp_rm_emulation.h
@@ -40,9 +40,13 @@ struct gsp_emu_context;
#define GSPRM_RPC_FUNC_GSP_SET_SYSTEM_INFO 72
#define GSPRM_RPC_FUNC_SET_REGISTRY 73
#define GSPRM_RPC_FUNC_CONTINUATION_RECORD 71
+#define GSPRM_RPC_FUNC_SET_PAGE_DIRECTORY 54
+#define GSPRM_RPC_FUNC_UNSET_PAGE_DIRECTORY 79
#define GSPRM_RPC_FUNC_GSP_RM_CONTROL 76
#define GSPRM_RPC_FUNC_GSP_RM_ALLOC 103
#define GSPRM_RPC_FUNC_FREE 10
+#define GSPRM_RPC_EVENT_POST_EVENT 0x1003
+#define GSPRM_MAX_EVENTS 128
#define GSPRM_RPC_EVENT_GSP_INIT_DONE 0x1001
/* rpc_set_guest_system_info_v03_00: version fields the driver reads back
@@ -168,10 +172,29 @@ struct gsp_rm_emu {
u32 alloc_dumps; /* raw GSP_RM_ALLOC dumps emitted */
u32 alloc_param_dumps; /* alloc param dumps emitted */
u32 ctrl_param_dumps; /* control param dumps emitted */
+
+ /*
+ * NV01_EVENT objects (class 0x5, allocated via class 0x79 in the
+ * guest ABI). Each carries {hSrcResource, notifyIndex, data}; the
+ * driver allocates one per channel and waits for the GPU to post the
+ * event before it considers submitted work complete.
+ */
+ struct mutex stat_lock; /* serializes status-queue writers */
+ struct {
+ u32 h_src; /* source object (channel handle) */
+ u32 h_event; /* event handle */
+ u32 h_client; /* owning client */
+ u32 notify_index;
+ u32 data;
+ bool valid;
+ } events[GSPRM_MAX_EVENTS];
+ u32 events_n;
+ u64 events_posted;
};
int gsp_rm_emu_init(struct nv_vgpu_device *vgpu, struct gsp_emu_context *ctx);
void gsp_rm_emu_fini(struct gsp_emu_context *ctx);
+int gsp_rm_post_channel_event(struct nv_vgpu_device *vgpu, u32 h_src);
int gsp_rm_scan_guest_ram(struct nv_vgpu_device *vgpu, u64 needle,
u64 start, u64 end, u32 max_hits);
int gsp_rm_scan_guest_ram_seq(struct nv_vgpu_device *vgpu, const u32 *pat,