Skip to content

Commit

Permalink
iommu/amd: Use swiotlb in passthrough mode
Browse files Browse the repository at this point in the history
In passthrough mode (iommu=pt) all devices are identity
mapped. If a device does not support 64bit DMA it might
still need remapping. Make sure swiotlb is initialized to
provide this remapping.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed Jul 30, 2015
1 parent 02ca202 commit 3230232
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2282,12 +2282,10 @@ static int amd_iommu_add_device(struct device *dev)

/* Domains are initialized for this device - have a look what we ended up with */
domain = iommu_get_domain_for_dev(dev);
if (domain->type == IOMMU_DOMAIN_IDENTITY) {
if (domain->type == IOMMU_DOMAIN_IDENTITY)
dev_data->passthrough = true;
dev->archdata.dma_ops = &nommu_dma_ops;
} else {
else
dev->archdata.dma_ops = &amd_iommu_dma_ops;
}

out:
iommu_completion_wait(iommu);
Expand Down Expand Up @@ -2852,8 +2850,8 @@ int __init amd_iommu_init_api(void)

int __init amd_iommu_init_dma_ops(void)
{
swiotlb = iommu_pass_through ? 1 : 0;
iommu_detected = 1;
swiotlb = 0;

amd_iommu_stats_init();

Expand Down

0 comments on commit 3230232

Please sign in to comment.