Page MenuHomeFreeBSD

Add a PCI method for mapping IOMMU
ClosedPublic

Authored by br on May 5 2022, 10:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 14 2024, 9:00 AM
Unknown Object (File)
Jan 14 2024, 12:06 AM
Unknown Object (File)
Jan 7 2024, 8:23 AM
Unknown Object (File)
Dec 22 2023, 11:16 PM
Unknown Object (File)
Dec 22 2023, 7:13 PM
Unknown Object (File)
Nov 27 2023, 6:22 PM
Unknown Object (File)
Nov 23 2023, 4:36 PM
Unknown Object (File)
Nov 16 2023, 2:45 PM
Subscribers

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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

br requested review of this revision.May 5 2022, 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
62

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
130

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.May 7 2022, 9:22 AM
This revision was automatically updated to reflect the committed changes.