From: Joerg Roedel <jroedel@suse.de>
Date: Fri, 16 Jun 2017 16:09:54 +0200
Subject: iommu/amd: Disable IOMMUs at boot if they are enabled
Git-commit: 111237415393acdef9b4f700c747a2e92c9be62e
Patch-mainline: v4.13-rc1
References: bsc#1045715 bsc#1043261
When booting, make sure the IOMMUs are disabled. They could
be previously enabled if we boot into a kexec or kdump
kernel. So make sure they are off.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu_init.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -2318,6 +2318,9 @@ static int __init early_amd_iommu_init(v
if (ret)
goto out;
+ /* Disable any previously enabled IOMMUs */
+ disable_iommus();
+
if (amd_iommu_irq_remap)
amd_iommu_irq_remap = check_ioapic_information();