Page MenuHomeFreeBSD

devices behind downstream bridges should still get DMAR protection
ClosedPublic

Authored by tychon on Mar 26 2019, 5:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 24, 5:59 AM
Unknown Object (File)
Sun, Jun 22, 3:25 AM
Unknown Object (File)
Sat, Jun 21, 5:47 PM
Unknown Object (File)
Mon, Jun 16, 12:43 PM
Unknown Object (File)
Jun 13 2025, 4:01 AM
Unknown Object (File)
Jun 12 2025, 3:57 AM
Unknown Object (File)
Jun 5 2025, 12:41 PM
Unknown Object (File)
Jun 4 2025, 12:56 PM
Subscribers

Details

Summary

Some plugin cards contain PCI(e)-PCI(e) bridges. When the BIOS builds the ACPI tables these devices are optionally included as they maybe enumerated using standard PCI probing.

Currently a bridge needs an ACPI handle for the acpi_pci driver to attach otherwise it fails back to the pci driver something like this:

pcib1: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci1: <ACPI PCI bus> on pcib1
pcib4: <ACPI PCI-PCI bridge> irq 16 at device 2.2 on pci1
pci4: <ACPI PCI bus> on pcib4
pcib5: <ACPI PCI-PCI bridge> at device 0.0 on pci4
pci5: <ACPI PCI bus> on pcib5
pcib7: <PCI-PCI bridge> at device 16.0 on pci5
pci7: <PCI bus> on pcib7

When DMAR is enabled the assignment of the device to appropriate domain occurs when it uses busdma(9) to query the parent's tag. For devices under acpi_pci this is acpi_pci_get_dma_tag() which makes an attempt at performing the DMAR initialization by calling dmar_get_dma_tag(). For devices downstream from bridges that are under the purview of pci -- which maybe entirely within the scope of DMAR protection -- a call to bus_get_dma_tag() winds up in pci_get_dma_tag() which makes no attempted call to dmar_get_dma_tag(). This leaves those devices without DMAR initialization and hence unusable.

This patch remedies that situation by providing an opportunity to call dmar_get_dma_tag() for those devices as well.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Mar 26 2019, 7:56 PM
This revision was automatically updated to reflect the committed changes.