This patch allows the user-space to retrieve the MSI reserved region requirements, if any. The implementation is based on capability chains, now also added to VFIO_IOMMU_GET_INFO. The returned info comprises the size and the alignment requirements In case the userspace must provide the IOVA aperture, we currently report a size/alignment based on all the doorbells registered by the host kernel. This may exceed the actual needs. Signed-off-by: Eric Auger <eric.auger@redhat.com> --- v13 -> v14: - new capability struct - change the padding in vfio_iommu_type1_info v11 -> v12: - msi_doorbell_pages was renamed msi_doorbell_calc_pages v9 -> v10: - move cap_offset after iova_pgsizes - replace __u64 alignment by __u32 order - introduce __u32 flags in vfio_iommu_type1_info_cap_msi_geometry and fix alignment - call msi-doorbell API to compute the size/alignment v8 -> v9: - use iommu_msi_supported flag instead of programmable - replace IOMMU_INFO_REQUIRE_MSI_MAP flag by a more sophisticated capability chain, reporting the MSI geometry v7 -> v8: - use iommu_domain_msi_geometry v6 -> v7: - remove the computation of the number of IOVA pages to be provisionned. This number depends on the domain/group/device topology which can dynamically change. Let's rely instead rely on an arbitrary max depending on the system v4 -> v5: - move msi_info and ret declaration within the conditional code v3 -> v4: - replace former vfio_domains_require_msi_mapping by more complex computation of MSI mapping requirements, especially the number of pages to be provided by the user-space. - reword patch title RFC v1 -> v1: - derived from [RFC PATCH 3/6] vfio: Extend iommu-info to return MSIs automap state - renamed allow_msi_reconfig into require_msi_mapping - fixed VFIO_IOMMU_GET_INFO
004990c