[PATCH 1/7] iommu/amd: Disable IOMMUs at boot if they are enabled

From: Joerg Roedel
Date: Fri Jun 16 2017 - 10:10:53 EST


From: Joerg Roedel <jroedel@xxxxxxx>

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@xxxxxxx>
---
drivers/iommu/amd_iommu_init.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index d9f5ddd..fb7035f 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -2316,6 +2316,9 @@ static int __init early_amd_iommu_init(void)
if (ret)
goto out;

+ /* Disable any previously enabled IOMMUs */
+ disable_iommus();
+
if (amd_iommu_irq_remap)
amd_iommu_irq_remap = check_ioapic_information();

--
2.7.4