lkml.org 
[lkml]   [2019]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH 10/11] iommu: Disable passthrough mode when SME is active
Date
On 8/19/19 8:22 AM, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> 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.
>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>

> ---
> drivers/iommu/iommu.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 01759d4ac70b..ec18c9630e93 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",
>
\
 
 \ /
  Last update: 2019-08-20 23:20    [W:0.111 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site