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)
Mar 22 2024, 4:27 AM
Unknown Object (File)
Feb 7 2024, 4:36 PM
Unknown Object (File)
Dec 29 2023, 7:10 PM
Unknown Object (File)
Dec 23 2023, 9:17 AM
Unknown Object (File)
Nov 13 2023, 8:52 PM
Unknown Object (File)
Nov 6 2023, 2:38 PM
Unknown Object (File)
Sep 15 2023, 11:56 AM
Unknown Object (File)
Sep 15 2023, 11:51 AM
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.