From: Eric Houby Subject: Re: [TestDay] Xen crash on boot Date: Sat, 25 Jan 2014 18:10:58 -0700 Message-ID: <1390698658.2613.20.camel@astar.houby.net> References: <1390244796.2322.6.camel@astar.houby.net> <52DE4CA1020000780011547D@nat28.tlf.novell.com> <1390297542.20516.90.camel@kazak.uk.xensource.com> <000001cf1695$0c960450$25c20cf0$@yahoo.com> <52DF8FB90200007800115AEC@nat28.tlf.novell.com> <1390455621.2415.56.camel@astar.houby.net> <52E1083602000078001161D5@nat28.tlf.novell.com> <1390524450.2281.12.camel@astar.houby.net> <52E233A60200007800116776@nat28.tlf.novell.com> <52E277920200007800116A70@nat28.tlf.novell.com> Reply-To: ehouby@yahoo.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W7EFb-0008BW-Sq for xen-devel@lists.xenproject.org; Sun, 26 Jan 2014 01:11:14 +0000 In-Reply-To: <52E277920200007800116A70@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Ian Campbell , suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-01-24 at 13:24 +0000, Jan Beulich wrote: > >>> On 24.01.14 at 09:34, "Jan Beulich" wrote: > >>>> On 24.01.14 at 01:47, Eric Houby wrote: > >> On Thu, 2014-01-23 at 11:16 +0000, Jan Beulich wrote: > >>> If > >>> the kernel responds to that mentioned firmware bug by forcing > >>> interrupt remapping off, maybe we would have to do the same... > >> > >> That would be better than xen failing to boot. > > > > But you realize that, following precedents elsewhere in the > > IOMMU code, we would disable the IOMMU as a whole rather > > than just interrupt remapping. > > > > But yes, looking at the Linux side code, I guess we need to do > > so. Would be nice if you could confirm that the system comes up > > fine (and hopefully without IOMMU faults) with > > "iommu=no-intremap,debug" as well as with "iommu=off". > > Here's a patch attempting to do just that. Please give this a try > without any IOMMU-related override options. > > Jan > > AMD IOMMU: fail if there is no southbridge IO-APIC > > ... but interrupt remapping is requested (with per-device remapping > tables). Without it, the timer interrupt is usually not working. > > Inspired by Linux'es "iommu/amd: Work around wrong IOAPIC device-id in > IVRS table" (commit c2ff5cf5294bcbd7fa50f7d860e90a66db7e5059) by Joerg > Roedel . > > Reported-by: Eric Houby > Signed-off-by: Jan Beulich > > --- a/xen/drivers/passthrough/amd/iommu_acpi.c > +++ b/xen/drivers/passthrough/amd/iommu_acpi.c > @@ -984,6 +984,7 @@ static int __init parse_ivrs_table(struc > const struct acpi_ivrs_header *ivrs_block; > unsigned long length; > unsigned int apic; > + bool_t sb_ioapic = !iommu_intremap; > int error = 0; > > BUG_ON(!table); > @@ -1017,8 +1018,15 @@ static int __init parse_ivrs_table(struc > /* Each IO-APIC must have been mentioned in the table. */ > for ( apic = 0; !error && iommu_intremap && apic < nr_ioapics; ++apic ) > { > - if ( !nr_ioapic_entries[apic] || > - ioapic_sbdf[IO_APIC_ID(apic)].pin_2_idx ) > + if ( !nr_ioapic_entries[apic] ) > + continue; > + > + if ( !ioapic_sbdf[IO_APIC_ID(apic)].seg && > + /* SB IO-APIC is always on this device in AMD systems. */ > + ioapic_sbdf[IO_APIC_ID(apic)].bdf == PCI_BDF(0, 0x14, 0) ) > + sb_ioapic = 1; > + > + if ( ioapic_sbdf[IO_APIC_ID(apic)].pin_2_idx ) > continue; > > if ( !test_bit(IO_APIC_ID(apic), ioapic_cmdline) ) > @@ -1041,6 +1049,14 @@ static int __init parse_ivrs_table(struc > } > } > > + if ( !error && !sb_ioapic ) > + { > + if ( amd_iommu_perdev_intremap ) > + error = -ENXIO; > + printk("%sNo southbridge IO-APIC found in IVRS table\n", > + amd_iommu_perdev_intremap ? XENLOG_ERR : XENLOG_WARNING); > + } > + > return error; > } > > > > Jan, I am currently using the 4.4.0-RC2 RPMs that are available from the Test Day information site. With my limited skill set and time constraints, it will take me a while to set up for testing the patch. I will let you know how it goes. Thanks, Eric