[PATCH v6 4/9] vfio/{iommufd, container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-22 Thread Joao Martins via
Move the HostIOMMUDevice::realize() to be invoked during the attach of the device before we allocate IOMMUFD hardware pagetable objects (HWPT). This allows the use of the hw_caps obtained by IOMMU_GET_HW_INFO that essentially tell if the IOMMU behind the device supports dirty tracking. Note: The

[PATCH v5 08/13] vfio/{iommufd, container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-19 Thread Joao Martins via
Move the HostIOMMUDevice::realize() to be invoked during the attach of the device before we allocate IOMMUFD hardware pagetable objects (HWPT). This allows the use of the hw_caps obtained by IOMMU_GET_HW_INFO that essentially tell if the IOMMU behind the device supports dirty tracking. Note: The

[PATCH v4 07/12] vfio/{iommufd, container}: Initialize HostIOMMUDeviceCaps during attach_device()

2024-07-12 Thread Joao Martins via
Fetch IOMMU hw raw caps behind the device and thus move the HostIOMMUDevice::realize() to be done during the attach of the device. It allows it to cache the information obtained from IOMMU_GET_HW_INFO from iommufd early on. However, while legacy HostIOMMUDevice caps always return true and doesn't h