From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 7 of 7] KEXEC: correctly revert x2apic state when kexecing [Reformatted, v2] Date: Wed, 15 Jun 2011 17:03:59 +0100 Message-ID: <4DF8D7EF.8050208@citrix.com> References: <4DF896CC0200007800047532@nat28.tlf.novell.com> <4DF87DF1.4000000@citrix.com> <4DF8A218020000780004756C@nat28.tlf.novell.com> <4DF88B1B.6090503@citrix.com> <4DF8A942020000780004758A@nat28.tlf.novell.com> <4DF89EB2.3000609@citrix.com> <4DF8D2A7.2070405@citrix.com> <1308153010.17937.212.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080705030900010603090909" Return-path: In-Reply-To: <1308153010.17937.212.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: Jan, "xen-devel@lists.xensource.com" , Beulich List-Id: xen-devel@lists.xenproject.org --------------080705030900010603090909 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On 15/06/11 16:50, Ian Campbell wrote: > On Wed, 2011-06-15 at 16:41 +0100, Andrew Cooper wrote: >> Tweaked the patch to prevent IOMMU_WAIT_OP panicking on the kexec path. >> Unfortunately, this has to rely on the kexecing variable. >> >> As with the other hacks in this patch, I cant see a better way of >> solving the problem. >> > >> @@ -99,8 +100,9 @@ do { >> if ( cond ) \ >> break; \ >> if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) \ >> - panic("%s:%d:%s: DMAR hardware is malfunctional\n", \ >> - __FILE__, __LINE__, __func__); \ >> + if ( !kexecing ) \ >> + panic("%s:%d:%s: DMAR hardware is malfunctional\n",\ >> + __FILE__, __LINE__, __func__); \ >> cpu_relax(); \ >> } \ >> } while (0) > I think you want an "else break" here to cause it to struggle onwards > rather than the infinite loop you get otherwise. > > Ian Yep - Fixed and reformatted against staging again. -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com --------------080705030900010603090909 Content-Type: text/x-patch; name="kexec-prevent-panic.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kexec-prevent-panic.patch" 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) --------------080705030900010603090909 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------080705030900010603090909--