summaryrefslogtreecommitdiffstats
path: root/kernel/dynamic_rpc_dispatcher.h
diff options
context:
space:
mode:
authorOpen-IOV <dev@open-iov.org>2026-09-23 05:44:08 -0400
committerOpen-IOV <dev@open-iov.org>2026-09-23 05:46:43 -0400
commit68cdd7728a7cc6715bbbff7decfe2b11c3bdf558 (patch)
tree3dc8ce2e6af313a97ec6852f5c663a9a93665d2e /kernel/dynamic_rpc_dispatcher.h
downloadopen-iov-68cdd7728a7cc6715bbbff7decfe2b11c3bdf558.tar.gz
open-iov-68cdd7728a7cc6715bbbff7decfe2b11c3bdf558.zip
Open-IOV: initial public release
Open-IOV virtualizes NVIDIA GPUs so that unmodified guest drivers run with real GPU functionality - CUDA first, 3D and video to follow - on unmodified hosts, without a proprietary vGPU license and without patching any driver, firmware or hypervisor. Core principle: emulate the interface, pass through the work. kernel/ open-iov-vfio.ko - host VFIO mdev driver: virtual GPU device (PCI config space, BAR shadows, MSI-X), GSP boot emulation, GSP-RM message-queue/RPC emulation, memory model (GPU-VA to guest-PA discovery) and the semaphore-completion service that advances guest UVM progress. userspace/ libiov.so management API and examples. tools/ guest diagnostics, firmware analysis wrappers, RM probes. scripts/ stack manager, VM harness, build/load/test automation. config/ hardware/version profiles (the portability surface). docs/ documentation tree - start at docs/README.md. wiki/ long-form firmware and protocol deep dives. Status: initialization works end to end for a stock 570.144 Linux guest on Turing (TU104): driver probe, nvidia-smi, the full GSP-RM control battery, object creation and the early CUDA/UVM start-up path. GPU work forwarding - the step that makes CUDA kernels execute on real hardware - is the active work item; see docs/04-implementation/01-known-knowns-and-unknowns.md. License: BSD-3-Clause for the project; GPL-2.0 for kernel modules that link GPL-only kernel interfaces. See LICENSE and docs/09-reference/legal-and-licensing.md.
Diffstat (limited to 'kernel/dynamic_rpc_dispatcher.h')
-rw-r--r--kernel/dynamic_rpc_dispatcher.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/kernel/dynamic_rpc_dispatcher.h b/kernel/dynamic_rpc_dispatcher.h
new file mode 100644
index 0000000..2abecb5
--- /dev/null
+++ b/kernel/dynamic_rpc_dispatcher.h
@@ -0,0 +1,66 @@
+#ifndef _DYNAMIC_RPC_DISPATCHER_H_
+#define _DYNAMIC_RPC_DISPATCHER_H_
+
+#include <linux/types.h>
+#include "gsp_rpc_client.h"
+#include "firmware_analyzer.h"
+
+/* Version-specific RPC interface */
+struct rpc_interface {
+ char version[32];
+ struct fw_addresses fw_addrs;
+
+ /* Native firmware handlers */
+ int (*alloc)(struct gsp_client *, u64, u64, u32, u32, u64, u32, u64 *, u64 *, u64 *);
+ int (*free)(struct gsp_client *, u64);
+ int (*map)(struct gsp_client *, u64, u64, u64, u32, u32, u64, u64 *);
+ int (*unmap)(struct gsp_client *, u64, u64, u64);
+ int (*pin)(struct gsp_client *, u64, u64, u64, u32, u64 *, u32 *);
+ int (*unpin)(struct gsp_client *, u64, u64, u64);
+ int (*schedule)(struct gsp_client *, u64, u64, u64, u32, u32);
+ int (*yield)(struct gsp_client *);
+ int (*bar_trap)(struct gsp_client *, u64, u32, u32, u64, u32, u64 *);
+ int (*migrate_save)(struct gsp_client *, u64, u64, u64, u64, u64 *);
+ int (*migrate_restore)(struct gsp_client *, u64, u64, u64, u64, u64);
+ int (*notify_register)(struct gsp_client *, u32, void (*)(struct gsp_client *, struct gsp_rpc_response *, void *), void *);
+ void (*notify_unregister)(struct gsp_client *, u32);
+
+ /* Emulation fallback flags */
+ bool use_emulation[GSP_RPC_MAX_TYPE];
+};
+
+/* Public API */
+int dynamic_dispatcher_init(const char *fw_path);
+void dynamic_dispatcher_fini(void);
+struct rpc_interface *dynamic_dispatcher_get_interface(void);
+bool dynamic_dispatcher_use_emulation(enum gsp_rpc_type type);
+
+/* Dispatcher functions */
+int dynamic_dispatcher_alloc(struct gsp_client *client, u64 size, u64 alignment, u32 mem_type,
+ u32 flags, u64 addr_hint, u32 pid, u64 *gpu_va, u64 *handle, u64 *actual_size);
+int dynamic_dispatcher_free(struct gsp_client *client, u64 handle);
+int dynamic_dispatcher_map(struct gsp_client *client, u64 handle, u64 gpu_va, u64 size,
+ u32 prot, u32 flags, u64 offset, u64 *mapped_va);
+int dynamic_dispatcher_unmap(struct gsp_client *client, u64 handle, u64 gpu_va, u64 size);
+int dynamic_dispatcher_pin(struct gsp_client *client, u64 handle, u64 offset, u64 size,
+ u32 flags, u64 *dma_addr, u32 *num_pages);
+int dynamic_dispatcher_unpin(struct gsp_client *client, u64 handle, u64 offset, u64 size);
+int dynamic_dispatcher_schedule(struct gsp_client *client, u64 work_handle, u64 callback, u64 arg,
+ u32 priority, u32 flags);
+int dynamic_dispatcher_yield(struct gsp_client *client);
+int dynamic_dispatcher_bar_trap(struct gsp_client *client, u64 bar_addr, u32 access_type, u32 size,
+ u64 value, u32 bar_num, u64 *ret_value);
+int dynamic_dispatcher_migrate_save(struct gsp_client *client, u64 src_gpu_id, u64 dst_gpu_id,
+ u64 memory_bitmap, u64 page_table_ptr, u64 *checkpoint);
+int dynamic_dispatcher_migrate_restore(struct gsp_client *client, u64 src_gpu_id, u64 dst_gpu_id,
+ u64 memory_bitmap, u64 page_table_ptr, u64 checkpoint);
+int dynamic_dispatcher_notify_register(struct gsp_client *client, u32 type,
+ void (*callback)(struct gsp_client *, struct gsp_rpc_response *, void *),
+ void *ctx);
+void dynamic_dispatcher_notify_unregister(struct gsp_client *client, u32 type);
+
+/* Info */
+const char *dynamic_dispatcher_get_version(void);
+const struct fw_addresses *dynamic_dispatcher_get_fw_addresses(void);
+
+#endif /* _DYNAMIC_RPC_DISPATCHER_H_ */ \ No newline at end of file