[PATCH][SRU][B/aws] UBUNTU: SAUCE: [aws] iommu: set the default iommu-dma mode as non-strict

Andrea Righi andrea.righi at canonical.com
Fri Oct 30 17:33:39 UTC 2020

BugLink: https://bugs.launchpad.net/bugs/1902281

Relax the synchronous IOMMU TLB invalidation constraint by default to
get a significant performance improvement on some AWS arm64 instance

This is a performance vs security tradeoff and it is not suitable for
the generic kernel. In the particular AWS environment it is reasonable
to relax the constraint without realisticly introducing security flaws.

Signed-off-by: Andrea Righi <andrea.righi at canonical.com>
 Documentation/admin-guide/kernel-parameters.txt | 4 ++--
 drivers/iommu/iommu.c                           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index de792d94d195c..0d8cdf0b9013c 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1704,13 +1704,13 @@
 	iommu.strict=	[ARM64] Configure TLB invalidation behaviour
 			Format: { "0" | "1" }
-			0 - Lazy mode.
+			0 - Lazy mode (default).
 			  Request that DMA unmap operations use deferred
 			  invalidation of hardware TLBs, for increased
 			  throughput at the cost of reduced device isolation.
 			  Will fall back to strict mode if not supported by
 			  the relevant IOMMU driver.
-			1 - Strict mode (default).
+			1 - Strict mode.
 			  DMA unmap operations invalidate IOMMU hardware TLBs
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 35b588479bc81..f8fef61d2a3f5 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -37,7 +37,7 @@
 static struct kset *iommu_group_kset;
 static DEFINE_IDA(iommu_group_ida);
 static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA;
-static bool iommu_dma_strict __read_mostly = true;
+static bool iommu_dma_strict __read_mostly;
 struct iommu_callback_data {
 	const struct iommu_ops *ops;

More information about the kernel-team mailing list