Skip to content

Commit

Permalink
iommu: Disable passthrough mode when SME is active
Browse files Browse the repository at this point in the history
Using Passthrough mode when SME is active causes certain
devices to use the SWIOTLB bounce buffer. The bounce buffer
code has an upper limit of 256kb for the size of DMA
allocations, which is too small for certain devices and
causes them to fail.

With this patch we enable IOMMU by default when SME is
active in the system, making the default configuration work
for more systems than it does now.

Users that don't want IOMMUs to be enabled still can disable
them with kernel parameters.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed Aug 23, 2019
1 parent 22bb182 commit 2cc13bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ static int __init iommu_subsys_init(void)
iommu_set_default_passthrough(false);
else
iommu_set_default_translated(false);

if (iommu_default_passthrough() && sme_active()) {
pr_info("SME detected - Disabling default IOMMU Passthrough\n");
iommu_set_default_translated(false);
}
}

pr_info("Default domain type: %s %s\n",
Expand Down

0 comments on commit 2cc13bb

Please sign in to comment.