From 5dd8165f1754e156a0f9fb16c7a6bfa90e99ed60 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Mon, 14 Sep 2026 06:43:11 -0400 Subject: VFIO device registration fix + IOMMUFD callbacks + VFIO ioctl handlers - Removed IOMMU group addition before vfio_register_emulated_iommu_dev() in nv_vgpu_mdev_create() - Added IOMMUFD callbacks (bind_iommufd, unbind_iommufd, attach_ioas, detach_ioas) using kernel's vfio_iommufd_emulated_* functions - Implemented VFIO ioctl handlers: GET_INFO, GET_REGION_INFO, GET_IRQ_INFO, SET_IRQS, MMAP - Added config space read/write handlers at offset 0x70000000000 - Mmap handler for config space, BAR0 (emulation shadow), BAR1-5 (physical VRAM/registers) - Interrupt handler for VFIO_DEVICE_SET_IRQS (DATA_EVENTFD, DATA_NONE, DATA_BOOL) - Added udev rules for vfio group permissions - Created stack_manager.sh unified tool - Fixed mdev remove crash with deferred cleanup in vfio_device_release callback - Kernel 6.8+ IOMMUFD compatibility - QEMU launches successfully with vGPU passthrough --- kernel/gsp_rpc_client.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'kernel/gsp_rpc_client.h') diff --git a/kernel/gsp_rpc_client.h b/kernel/gsp_rpc_client.h index 54c216e..4712754 100644 --- a/kernel/gsp_rpc_client.h +++ b/kernel/gsp_rpc_client.h @@ -76,6 +76,7 @@ enum gsp_rpc_type { GSP_RPC_BAR_TRAP = 0x0A, GSP_RPC_MIGRATE = 0x0B, GSP_RPC_DEBUG = 0xFF, + GSP_RPC_MAX_TYPE = 0x10, /* Must be > highest RPC type value */ }; /* ============================================================ @@ -255,9 +256,10 @@ struct gsp_client; * PUBLIC API * ============================================================ */ -/* Client lifecycle */ -struct gsp_client *gsp_client_init(struct device *dev, phys_addr_t fw_base, phys_addr_t doorbell); -void gsp_client_fini(struct gsp_client *client); + /* Client lifecycle */ + struct gsp_client *gsp_client_init(struct device *dev, phys_addr_t fw_base, phys_addr_t doorbell); + struct gsp_client *gsp_client_init_emulation(struct device *dev, void __iomem *fw_base_virt, void __iomem *doorbell_virt); + void gsp_client_fini(struct gsp_client *client); /* Memory management */ int gsp_rpc_alloc(struct gsp_client *client, -- cgit v1.2.3