From: "Jan Beulich" Subject: Re: [PATCH] [RFC] iommu/crash: Interrupt remapping is also disabled on crash Date: Mon, 15 Apr 2013 16:19:20 +0100 Message-ID: <516C369802000078000CD4C1@nat28.tlf.novell.com> References: <4247933ebeaa4a00a942.1366038248@andrewcoop.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4247933ebeaa4a00a942.1366038248@andrewcoop.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Xiantao Zhang , SuraveeSuthikulpanit , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 15.04.13 at 17:04, Andrew Cooper wrote: > On the crash path in nmi_shootdown_cpus(), we shut down the IOMMU, then > disable the IOAPIC. > > On systems which support interrupt remapping, the variable iommu_intremap > remains set, meaning that disable_IO_APIC() issues interrupt remapping > invalidate requests. > > Pre Sandy-Bridge Intel systems and AMD systems appear to cope with this (in > so > far as "they seem to work fine"), but Sandy-Bridge systems certainly do not, > resulting in a panic() when the Queued Invalidation wait descriptor is not > executed, and subsequent deadlock because of reentering the kexec_crash() > path. > > This behaviour can be fixed by also indicating that interrupt remapping is > not > enabled after shutting down the IOMMU. > > Signed-off-by: Andrew Cooper > > -- > This patch is RFC because of several concerns. > > * Do we want to turn off more of the IOMMU feature variables as well? I > suspect so. Which ones in particular? I don't think the other ones really matter. Jan > * It looks to me as if this will also cause problems on the S3 path, as > iommu_disable_x2apic_IR() is called after iommu_shutdown(), yet the > variables cant change or iommu_resume() will leave things disabled. > > diff -r 98f80bf9e286 -r 4247933ebeaa xen/drivers/passthrough/iommu.c > --- a/xen/drivers/passthrough/iommu.c > +++ b/xen/drivers/passthrough/iommu.c > @@ -601,7 +601,7 @@ void iommu_crash_shutdown(void) > const struct iommu_ops *ops = iommu_get_ops(); > if ( iommu_enabled ) > ops->crash_shutdown(); > - iommu_enabled = 0; > + iommu_enabled = iommu_intremap = 0; > } > > int iommu_do_domctl(