summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2013-11-12 16:14:45 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2013-11-12 16:14:45 +0000
commitb3c6ddf989f21fb043795cb51eb1bade391ffcd4 (patch)
tree885e27844e5a37a2a062f0716cf6252856d63722
parent20e0369ba2677fc0f5d17362ac7448ac4cfe9202 (diff)
downloadFreeBSD-src-b3c6ddf989f21fb043795cb51eb1bade391ffcd4.zip
FreeBSD-src-b3c6ddf989f21fb043795cb51eb1bade391ffcd4.tar.gz
Actually add IOMMU domain to the list of known mappings. This fixes a bug
where multiple devices in the same IOMMU domain would be allocated conflicting mappings unless they also shared a DMA tag. MFC after: 3 days
-rw-r--r--sys/powerpc/pseries/plpar_iommu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/powerpc/pseries/plpar_iommu.c b/sys/powerpc/pseries/plpar_iommu.c
index 84a9054..e491b3c 100644
--- a/sys/powerpc/pseries/plpar_iommu.c
+++ b/sys/powerpc/pseries/plpar_iommu.c
@@ -115,6 +115,8 @@ phyp_iommu_set_dma_tag(device_t bus, device_t dev, bus_dma_tag_t tag)
(((uint64_t)(dmawindow[dma_acells + 1]) << 32) |
dmawindow[dma_acells + 2]);
+ if (bootverbose)
+ device_printf(dev, "Mapping IOMMU domain %#x\n", dmawindow[0]);
window->map = NULL;
SLIST_FOREACH(i, &iommu_map_head, entries) {
if (i->iobn == dmawindow[0]) {
@@ -134,6 +136,7 @@ phyp_iommu_set_dma_tag(device_t bus, device_t dev, bus_dma_tag_t tag)
window->map->vmem = vmem_create("IOMMU mappings", PAGE_SIZE,
trunc_page(VMEM_ADDR_MAX) - PAGE_SIZE, PAGE_SIZE, 0,
M_BESTFIT | M_NOWAIT);
+ SLIST_INSERT_HEAD(&iommu_map_head, window->map, entries);
}
/*
OpenPOWER on IntegriCloud