# HG changeset patch # Parent 80448ec3e90ba0a66a495cd6b42f6dec348b5e26 diff -r 80448ec3e90b xen/arch/x86/apic.c --- a/xen/arch/x86/apic.c Mon Jun 06 10:09:16 2011 +0100 +++ b/xen/arch/x86/apic.c Mon Jun 06 14:06:31 2011 +0100 @@ -367,12 +367,15 @@ void disable_local_APIC(void) switch(apic_boot_mode) { case APIC_MODE_DISABLED: + printk("DBG: Returning APIC to disabled\n"); break; /* Nothing to do - we did this above */ case APIC_MODE_XAPIC: + printk("DBG: Returning APIC to xapic\n"); msr_content |= MSR_IA32_APICBASE_ENABLE; wrmsrl(MSR_IA32_APICBASE, msr_content); break; case APIC_MODE_X2APIC: + printk("DBG: Returning APIC to x2apic\n"); msr_content |= ( MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_EXTD ); wrmsrl(MSR_IA32_APICBASE, msr_content); break; diff -r 80448ec3e90b xen/arch/x86/crash.c --- a/xen/arch/x86/crash.c Mon Jun 06 10:09:16 2011 +0100 +++ b/xen/arch/x86/crash.c Mon Jun 06 14:06:31 2011 +0100 @@ -101,7 +101,15 @@ void machine_crash_shutdown(void) /* Crash shutdown any IOMMU functionality as the crashdump kernel is not * happy when booting if interrupt/dma remapping is still enabled */ - iommu_crash_shutdown(); + /* printk("DBG: About to attempt an iommu_crash_shutdown\n"); */ + /* iommu_crash_shutdown(); */ + /* printk("DBG: Supposedly done an iommu_crash_shutdown\n"); */ + + printk("DBG: About to suspend and disable IR\n"); + iommu_suspend(); + iommu_disable_IR(); + printk("DBG: Done suspending and disabling IR\n"); + info = kexec_crash_save_info(); info->xen_phys_start = xen_phys_start; diff -r 80448ec3e90b xen/drivers/passthrough/amd/iommu_init.c --- a/xen/drivers/passthrough/amd/iommu_init.c Mon Jun 06 10:09:16 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_init.c Mon Jun 06 14:06:31 2011 +0100 @@ -927,6 +927,8 @@ void amd_iommu_crash_shutdown(void) { struct amd_iommu *iommu; + printk("DBG: In amd_iommu_crash_shutdown\n"); + for_each_amd_iommu ( iommu ) disable_iommu(iommu); } diff -r 80448ec3e90b xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Mon Jun 06 10:09:16 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Mon Jun 06 14:06:31 2011 +0100 @@ -422,6 +422,7 @@ void iommu_suspend(void) void iommu_crash_shutdown(void) { const struct iommu_ops *ops = iommu_get_ops(); + printk("DBG: In iommu_crash_shutdown\n"); if ( ops && ops->crash_shutdown ) ops->crash_shutdown(); } diff -r 80448ec3e90b xen/drivers/passthrough/vtd/intremap.c --- a/xen/drivers/passthrough/vtd/intremap.c Mon Jun 06 10:09:16 2011 +0100 +++ b/xen/drivers/passthrough/vtd/intremap.c Mon Jun 06 14:06:31 2011 +0100 @@ -804,8 +804,13 @@ void disable_intremap(struct iommu *iomm u32 sts; unsigned long flags; + printk("DBG: in disable_intremap\n"); +n if ( !ecap_intr_remap(iommu->ecap) ) + { + printk("DBG: BAIL - failed ecap\n"); return; + } spin_lock_irqsave(&iommu->register_lock, flags); sts = dmar_readl(iommu->reg, DMAR_GSTS_REG); @@ -813,7 +818,7 @@ void disable_intremap(struct iommu *iomm goto out; dmar_writel(iommu->reg, DMAR_GCMD_REG, sts & (~DMA_GCMD_IRE)); - + printk("DBG: written to DMAR\n"); IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, dmar_readl, !(sts & DMA_GSTS_IRES), sts); out: @@ -885,8 +890,14 @@ void iommu_disable_IR(void) { struct acpi_drhd_unit *drhd; + printk("DBG: in iommu_disable_IR\n"); + if ( !iommu_supports_eim() ) + { + printk("DBG: BAIL - not supporting EIM\n"); return; + } + for_each_drhd_unit ( drhd ) disable_intremap(drhd->iommu); diff -r 80448ec3e90b xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Mon Jun 06 10:09:16 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Mon Jun 06 14:06:31 2011 +0100 @@ -2266,13 +2266,19 @@ static void vtd_crash_shutdown(void) struct acpi_drhd_unit *drhd; struct iommu *iommu; + printk("DBG: Starting vtd_crash_shutdown\n"); + if ( !iommu_enabled ) return; + printk("DBG: iommu_enabled was true\n"); + iommu_flush_all(); for_each_drhd_unit ( drhd ) { + printk("DBG: in for_each_drhd_unit\n"); + iommu = drhd->iommu; iommu_disable_translation(iommu); }