[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201125014124.4070776-1-baolu.lu@linux.intel.com>
Date: Wed, 25 Nov 2020 09:41:24 +0800
From: Lu Baolu <baolu.lu@...ux.intel.com>
To: Ning Sun <ning.sun@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Will Deacon <will@...nel.org>, Joerg Roedel <joro@...tes.org>
Cc: Ashok Raj <ashok.raj@...el.com>, x86@...nel.org,
tboot-devel@...ts.sourceforge.net,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
Lu Baolu <baolu.lu@...ux.intel.com>,
Adrian Huang <ahuang12@...ovo.com>
Subject: [PATCH 1/1] x86/tboot: Don't disable swiotlb when iommu is forced on
After commit 327d5b2fee91c ("iommu/vt-d: Allow 32bit devices to uses DMA
domain"), swiotbl could also be used for direct memory access if IOMMU
is enabled but a device is configured to pass through the DMA translation.
Keep swiotlb when IOMMU is forced on, otherwise, some devices won't work
if "iommu=pt" kernel parameter is used.
Fixes: 327d5b2fee91c ("iommu/vt-d: Allow 32bit devices to uses DMA domain")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=210237
Reported-and-tested-by: Adrian Huang <ahuang12@...ovo.com>
Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
---
arch/x86/kernel/tboot.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index 420be871d9d4..ae64f98ec2ab 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -514,13 +514,10 @@ int tboot_force_iommu(void)
if (!tboot_enabled())
return 0;
- if (no_iommu || swiotlb || dmar_disabled)
+ if (no_iommu || dmar_disabled)
pr_warn("Forcing Intel-IOMMU to enabled\n");
dmar_disabled = 0;
-#ifdef CONFIG_SWIOTLB
- swiotlb = 0;
-#endif
no_iommu = 0;
return 1;
--
2.25.1
Powered by blists - more mailing lists