KEXEC: prevent panic on the kexec path when talking to the DMAR hardware Signed-off-by: Andrew Cooper diff -r 23c068b10923 xen/drivers/passthrough/vtd/dmar.h --- a/xen/drivers/passthrough/vtd/dmar.h Wed Jun 15 16:16:41 2011 +0100 +++ b/xen/drivers/passthrough/vtd/dmar.h Wed Jun 15 16:57:39 2011 +0100 @@ -23,6 +23,7 @@ #include #include +#include /* This one is for interrupt remapping */ struct acpi_ioapic_unit { @@ -98,9 +99,13 @@ do { sts = op(iommu->reg, offset); \ if ( cond ) \ break; \ - if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) \ - panic("%s:%d:%s: DMAR hardware is malfunctional\n", \ - __FILE__, __LINE__, __func__); \ + if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) { \ + if ( !kexecing ) \ + panic("%s:%d:%s: DMAR hardware is malfunctional\n",\ + __FILE__, __LINE__, __func__); \ + else \ + break; \ + } \ cpu_relax(); \ } \ } while (0)