From: Eric Houby Subject: Re: [TestDay] Xen crash on boot Date: Thu, 06 Feb 2014 09:44:20 -0700 Message-ID: <1391705060.2400.8.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: multipart/mixed; boundary="=-XCJRpyi4nADdM9oKwhZk" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WBS3t-000820-Sm for xen-devel@lists.xenproject.org; Thu, 06 Feb 2014 16:44:26 +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 --=-XCJRpyi4nADdM9oKwhZk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 applied the patch to RC3 and it seems to do the intended task of disabling IOMMU and allowing my GA-890FXA-UD5 to boot without a crash. (XEN) No southbridge IO-APIC found in IVRS table (XEN) AMD-Vi: Error initialization (XEN) I/O virtualisation disabled Additional boot log information is attached. Thanks, Eric --=-XCJRpyi4nADdM9oKwhZk Content-Disposition: attachment; filename="xen-boot-AMD-patch.txt" Content-Type: text/plain; name="xen-boot-AMD-patch.txt"; charset="UTF-8" Content-Transfer-Encoding: 7bit Xen 4.4-rc2 (XEN) Xen version 4.4-rc2 (root@houby.net) (gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)) debug=y Thu Feb 6 09:20:28 MST 2014 (XEN) Latest ChangeSet: Tue Jan 28 16:48:55 2014 +0100 git:a731bb2-dirty (XEN) Bootloader: GRUB 2.00 (XEN) Command line: placeholder dom0_mem=2048M,max:2048M dom0_max_vcpus=2 dom0_vcpus_pin loglvl=all guest_loglvl=all iommu=debug,verbose com1=38400,8n1,pci console=com1,vga (XEN) Video information: (XEN) VGA is text mode 80x25, font 8x16 (XEN) VBE/DDC methods: none; EDID transfer time: 0 seconds (XEN) EDID info not retrieved because no DDC retrieval method detected (XEN) Disc information: (XEN) Found 3 MBR signatures (XEN) Found 3 EDD information structures (XEN) Xen-e820 RAM map: (XEN) 0000000000000000 - 0000000000097000 (usable) (XEN) 000000000009f800 - 00000000000a0000 (reserved) (XEN) 00000000000f0000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 00000000afcf0000 (usable) (XEN) 00000000afcf0000 - 00000000afcf1000 (ACPI NVS) (XEN) 00000000afcf1000 - 00000000afd00000 (ACPI data) (XEN) 00000000afd00000 - 00000000afe00000 (reserved) (XEN) 00000000e0000000 - 00000000f0000000 (reserved) (XEN) 00000000fec00000 - 0000000100000000 (reserved) (XEN) 0000000100000000 - 0000000250000000 (usable) (XEN) ACPI: RSDP 000F6080, 0014 (r0 GBT ) (XEN) ACPI: RSDT AFCF1000, 0040 (r1 GBT GBTUACPI 42302E31 GBTU 1010101) (XEN) ACPI: FACP AFCF1080, 0074 (r1 GBT GBTUACPI 42302E31 GBTU 1010101) (XEN) ACPI: DSDT AFCF1100, 7BE1 (r1 GBT GBTUACPI 1000 MSFT 3000000) (XEN) ACPI: FACS AFCF0000, 0040 (XEN) ACPI: HPET AFCF8DC0, 0038 (r1 GBT GBTUACPI 42302E31 GBTU 98) (XEN) ACPI: MCFG AFCF8E00, 003C (r1 GBT GBTUACPI 42302E31 GBTU 1010101) (XEN) ACPI: MATS AFCF8E40, 0034 (r1 GBT 0 0) (XEN) ACPI: TAMG AFCF8EB0, 048A (r1 GBT GBT B0 5455312E BG 53450101) (XEN) ACPI: APIC AFCF8D00, 00BC (r1 GBT GBTUACPI 42302E31 GBTU 1010101) (XEN) ACPI: IVRS AFCF93B0, 00D8 (r1 AMD RD890S 202031 AMD 0) (XEN) System RAM: 8188MB (8385052kB) (XEN) No NUMA configuration found (XEN) Faking a node at 0000000000000000-0000000250000000 (XEN) Domain heap initialised (XEN) found SMP MP-table at 000f4670 (XEN) DMI 2.4 present. (XEN) Using APIC driver default (XEN) ACPI: PM-Timer IO Port: 0x808 (XEN) ACPI: SLEEP INFO: pm1x_cnt[804,0], pm1x_evt[800,0] (XEN) ACPI: wakeup_vec[afcf000c], vec_size[20] (XEN) ACPI: Local APIC address 0xfee00000 (XEN) ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) (XEN) Processor #0 0:10 APIC version 16 (XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled) (XEN) Processor #1 0:10 APIC version 16 (XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled) (XEN) Processor #2 0:10 APIC version 16 (XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x03] enabled) (XEN) Processor #3 0:10 APIC version 16 (XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x04] enabled) (XEN) Processor #4 0:10 APIC version 16 (XEN) ACPI: LAPIC (acpi_id[0x05] lapic_id[0x05] enabled) (XEN) Processor #5 0:10 APIC version 16 (XEN) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x06] disabled) (XEN) ACPI: LAPIC (acpi_id[0x07] lapic_id[0x07] disabled) (XEN) ACPI: LAPIC_NMI (acpi_id[0x00] dfl dfl lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x02] dfl dfl lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x03] dfl dfl lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x04] dfl dfl lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x05] dfl dfl lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x06] dfl dfl lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x07] dfl dfl lint[0x1]) (XEN) ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0]) (XEN) IOAPIC[0]: apic_id 2, version 33, address 0xfec00000, GSI 0-23 (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level) (XEN) ACPI: IRQ0 used by override. (XEN) ACPI: IRQ2 used by override. (XEN) ACPI: IRQ9 used by override. (XEN) Enabling APIC mode: Flat. Using 1 I/O APICs (XEN) ACPI: HPET id: 0x10b9a201 base: 0xfed00000 (XEN) ERST table was not found (XEN) Using ACPI (MADT) for SMP configuration information (XEN) SMP: Allowing 8 CPUs (2 hotplug CPUs) (XEN) IRQ limits: 24 GSI, 1144 MSI/MSI-X (XEN) Using scheduler: SMP Credit Scheduler (credit) (XEN) Detected 2812.953 MHz processor. (XEN) Initing memory sharing. (XEN) AMD Fam10h machine check reporting enabled (XEN) PCI: MCFG configuration 0: base e0000000 segment 0000 buses 00 - ff (XEN) PCI: MCFG area at e0000000 reserved in E820 (XEN) PCI: Using MCFG for segment 0000 bus 00-ff (XEN) AMD-Vi: Found MSI capability block at 0x54 (XEN) AMD-Vi: ACPI Table: (XEN) AMD-Vi: Signature IVRS (XEN) AMD-Vi: Length 0xd8 (XEN) AMD-Vi: Revision 0x1 (XEN) AMD-Vi: CheckSum 0x6f (XEN) AMD-Vi: OEM_Id AMD (XEN) AMD-Vi: OEM_Table_Id RD890S (XEN) AMD-Vi: OEM_Revision 0x202031 (XEN) AMD-Vi: Creator_Id AMD (XEN) AMD-Vi: Creator_Revision 0 (XEN) AMD-Vi: IVRS Block: type 0x10 flags 0x3e len 0xa8 id 0x2 (XEN) AMD-Vi: IVHD Device Entry: type 0x3 id 0 flags 0 (XEN) AMD-Vi: Dev_Id Range: 0 -> 0x2 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x10 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x3 id 0x100 flags 0 (XEN) AMD-Vi: Dev_Id Range: 0x100 -> 0x101 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x20 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x200 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x28 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x30 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x38 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x500 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x48 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x600 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x58 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x3 id 0x700 flags 0 (XEN) AMD-Vi: Dev_Id Range: 0x700 -> 0x701 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0x88 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x3 id 0x90 flags 0 (XEN) AMD-Vi: Dev_Id Range: 0x90 -> 0x92 (XEN) AMD-Vi: IVHD Device Entry: type 0x3 id 0x98 flags 0 (XEN) AMD-Vi: Dev_Id Range: 0x98 -> 0x9a (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0xa0 flags 0xd7 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0xa2 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0xa3 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0xa4 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0 id 0 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x43 id 0x800 flags 0 (XEN) AMD-Vi: Dev_Id Range: 0x800 -> 0x8ff alias 0xa4 (XEN) AMD-Vi: IVHD Device Entry: type 0x2 id 0xa5 flags 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x3 id 0xb0 flags 0 (XEN) AMD-Vi: Dev_Id Range: 0xb0 -> 0xb2 (XEN) AMD-Vi: IVHD Device Entry: type 0x48 id 0 flags 0xd7 (XEN) AMD-Vi: IVHD Special: 0000:00:14.0 variety 0x2 handle 0 (XEN) AMD-Vi: IVHD Device Entry: type 0x48 id 0 flags 0 (XEN) AMD-Vi: IVHD Special: 0000:00:00.1 variety 0x1 handle 0x2 (XEN) No southbridge IO-APIC found in IVRS table (XEN) AMD-Vi: Error initialization (XEN) I/O virtualisation disabled (XEN) ENABLING IO-APIC IRQs (XEN) -> Using new ACK method (XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1 (XEN) Platform timer is 14.318MHz HPET --=-XCJRpyi4nADdM9oKwhZk 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.xen.org http://lists.xen.org/xen-devel --=-XCJRpyi4nADdM9oKwhZk--