Hi Eric/Don/Shameer, On Fri, Nov 08, 2024 at 12:52:42PM +0000, Shameer Kolothum wrote: > Those IOVAs belong to [0x8000000, 0x8100000] matching > MSI_IOVA_BASE and MSI_IOVA_LENGTH definitions in kernel > arm-smmu-v3 driver. This is the window used to allocate > IOVAs matching physical MSI doorbells. [...] > +static void > +build_iort_rmr_nodes(GArray *table_data, GArray *smmu_idmaps, > + size_t *smmu_offset, uint32_t *id) > +{ [...] > + /* Physical Range offset */ > + build_append_int_noprefix(table_data, 0x8000000, 8); > + /* Physical Range length */ > + build_append_int_noprefix(table_data, 0x100000, 8); > + build_append_int_noprefix(table_data, 0, 4); /* Reserved */ > + *id += 1; > + }
Jason made some kernel patches for iommufd to do MSI mappings: https://github.com/jgunthorpe/linux/commits/for-nicolin/ It addresses Robin's remark against a get_msi_mapping_domain API so that we could likely support a RMR solution as well, if a VMM chooses to use it v.s. a future non-RMR one (mapping vITS page). Yet, here we seem to be missing a pathway between VMM and kernel to agree on the MSI window decided by the kernel, as this patch does the hard coding for a [0x8000000, 0x8100000) range. Though I am aware that the sysfs node "/sys/devices/pci000x/000x/iommu_group/reserved_regions" exposes the MSI window, it's probably better to have a new iommufd uAPI to expose the range, so a nested domain eventually might be able to choose between a RMR flow and a non-RMR flow. I have been going through the structures between QEMU's SMMU code and virt/virt-acpi-build code, yet having a hard time to figure out a way to forward the MSI window from the SMMU code to IORT, especially after this series changes the "smmu" instance creation from virt code to "-device" string. Any thought? Thanks Nicolin