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
F108919221: D19717.id55464.diff
Wed, Jan 29, 1:44 PM
Unknown Object (File)
Sat, Jan 25, 2:12 PM
Unknown Object (File)
Wed, Jan 22, 11:20 PM
Unknown Object (File)
Wed, Jan 22, 10:19 PM
Unknown Object (File)
Fri, Jan 17, 4:59 PM
Unknown Object (File)
Fri, Jan 17, 8:56 AM
Unknown Object (File)
Wed, Jan 15, 9:23 PM
Unknown Object (File)
Dec 27 2024, 6:31 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

Lint
Lint Skipped
Unit
Tests Skipped

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.