diff mbox series

[SRU,F/aws,G/aws] UBUNTU: SAUCE: [aws] iommu: set the default iommu-dma mode as non-strict

Message ID 20201030173340.123560-3-andrea.righi@canonical.com
State New
Headers show
Series [SRU,F/aws,G/aws] UBUNTU: SAUCE: [aws] iommu: set the default iommu-dma mode as non-strict | expand

Commit Message

Andrea Righi Oct. 30, 2020, 5:33 p.m. UTC
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
types.

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@canonical.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 4 ++--
 drivers/iommu/iommu.c                           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Ian May Nov. 5, 2020, 11:49 p.m. UTC | #1
Applied to G/aws/master

Thanks,
Ian

On 2020-10-30 18:33:40 , Andrea Righi wrote:
> 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
> types.
> 
> 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@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 fb3eade0b7c5..a27706cde3c7 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -1835,13 +1835,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
>  			  synchronously.
>  
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 9d7232e26ecf..50851f4e90d2 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -28,7 +28,7 @@ static struct kset *iommu_group_kset;
>  static DEFINE_IDA(iommu_group_ida);
>  
>  static unsigned int iommu_def_domain_type __read_mostly;
> -static bool iommu_dma_strict __read_mostly = true;
> +static bool iommu_dma_strict __read_mostly;
>  static u32 iommu_cmd_line __read_mostly;
>  
>  struct iommu_group {
> -- 
> 2.27.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index fb3eade0b7c5..a27706cde3c7 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1835,13 +1835,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
 			  synchronously.
 
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 9d7232e26ecf..50851f4e90d2 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -28,7 +28,7 @@  static struct kset *iommu_group_kset;
 static DEFINE_IDA(iommu_group_ida);
 
 static unsigned int iommu_def_domain_type __read_mostly;
-static bool iommu_dma_strict __read_mostly = true;
+static bool iommu_dma_strict __read_mostly;
 static u32 iommu_cmd_line __read_mostly;
 
 struct iommu_group {