@@ -40,6 +40,7 @@
#include <linux/pci-ats.h>
#include <linux/memblock.h>
#include <linux/dma-contiguous.h>
+#include <linux/crash_dump.h>
#include <asm/irq_remapping.h>
#include <asm/cacheflush.h>
#include <asm/iommu.h>
@@ -2943,6 +2944,19 @@ static int __init init_dmars(void)
goto free_iommu;
iommu_check_pre_te_status(iommu);
+
+ /*
+ * We don't even try to preserve anything when we are not in a
+ * kdump kernel.
+ */
+ if (!is_kdump_kernel() && iommu->pre_enabled_trans) {
+ iommu_disable_translation(iommu);
+ iommu->pre_enabled_trans = 0;
+ g_translation_pre_enabled = 0;
+ pr_warn("Translation was enabled for %s but we are not in kdump mode\n",
+ iommu->name);
+ }
+
if (iommu->pre_enabled_trans) {
pr_info("IOMMU Copying translate tables from panicked kernel\n");
ret = intel_iommu_load_translation_tables(iommu);
@@ -8,6 +8,7 @@
#include <linux/irq.h>
#include <linux/intel-iommu.h>
#include <linux/acpi.h>
+#include <linux/crash_dump.h>
#include <asm/io_apic.h>
#include <asm/smp.h>
#include <asm/cpu.h>
@@ -666,11 +667,12 @@ static int __init intel_enable_irq_remapping(void)
iommu_check_pre_ir_status(iommu);
- /*
- * Here we do not disable intr remapping,
- * if already enabled prior to OS handover.
- */
- /* iommu_disable_irq_remapping(iommu); */
+ if (!is_kdump_kernel() && iommu->pre_enabled_ir) {
+ iommu_disable_irq_remapping(iommu);
+ iommu->pre_enabled_ir = 0;
+ pr_warn("IRQ remapping was enabled on %s but we are not in kdump mode\n",
+ iommu->name);
+ }
dmar_disable_qi(iommu);
}