<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Mar 19, 2016 at 7:14 PM, Zir Blazer <span dir="ltr"><<a href="mailto:zir_blazer@hotmail.com" target="_blank">zir_blazer@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Fix: Added xen-users as CC.<br>
<span class="im"><br>
________________________________<br>
> From: nospam@kota.moe <br>
> To: <a href="mailto:xen-users@lists.xen.org">xen-users@lists.xen.org</a> <br>
> Date: Sat, 19 Mar 2016 07:30:40 +0000 <br>
> Subject: [Xen-users] Enabling AMD-Vi IOMMU panics Xen <br>
> <br>
</span><span class="im">> Note that the board "by default" doesn't support IOMMU, but since it <br>
> runs coreboot, I compiled in some code that initialises the IOMMU (so <br>
> if this bug seems to be caused by the BIOS, hopefully it can be fixed <br>
> fairly quickly). <br>
> <br>
</span><span class="im">> Using that command line, the IOMMU does not get enabled due to some <br>
> problems with the IVRS table (which seems to be generated by AMD's <br>
> closed-source AGESA), which you can see in "apic_verbosity=debug.log" <br>
> (attached). <br>
<br>
</span><div class=""><div class="h5">My answer will not really be very useful, but at least it may save you some time...<br>
<br>
If there are issues with the ACPI IVRS Table, the issues are Firmware side. I suppose that you could try contacting Coreboot developers and asking them if they can give you a hand fixing it for a AMD Jaguar platform.<br></div></div></blockquote><div><br></div><div>Curiously, cpuid reports the CPU as family 22 (16h) and model 48 (30h), making it a Puma (Mullins) chip.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
<br>
I don't specifically recall if Xen could, but the Linux Kernel itself could workaround a broken ACPI IVRS Table since you had a Boot Loader parameter that you could set to override the broken values of it with your own provided values, check here:<br>
<br>
<a href="http://mandrillapp.com/track/click/30489254/bbs.archlinux.org?p=eyJzIjoid2Q5U3N3VUFWeWJyVkFwUG1jclFoSUt2RTlzIiwidiI6MSwicCI6IntcInVcIjozMDQ4OTI1NCxcInZcIjoxLFwidXJsXCI6XCJodHRwczpcXFwvXFxcL2Jicy5hcmNobGludXgub3JnXFxcL3ZpZXd0b3BpYy5waHA_aWQ9MTYzMTAyXCIsXCJpZFwiOlwiYmY3OGIyZjZkN2Y3NDcwMWI1YWIzNGJkNjBhOWNmNDlcIixcInVybF9pZHNcIjpbXCIxM2I0ZGVmNTVlMzZhODA2M2ZkNzc0MDhiNmUwZWJmZmRhNTA2YWJmXCJdfSJ9" rel="noreferrer" target="_blank">https://bbs.archlinux.org/viewtopic.php?id=163102</a><br>
<br>
Basically, for the Linux Kernel, you could use something like iommu=1 ivrs_ioapic[6]=00:14.0 as boot parameter or so and get a working IOMMU with a broken BIOS ACPI IVRS Table. However, this only works if you were going to use the IOMMU for QEMU-KVM-VFIO Passthrough, not Xen, but I think it could also do something similar to that. The problem is that I don't know what the Xen parameters are (If they exist), or how you are supposed to get the correct values to get it working.<br>
If it is not possible to do something like that in Xen, your only choice is fix it Firmware-side.                                         </div></div></blockquote></div><br></div><div class="gmail_extra">To partially answer your question, Xen indeed has the ivrs_ioapic and ivrs_hpet params too: <a href="http://mandrillapp.com/track/click/30489254/xenbits.xen.org?p=eyJzIjoiTUx3Skw1dXlOMVh2RTZIT3NOaHRtdDFuTmNnIiwidiI6MSwicCI6IntcInVcIjozMDQ4OTI1NCxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwveGVuYml0cy54ZW4ub3JnXFxcL2dpdHdlYlxcXC8_cD14ZW4uZ2l0O2E9YmxvYjtmPXhlblxcXC9kcml2ZXJzXFxcL3Bhc3N0aHJvdWdoXFxcL2FtZFxcXC9pb21tdV9hY3BpLmM7aD03OWMxZjhjZDNlN2QwMmU5NmVhOTE4M2I2YTcyNmI4ODU1MDBhMDVkO2hiPUhFQUQjbDYzOFwiLFwiaWRcIjpcImJmNzhiMmY2ZDdmNzQ3MDFiNWFiMzRiZDYwYTljZjQ5XCIsXCJ1cmxfaWRzXCI6W1wiYjAwZmZhY2Q4ZDUxNWQ1MzdhYmVkYTg5ZDBhMTUzYjA3YjVhYTFlMVwiXX0ifQ">http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/drivers/passthrough/amd/iommu_acpi.c;h=79c1f8cd3e7d02e96ea9183b6a726b885500a05d;hb=HEAD#l638</a><br><br></div><div class="gmail_extra">That said, I have no idea how to find the device IDs for the IOAPICs.<br></div><div class="gmail_extra">According to <a href="http://mandrillapp.com/track/click/30489254/github.com?p=eyJzIjoiX2JiWjV5UGFXTEdvRG9ObDhLQS1nOTVOMlpjIiwidiI6MSwicCI6IntcInVcIjozMDQ4OTI1NCxcInZcIjoxLFwidXJsXCI6XCJodHRwczpcXFwvXFxcL2dpdGh1Yi5jb21cXFwvdG9ydmFsZHNcXFwvbGludXhcXFwvY29tbWl0XFxcL2MyZmY1Y2Y1Mjk0YmNiZDdmYTUwZjdkODYwZTkwYTY2ZGI3ZTUwNTlcIixcImlkXCI6XCJiZjc4YjJmNmQ3Zjc0NzAxYjVhYjM0YmQ2MGE5Y2Y0OVwiLFwidXJsX2lkc1wiOltcIjg3MWYyZjFmYWU4MzQ2ZTQzMjM0MDNlZjU4ZWUxNGExOWUxZDlhYjlcIl19In0">https://github.com/torvalds/linux/commit/c2ff5cf5294bcbd7fa50f7d860e90a66db7e5059</a> (and <a href="http://mandrillapp.com/track/click/30489254/xenbits.xen.org?p=eyJzIjoiSVNOelo3UWhWdE10SGhBeWtEeTFMYnRpWmlFIiwidiI6MSwicCI6IntcInVcIjozMDQ4OTI1NCxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwveGVuYml0cy54ZW4ub3JnXFxcL2dpdHdlYlxcXC8_cD14ZW4uZ2l0O2E9Y29tbWl0O2g9MDZiYmNhZjQ4ZDA5YzE4YTQxYzQ4Mjg2Njk0MWRkZDVkMjg0NmI0NFwiLFwiaWRcIjpcImJmNzhiMmY2ZDdmNzQ3MDFiNWFiMzRiZDYwYTljZjQ5XCIsXCJ1cmxfaWRzXCI6W1wiYjAwZmZhY2Q4ZDUxNWQ1MzdhYmVkYTg5ZDBhMTUzYjA3YjVhYTFlMVwiXX0ifQ">http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=06bbcaf48d09c18a41c482866941ddd5d2846b44</a> for Xen), the southboard IOAPIC is always at 00:14.0 (I'm also curious of where this information was sourced from - it doesn't seem to be in either the IOMMU spec or BKDG), though I don't know whether it's IOAPIC #4 or #5.<br><br></div><div class="gmail_extra">According to <a href="http://mandrillapp.com/track/click/30489254/ubuntuforums.org?p=eyJzIjoiZTRMX0FtMHJYTjRUN2lKLXBtMlFwX1NsYmUwIiwidiI6MSwicCI6IntcInVcIjozMDQ4OTI1NCxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvdWJ1bnR1Zm9ydW1zLm9yZ1xcXC9zaG93dGhyZWFkLnBocD90PTIyNTQ2NzdcIixcImlkXCI6XCJiZjc4YjJmNmQ3Zjc0NzAxYjVhYjM0YmQ2MGE5Y2Y0OVwiLFwidXJsX2lkc1wiOltcIjk5YTBiYzNkYzQ5ZWY0NGRlMzJiNjZkZmQ5YmNkMjI1Y2RhOGRlODJcIl19In0">http://ubuntuforums.org/showthread.php?t=2254677</a>, their (presumably northbridge) IOAPIC was at 00:00.1, though they don't mention how they determined that either.<br></div><div class="gmail_extra">00:00.1 doesn't show up under a lspci either, so I'm unsure if I have that on my board, though AMD's IOMMU spec (<a href="http://mandrillapp.com/track/click/30489254/support.amd.com?p=eyJzIjoiODlvWXVYLU9abVcwUmVRcURpbkRKb0lBSmxjIiwidiI6MSwicCI6IntcInVcIjozMDQ4OTI1NCxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvc3VwcG9ydC5hbWQuY29tXFxcL1RlY2hEb2NzXFxcLzQ4ODgyX0lPTU1VLnBkZlwiLFwiaWRcIjpcImJmNzhiMmY2ZDdmNzQ3MDFiNWFiMzRiZDYwYTljZjQ5XCIsXCJ1cmxfaWRzXCI6W1wiZjgzMzYwMjAxY2Y5MGE2NDAyNGY0MGE4MTRmMGY5MDFlYTE0NDUxZlwiXX0ifQ">http://support.amd.com/TechDocs/48882_IOMMU.pdf</a> page 260) claims they aren't normally enumerable.<br><br></div><div class="gmail_extra">The lspci output on the board is as follows:<br><font size="1"><span style="font-family:monospace,monospace">00:00.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1566]<br>00:00.2 IOMMU [0806]: Advanced Micro Devices, Inc. [AMD] Device [1022:1567]<br>00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:156b]<br>00:02.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 [1022:1439]<br>00:02.3 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 [1022:1439]<br>00:02.4 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 [1022:1439]<br>00:08.0 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Device [1022:1537]<br>00:10.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller [1022:7814] (rev 11)<br>00:11.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [IDE mode] [1022:7800] (rev 40)<br>00:13.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller [1022:7808] (rev 39)<br>00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:780b] (rev 42)<br>        Subsystem: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:780b]<br>        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+<br>        Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-<br>        Kernel driver in use: piix4_smbus<br>        Kernel modules: i2c_piix4<br>00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:780e] (rev 11)<br>00:14.7 SD Host controller [0805]: Advanced Micro Devices, Inc. [AMD] FCH SD Flash Controller [1022:7813] (rev 01)<br>00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1580]<br>00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1581]<br>00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1582]<br>00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1583]<br>00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1584]<br>00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1585]<br>01:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:157b] (rev 03)<br>02:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:157b] (rev 03)<br>03:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:157b] (rev 03)</span></font><br><br></div><div class="gmail_extra">If 00:14.0 is indeed one of the IOAPIC devices, I'm also curious on how it relates to SMBus.<br><br></div><div class="gmail_extra">I'm CC'ing coreboot and also Joerg Roedel, the author of the linux commit, to see if they can help out.<br><br></div><div class="gmail_extra">If we work out a process to properly identify the IOAPIC number to device ID mappings, I'll try to properly document it somewhere and make patches for Xen/coreboot/linux to use it.<br></div></div>

<img src="http://mandrillapp.com/track/open.php?u=30489254&id=bf78b2f6d7f74701b5ab34bd60a9cf49" height="1" width="1">