Revision tags: v9.1.0 |
|
#
3966bca5 |
| 01-Jul-2024 |
Eric Auger <eric.auger@redhat.com> |
vfio-container-base: Introduce vfio_container_get_iova_ranges() helper
Introduce vfio_container_get_iova_ranges() to retrieve the usable IOVA regions of the base container and use it in the Host IOM
vfio-container-base: Introduce vfio_container_get_iova_ranges() helper
Introduce vfio_container_get_iova_ranges() to retrieve the usable IOVA regions of the base container and use it in the Host IOMMU device implementations of get_iova_ranges() callback.
We also fix a UAF bug as the list was shallow copied while g_list_free_full() was used both on the single call site, in virtio_iommu_set_iommu_device() but also in vfio_container_instance_finalize(). Instead use g_list_copy_deep.
Fixes: cf2647a76e ("virtio-iommu: Compute host reserved regions") Signed-off-by: Eric Auger <eric.auger@redhat.com> Suggested-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
#
96b7af43 |
| 17-Jun-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio/container: Move vfio_container_destroy() to an instance_finalize() handler
vfio_container_destroy() clears the resources allocated VFIOContainerBase object. Now that VFIOContainerBase is a QOM
vfio/container: Move vfio_container_destroy() to an instance_finalize() handler
vfio_container_destroy() clears the resources allocated VFIOContainerBase object. Now that VFIOContainerBase is a QOM object, add an instance_finalize() handler to do the cleanup. It will be called through object_unref().
Suggested-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
2f7243cb |
| 17-Jun-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio/container: Remove vfio_container_init()
It's now empty.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger
vfio/container: Remove vfio_container_init()
It's now empty.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
41d698b8 |
| 17-Jun-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio/container: Remove VFIOContainerBase::ops
Instead, use VFIO_IOMMU_GET_CLASS() to get the class pointer.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auge
vfio/container: Remove VFIOContainerBase::ops
Instead, use VFIO_IOMMU_GET_CLASS() to get the class pointer.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
2137d2fd |
| 17-Jun-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio/container: Introduce an instance_init() handler
This allows us to move the initialization code from vfio_container_init(), which we will soon remove.
Reviewed-by: Zhenzhong Duan <zhenzhong.dua
vfio/container: Introduce an instance_init() handler
This allows us to move the initialization code from vfio_container_init(), which we will soon remove.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
504d297e |
| 17-Jun-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio/container: Change VFIOContainerBase to use QOM
VFIOContainerBase was made a QOM interface because we believed that a QOM object would expose all the IOMMU backends to the QEMU machine and human
vfio/container: Change VFIOContainerBase to use QOM
VFIOContainerBase was made a QOM interface because we believed that a QOM object would expose all the IOMMU backends to the QEMU machine and human interface. This only applies to user creatable devices or objects.
Change the VFIOContainerBase nature from interface to object and make the necessary adjustments in the VFIO_IOMMU hierarchy.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
09181a8e |
| 17-Jun-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio/container: Simplify vfio_container_init()
Assign the base container VFIOAddressSpace 'space' pointer in vfio_address_space_insert(). The ultimate goal is to remove vfio_container_init() and ins
vfio/container: Simplify vfio_container_init()
Assign the base container VFIOAddressSpace 'space' pointer in vfio_address_space_insert(). The ultimate goal is to remove vfio_container_init() and instead rely on an .instance_init() handler to perfom the initialization of VFIOContainerBase.
To be noted that vfio_connect_container() will assign the 'space' pointer later in the execution flow. This should not have any consequence.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
33e4c22f |
| 07-May-2024 |
Zhenzhong Duan <zhenzhong.duan@intel.com> |
vfio: Make VFIOIOMMUClass::add_window() and its wrapper return bool
Make VFIOIOMMUClass::add_window() and its wrapper function vfio_container_add_section_window() return bool.
This is to follow the
vfio: Make VFIOIOMMUClass::add_window() and its wrapper return bool
Make VFIOIOMMUClass::add_window() and its wrapper function vfio_container_add_section_window() return bool.
This is to follow the coding standand to return bool if 'Error **' is used to pass error.
Suggested-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
2da5f9e4 |
| 16-May-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio: Add Error** argument to .get_dirty_bitmap() handler
Let the callers do the error reporting. Add documentation while at it.
Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Avihai
vfio: Add Error** argument to .get_dirty_bitmap() handler
Let the callers do the error reporting. Add documentation while at it.
Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Avihai Horon <avihaih@nvidia.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
836bb308 |
| 16-May-2024 |
Cédric Le Goater <clg@redhat.com> |
vfio: Add Error** argument to .set_dirty_page_tracking() handler
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it.
Revie
vfio: Add Error** argument to .set_dirty_page_tracking() handler
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Avihai Horon <avihaih@nvidia.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
fdaa774e |
| 19-Dec-2023 |
Cédric Le Goater <clg@redhat.com> |
vfio/container: Introduce a VFIOIOMMU QOM interface
VFIOContainerBase was not introduced as an abstract QOM object because it felt unnecessary to expose all the IOMMU backends to the QEMU machine an
vfio/container: Introduce a VFIOIOMMU QOM interface
VFIOContainerBase was not introduced as an abstract QOM object because it felt unnecessary to expose all the IOMMU backends to the QEMU machine and human interface. However, we can still abstract the IOMMU backend handlers using a QOM interface class. This provides more flexibility when referencing the various implementations.
Simply transform the VFIOIOMMUOps struct in an InterfaceClass and do some initial name replacements. Next changes will start converting VFIOIOMMUOps.
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Tested-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
4517c33c |
| 21-Nov-2023 |
Zhenzhong Duan <zhenzhong.duan@intel.com> |
vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks
Some of the callbacks in VFIOIOMMUOps pass VFIOContainerBase poiner, those callbacks only need read access to the sub ob
vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks
Some of the callbacks in VFIOIOMMUOps pass VFIOContainerBase poiner, those callbacks only need read access to the sub object of VFIOContainerBase. So make VFIOContainerBase, VFIOContainer and VFIOIOMMUFDContainer as const in these callbacks.
Local functions called by those callbacks also need same changes to avoid build error.
Suggested-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
36e84d0c |
| 21-Nov-2023 |
Zhenzhong Duan <zhenzhong.duan@intel.com> |
vfio/iommufd: Relax assert check for iommufd backend
Currently iommufd doesn't support dirty page sync yet, but it will not block us doing live migration if VFIO migration is force enabled.
So in t
vfio/iommufd: Relax assert check for iommufd backend
Currently iommufd doesn't support dirty page sync yet, but it will not block us doing live migration if VFIO migration is force enabled.
So in this case we allow set_dirty_page_tracking to be NULL. Note we don't need same change for query_dirty_bitmap because when dirty page sync isn't supported, query_dirty_bitmap will never be called.
Suggested-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
233309e8 |
| 02-Nov-2023 |
Zhenzhong Duan <zhenzhong.duan@intel.com> |
vfio/spapr: switch to spapr IOMMU BE add/del_section_window
No functional change intended.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com Sig
vfio/spapr: switch to spapr IOMMU BE add/del_section_window
No functional change intended.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
f79baf8c |
| 02-Nov-2023 |
Zhenzhong Duan <zhenzhong.duan@intel.com> |
vfio/container: Move iova_ranges to base container
Meanwhile remove the helper function vfio_free_container as it only calls g_free now.
No functional change intended.
Signed-off-by: Zhenzhong Dua
vfio/container: Move iova_ranges to base container
Meanwhile remove the helper function vfio_free_container as it only calls g_free now.
No functional change intended.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
c7b313d3 |
| 02-Nov-2023 |
Eric Auger <eric.auger@redhat.com> |
vfio/container: Move listener to base container
Move listener to base container. Also error and initialized fields are moved at the same time.
No functional change intended.
Signed-off-by: Eric Au
vfio/container: Move listener to base container
Move listener to base container. Also error and initialized fields are moved at the same time.
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
dc74a4b0 |
| 02-Nov-2023 |
Zhenzhong Duan <zhenzhong.duan@intel.com> |
vfio/container: Move vrdl_list to base container
No functional change intended.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by
vfio/container: Move vrdl_list to base container
No functional change intended.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
7ab1cb74 |
| 02-Nov-2023 |
Eric Auger <eric.auger@redhat.com> |
vfio/container: Move pgsizes and dma_max_mappings to base container
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signe
vfio/container: Move pgsizes and dma_max_mappings to base container
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
bb424490 |
| 02-Nov-2023 |
Eric Auger <eric.auger@redhat.com> |
vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API
dirty_pages_supported field is also moved to the base container
No functional change intended.
Signed-off-by: Eric
vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API
dirty_pages_supported field is also moved to the base container
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
e5597063 |
| 02-Nov-2023 |
Eric Auger <eric.auger@redhat.com> |
vfio/container: Move space field to base container
Move the space field to the base object. Also the VFIOAddressSpace now contains a list of base containers.
No functional change intended.
Signed-
vfio/container: Move space field to base container
Move the space field to the base object. Also the VFIOAddressSpace now contains a list of base containers.
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
dddf83ab |
| 02-Nov-2023 |
Eric Auger <eric.auger@redhat.com> |
vfio/common: Move giommu_list in base container
Move the giommu_list field in the base container and store the base container in the VFIOGuestIOMMU.
No functional change intended.
Signed-off-by: E
vfio/common: Move giommu_list in base container
Move the giommu_list field in the base container and store the base container in the VFIOGuestIOMMU.
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
ed2f7f80 |
| 02-Nov-2023 |
Zhenzhong Duan <zhenzhong.duan@intel.com> |
vfio/common: Introduce vfio_container_init/destroy helper
This adds two helper functions vfio_container_init/destroy which will be used by both legacy and iommufd containers to do base container spe
vfio/common: Introduce vfio_container_init/destroy helper
This adds two helper functions vfio_container_init/destroy which will be used by both legacy and iommufd containers to do base container specific initialization and release.
No functional change intended.
Suggested-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|
#
b08501a9 |
| 02-Nov-2023 |
Eric Auger <eric.auger@redhat.com> |
vfio/container: Switch to dma_map|unmap API
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.s
vfio/container: Switch to dma_map|unmap API
No functional change intended.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
show more ...
|