From: Joerg Roedel Date: Mon, 19 Aug 2019 13:22:55 +0000 (+0200) Subject: iommu: Disable passthrough mode when SME is active X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2cc13bb4f59f;p=linux.git iommu: Disable passthrough mode when SME is active 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 Tested-by: Tom Lendacky Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 9ad1b0af2306b..0f585b6146576 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -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",