aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/crash.c
diff options
context:
space:
mode:
authorAndrew Cooper <andrew.cooper3@citrix.com>2011-07-08 08:38:35 +0100
committerAndrew Cooper <andrew.cooper3@citrix.com>2011-07-08 08:38:35 +0100
commitc24c3e21e3c966a1fefc8c3beeb11a6a045ffe5c (patch)
treeb3a59c1434dd450da2548b075f7fd9c3e56b0c5e /xen/arch/x86/crash.c
parent56a86d9c66c355da0433b86fe893b06d9829ac0c (diff)
downloadxen-c24c3e21e3c966a1fefc8c3beeb11a6a045ffe5c.tar.gz
xen-c24c3e21e3c966a1fefc8c3beeb11a6a045ffe5c.tar.bz2
xen-c24c3e21e3c966a1fefc8c3beeb11a6a045ffe5c.zip
KEXEC: disconnect all PCI devices from the PCI bus on crash
In the case of a crash, IOMMU DMA remapping gets turned off so that the kdump kernel may boot. However, this is warned as being dangerous in the VTD specification if a DMA transaction is in progress. Also, in the case of a crash, DMA transactions and interrupts from peripheral devices such as network cards are likely to keep coming in. Without DMA remapping enabled, the transactions will be writing over low memory, corrupting the crash state, and perhaps even the kdump reserved memory. Therefore, on the crash path, we can disconnect all PCI devices from their respective buses so that they are no longer able to be DMA busmasters. This reduces the risk of DMA transactions corrupting state (and will also reduce spurious interrupts arriving to the kdump kernel) until the kdump kernel and properly reset the PCI devices. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Diffstat (limited to 'xen/arch/x86/crash.c')
-rw-r--r--xen/arch/x86/crash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index ab18abb4d1..392c8d2395 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -28,6 +28,7 @@
#include <asm/apic.h>
#include <asm/io_apic.h>
#include <xen/iommu.h>
+#include <xen/pci.h>
static atomic_t waiting_for_crash_ipi;
static unsigned int crashing_cpu;
@@ -78,6 +79,8 @@ static void nmi_shootdown_cpus(void)
msecs--;
}
+ disconnect_pci_devices();
+
/* Crash shutdown any IOMMU functionality as the crashdump kernel is not
* happy when booting if interrupt/dma remapping is still enabled */
iommu_crash_shutdown();