freebsd-dev/sys/x86/iommu
Konstantin Belousov f9feb09189 Correct handling of RMRR during early enumeration stages.
On some machines, DMAR contexts must be created before all devices
under the scope of the corresponding DMAR unit are enumerated.
Current code has two problems with that:
- scope lookup returns NULL device_t, which causes to skip creating a
  context with RMRR, which is fatal for the affected device.
- calculation of the final pci dbsf address fails if any bridge in the
  scope is not yet enumerated, because code relies on pcib_get_bus().

Make creation of contexts work either with device_t, or with DMAR PCI
scope paths.  Scope provides enough information to infer context
address, and it is directly matched against DMAR tables scopes.

When calculating bus addresses for the scope or device, use direct
pci_cfgregread(PCIR_SECBUS_1) to get the secondary bus number, instead
of pcib_get_bus().

The issue was observed on HP Gen servers, where iLO PCI devices are
located behind south bridge switch.  Turning on translation without
satisfying RMRR requests caused iLO to mostly hang, up to the level of
being unusable to control the server.

While there, remove hw.dmar.dmar_match_verbose tunable, and make the
normal logging under bootverbose useful and sufficient to diagnose
DRHD and RMRR parsing and matching.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2019-04-18 14:18:06 +00:00
..
busdma_dmar.c Correct handling of RMRR during early enumeration stages. 2019-04-18 14:18:06 +00:00
busdma_dmar.h sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
intel_ctx.c Correct handling of RMRR during early enumeration stages. 2019-04-18 14:18:06 +00:00
intel_dmar.h Correct handling of RMRR during early enumeration stages. 2019-04-18 14:18:06 +00:00
intel_drv.c Correct handling of RMRR during early enumeration stages. 2019-04-18 14:18:06 +00:00
intel_fault.c sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
intel_gas.c Don't include DMAR map entry zone items in kernel dumps. 2018-02-18 16:03:50 +00:00
intel_idpgtbl.c sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
intel_intrmap.c Correct handling of RMRR during early enumeration stages. 2019-04-18 14:18:06 +00:00
intel_qi.c Eliminate the arena parameter to kmem_free(). Implicitly this corrects an 2018-08-25 19:38:08 +00:00
intel_quirks.c sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
intel_reg.h sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
intel_utils.c Correct handling of RMRR during early enumeration stages. 2019-04-18 14:18:06 +00:00
iommu_intrmap.h Use VT-d interrupt remapping block (IR) to perform FSB messages 2015-03-19 13:57:47 +00:00