Blob Blame History Raw
From: Baoquan He <bhe@redhat.com>
Date: Wed, 9 Aug 2017 16:33:44 +0800
Subject: iommu/amd: Disable iommu only if amd_iommu=off is specified
Patch-mainline: v4.14-rc1
Git-commit: 20b46dff13bd1d250dc968b318f0fac3c996b3fa
References: bsc#1043261

It's ok to disable iommu early in normal kernel or in kdump kernel when
amd_iommu=off is specified. While we should not disable it in kdump kernel
when on-flight dma is still on-going.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/amd_iommu_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -2500,7 +2500,8 @@ static int __init early_amd_iommu_init(v
 		goto out;
 
 	/* Disable any previously enabled IOMMUs */
-	disable_iommus();
+	if (!is_kdump_kernel() || amd_iommu_disabled)
+		disable_iommus();
 
 	if (amd_iommu_irq_remap)
 		amd_iommu_irq_remap = check_ioapic_information();