Skip to contentSkip to conversation

intel-iommu:make identity_map default for crash dump

PATCH In review Dave Young 2 participants 3 messages Nov 1, 2011

Subsystems (3)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 intel-iommu:make identity_map default for crash dump

kdump kernel sometimes will get DMAR faults which
is caused by random in-flight dma from 1st kernel

Here make the identity_mapping as default for this case

---
 drivers/iommu/intel-iommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/iommu/intel-iommu.c +2 -1
@@ -40,6 +40,7 @@
 #include <linux/tboot.h>
 #include <linux/dmi.h>
 #include <linux/pci-ats.h>
+#include <linux/crash_dump.h>
 #include <asm/cacheflush.h>
 #include <asm/iommu.h>
 
@@ -2488,7 +2489,7 @@ static int __init init_dmars(void)
 		}
 	}
 
-	if (iommu_pass_through)
+	if (iommu_pass_through || is_kdump_kernel())
 		iommu_identity_mapping |= IDENTMAP_ALL;
 
 #ifdef CONFIG_INTEL_IOMMU_BROKEN_GFX_WA

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 4 lines · Dave Young

kdump kernel sometimes will get DMAR faults which
is caused by random in-flight dma from 1st kernel

Here make the identity_mapping as default for this case

So you want to *allow* the random in-flight DMA? And with an identity mapping it's really going to random addresses, since it'll be untranslated and won't even go to the physical addresses which it was originally intended for?

This seems entirely broken to me.

If there is "random in-flight dma" from the first kernel, the correct thing to do is *block* it. Which is what we do.

Signature · 1 line
dwmw2
author
#2 lore raw
Quoted 11 lines · David Woodhouse
Quoted 4 lines · Dave Young

kdump kernel sometimes will get DMAR faults which
is caused by random in-flight dma from 1st kernel

Here make the identity_mapping as default for this case

So you want to *allow* the random in-flight DMA? And with an identity mapping it's really going to random addresses, since it'll be untranslated and won't even go to the physical addresses which it was originally intended for?

Quoted 5 lines

This seems entirely broken to me.

If there is "random in-flight dma" from the first kernel, the correct thing to do is *block* it. Which is what we do.

This patch works for me for several cases. For kdump It can be seen a workaround. But yes blocking the 1st kernel dma is ideal.

Glad to hear that you are working on this.

Signature · 7 lines
Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec