aboutsummaryrefslogtreecommitdiff
path: root/sys/x86/iommu/busdma_dmar.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2019-04-18 14:18:06 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2019-04-18 14:18:06 +0000
commitf9feb091895ec3dec705b087ea142433f364109b (patch)
tree5ec37193769b20ba9d9de87c352f6323fca82ebb /sys/x86/iommu/busdma_dmar.c
parentc07640c43071a3d9f0770120cf273e1984808ae2 (diff)
downloadsrc-f9feb091895ec3dec705b087ea142433f364109b.tar.gz
src-f9feb091895ec3dec705b087ea142433f364109b.zip
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
Notes
Notes: svn path=/head/; revision=346352
Diffstat (limited to 'sys/x86/iommu/busdma_dmar.c')
-rw-r--r--sys/x86/iommu/busdma_dmar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/x86/iommu/busdma_dmar.c b/sys/x86/iommu/busdma_dmar.c
index e78f4b320d72..1208118f8271 100644
--- a/sys/x86/iommu/busdma_dmar.c
+++ b/sys/x86/iommu/busdma_dmar.c
@@ -275,7 +275,7 @@ dmar_get_dma_tag(device_t dev, device_t child)
struct dmar_ctx *ctx;
bus_dma_tag_t res;
- dmar = dmar_find(child);
+ dmar = dmar_find(child, bootverbose);
/* Not in scope of any DMAR ? */
if (dmar == NULL)
return (NULL);