Page MenuHomeFreeBSD

Add a PCI method for mapping IOMMU
ClosedPublic

Authored by br on Thu, May 5, 10:50 AM.

Details

Summary

We need to map a PCI Requester ID (RID) to an IOMMU ID and get associated IOMMU specifier (reference).
There are several PCI bridges between a peripheral device that proceeds IOMMU and its PCI controller device, so we need a PCI interface method.
The bus has to propagate our request to the parent until it reaches the PCI controller that contains "iommu-map" and "iommu-map-mask" properties in its DTS node and maps RID to SID for us.

Test Plan

This was tested and works well on ARM SMMUv3.2.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

br requested review of this revision.Thu, May 5, 10:50 AM
br created this revision.

Reuse pci_get_id() method, just add IOMMU id type.

Thanks for adding a new ID rather than a new method.

sys/dev/pci/pci_if.m
61

I would maybe call this PCI_ID_OFW_IOMMU or PCI_ID_FDT_IOMMU as it may not be applicable to IOMMUs on other platforms.

sys/dev/pci/pcivar.h
129

I would rename this to match the constant (either pci_id_ofw_iommu or pci_id_fdt_iommu)

rename PCI_ID_IOMMU to PCI_ID_OWF_IOMMU

This revision was not accepted when it landed; it landed in state Needs Review.Sat, May 7, 9:22 AM
This revision was automatically updated to reflect the committed changes.