summaryrefslogtreecommitdiffstats
path: root/kernel/include/ioctl.h
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-13 22:17:09 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-13 22:17:09 -0400
commit9a7263fce4e3156349a526631805fce66b87fb1b (patch)
tree6278c1972754e6cb60f953a1af05a472f4efecea /kernel/include/ioctl.h
parentbfd269ee74d166be4f386640f8b5daad31d5d6ed (diff)
downloadopen-iov-9a7263fce4e3156349a526631805fce66b87fb1b.tar.gz
open-iov-9a7263fce4e3156349a526631805fce66b87fb1b.zip
Phase 5: Fix MDEV creation blocker - mdev parent registration & ioctl-based vGPU type registration
- Implemented nv_vgpu_mdev_register_parent() using mdev_register_parent() API with nv_vgpu_mdev_types array for proper mdev parent registration - Added ioctl NV_VGPU_IOCTL_REGISTER_VGPU_TYPE for userspace vGPU type registration - Created separate header nv-vgpu-vfio-interface-nvidia.h for nvidia.ko with only extern declarations to avoid duplicate symbol exports - Used KBUILD_EXTRA_SYMBOLS to provide only needed symbols (nvidia_vgpu_vfio_*) - Updated create_mdev.sh to use correct mdev type names (pci-nvidia-vgpu-*) - Updated load_vgpu_stack.sh to load open-iov-vfio.ko before nvidia.ko Result: 4 mdev types now show available_instances=8, mdev creation successful
Diffstat (limited to 'kernel/include/ioctl.h')
-rw-r--r--kernel/include/ioctl.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/include/ioctl.h b/kernel/include/ioctl.h
index 4ff3df9..36d28ac 100644
--- a/kernel/include/ioctl.h
+++ b/kernel/include/ioctl.h
@@ -32,6 +32,18 @@
#define NV_VGPU_IOCTL_SET_GSP_FIRMWARE \
_IOWR(NV_VGPU_IOCTL_MAGIC, 0x09, struct nv_vgpu_ioctl_firmware)
+#define NV_VGPU_IOCTL_REGISTER_VGPU_TYPE \
+ _IOWR(NV_VGPU_IOCTL_MAGIC, 0x0A, struct nv_vgpu_ioctl_register_vgpu_type)
+
+/* vGPU type info structure (shared between main.c and ioctl.c) */
+struct nv_vgpu_type_info {
+ char name[64];
+ char description[128];
+ u64 vdev_id;
+ u64 pdev_id;
+ u32 max_instances;
+};
+
struct nv_vgpu_ioctl_get_info {
u32 vgpu_type;
u32 vgpu_id;
@@ -93,6 +105,14 @@ struct nv_vgpu_ioctl_firmware {
u32 firmware_type;
};
+struct nv_vgpu_ioctl_register_vgpu_type {
+ char name[64];
+ char description[128];
+ u64 vdev_id;
+ u64 pdev_id;
+ u32 max_instances;
+};
+
int nv_vgpu_ioctl_get_info(struct nv_vgpu_device *vgpu, void __user *arg);
int nv_vgpu_ioctl_map_bar(struct nv_vgpu_device *vgpu, void __user *arg);
int nv_vgpu_ioctl_unmap_bar(struct nv_vgpu_device *vgpu, void __user *arg);
@@ -101,5 +121,6 @@ int nv_vgpu_ioctl_disable_irq(struct nv_vgpu_device *vgpu, void __user *arg);
int nv_vgpu_ioctl_gsp_rpc(struct nv_vgpu_device *vgpu, void __user *arg);
int nv_vgpu_ioctl_migrate_save(struct nv_vgpu_device *vgpu, void __user *arg);
int nv_vgpu_ioctl_migrate_restore(struct nv_vgpu_device *vgpu, void __user *arg);
+int nv_vgpu_ioctl_register_vgpu_type(void __user *arg);
#endif \ No newline at end of file