arm-smmu: select suitable MSI IOVA
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest4 patches 11 repliesIn review
- v33 patches 10 repliesSuperseded
- v23 patches 15 repliesSuperseded
Changes in v4 from the cover letter
- Add warn message to indicate MSI IOVA reservation issue
- Fix loop condition in arm_smmu_get_resv_regions()
- Refactor arm_smmu_get_resv_regions() by introducing iommu_set_sw_msi() helper function
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | arm-smmu: move MSI_IOVA macro definitionsdrivers/ drivers/ drivers/ +1 more | +3 | 0 replies | |
| 2/4 | iommu/of: fix device tree configuration for PCI devicesdrivers/ | +11 | 1 reply | |
| 3/4 | arm-smmu: select suitable MSI IOVAdrivers/ drivers/ include/ | +75 | 7 replies | |
| 4/4 | drivers: iommu: refactor arm_smmu_get_resv_regionsdrivers/ drivers/ drivers/ +1 more | +47 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/4] arm-smmu: select suitable MSI IOVA
Hi,
Currently, the MSI_IOVA_BASE address is hard-coded to 0x80000000, assuming that all platforms have this address available for MSI IOVA reservation. However, this is not always the case, as some platforms reserve this address for other purposes. Consequently, these platforms cannot reserve the MSI_IOVA_BASE address for MSI.
There was an [1] attempt to fix this problem by passing the MSI IOVA base as a kernel command line parameter.
The faulty iommu-addresses can be reserved in DTS and suitable MSI_IOVA can be selected (Suggested by Jason), However, for individual PCI devices of_iommu driver can't reserve iommu-addresses as these devices doesn't inherit parent DTS properties.
There are at least 3 ways to reserve iommu-addresses for individual PCI devices,
- 1) By dynamically adding DTS nodes for individual PCI devices using
[2] CONFIG_PCI_DYNAMIC_OF_NODES, this requires hardcoding PCI device IDs in DECLARE_PCI_FIXUP_FINAL
- 2) By adding PCI devices nodes either in DTS or by modifying FDT at boot time in the firmware, eg [3] However, of_iommu driver doesn't seem to handle individual PCI devices, additionally this approach doesn't seem to much scalable for the complex PCI hierarchy
- 3) By configuring PCI host controller DTS node for PCI device so that it can inherit iommu-addresses defined in the parent node.
This patch series aims to address both the problems described above:
- select suitable MSI IOVA when the default MSI IOVA conflicts with reserved iommu addresses
- Using 3) approach appropriately handle iommu-addresses for individual PCI devices during IOMMU configuration
This patch series accommodates platforms that do not have the default MSI base address available for MSI reservation by implementing both solutions described above.
[1]: https://lore.kernel.org/lkml/[email protected]/
[2]: https://lwn.net/Articles/939317/
[3]: https://elixir.bootlin.com/linux/v6.16/source/arch/arm64/boot/dts/nvidia/tegra186.dtsi#L1388
Thanks,
Shyam
---
v4:
- Add warn message to indicate MSI IOVA reservation issue
- Fix loop condition in arm_smmu_get_resv_regions()
- Refactor arm_smmu_get_resv_regions() by introducing iommu_set_sw_msi() helper function
v3:
- Drop "arm,smmu-faulty-msi-iova" property change
- Fix iommu driver device tree configuration for PCI devices
- Use "iommu-addresses" property to identify reserved MSI IOVA regions, and introduce an additional MSI_IOVA_BASE2 macro to select a suitable MSI IOVA base if the default overlaps with a reserved region (suggested by Jason)
v2:
- add new dts property to hold faulty MSI IOVA and select appropriate MSI IOVA address
v1:
Shyam Saini (4):
arm-smmu: move MSI_IOVA macro definitions iommu/of: fix device tree configuration for PCI devices
arm-smmu: select suitable MSI IOVA
drivers: iommu: refactor arm_smmu_get_resv_regions
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 13 ++----- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 3 -- drivers/iommu/arm/arm-smmu/arm-smmu.c | 16 ++------ drivers/iommu/iommu.c | 37 ++++++++++++++++++ drivers/iommu/of_iommu.c | 11 ++++++ drivers/iommu/virtio-iommu.c | 2 - include/linux/iommu.h | 42 +++++++++++++++++++++ 7 files changed, 96 insertions(+), 28 deletions(-)
Signature · 1 line
2.34.1