
mythtv at hocken
Jun 19, 2012, 1:17 AM
Post #4 of 5
(1012 views)
Permalink
|
|
Re: PCI passthrough to PV guest - domU kernel panic when using iommu=soft
[In reply to]
|
|
2012/6/15 Christian <mythtv [at] hocken> > > > 2012/6/10 Christian <mythtv [at] hocken> > >> Hi everybody, >> >> I followed the tutorial at http://wiki.xen.org/wiki/Xen_PCI_Passthrough to >> passthrough a PCI-Device (DVB-C Tuner Card [saa7146 device]) to a pv xen >> guest. My system ist based on an Asus M4N78 Pro motherboard + an AMD X4 >> 600e processor and thus does not come with native IOMMU support. Both, dom0 >> and domU are based on Ubuntu 12.04 with Xen 4.1.2 from official >> repositories. >> I set up a pv domU guest system that works flawlessly. However, when I >> try to boot the guest with iommu=soft as a kernel-parameter the domU >> crashes with a kernel panic. The kernel panic does not seem to be related >> to an assigned PCI device, since the guest crashes even if no PCI device is >> passed. >> >> Here's an excerpt of the guest system's boot log: >> (early) [ 0.000000] Kernel command line: root=/dev/xvda1 iommu=soft >> debug loglevel=10 earlyprintk=xenboot console=hvc0 ro xencons=tty >> (early) [ 0.000000] PID hash table entries: 2048 (order: 2, 16384 >> bytes) >> (early) [ 0.000000] Xen-SWIOTLB: Lowering to 32MB >> (early) [ 0.000000] Xen-SWIOTLB: Lowering to 16MB >> (early) [ 0.000000] Xen-SWIOTLB: Lowering to 8MB >> (early) [ 0.000000] Kernel panic - not syncing: Failed to get >> contiguous memory for DMA from Xen! >> (early) [ 0.000000] You either: don't have the permissions, do not >> have enough free memory under 4GB, or the hypervisor memoryis too >> fragmented! (rc:-12) >> (early) [ 0.000000] Pid: 0, comm: swapper Not tainted 3.2.0-24-generic >> #39-Ubuntu >> (early) [ 0.000000] Call Trace: >> (early) [ 0.000000] [<ffffffff8164434a>] panic+0x91/0x1a4 >> (early) [ 0.000000] [<ffffffff81d2ecd4>] xen_swiotlb_init+0x185/0x1e1 >> (early) [ 0.000000] [<ffffffff81d0e596>] ? >> pci_swiotlb_late_init+0x29/0x29 >> (early) [ 0.000000] [<ffffffff81d0e56d>] ? >> pci_swiotlb_detect_4gb+0x2c/0x2c >> (early) [ 0.000000] [<ffffffff81669cac>] ? bad_to_user+0x7f6/0x7f6 >> (early) [ 0.000000] [<ffffffff81d00d78>] >> pci_xen_swiotlb_init+0x17/0x29 >> (early) [ 0.000000] [<ffffffff81d03b4e>] pci_iommu_alloc+0x57/0x6f >> (early) [ 0.000000] [<ffffffff81d10fa3>] mem_init+0x19/0xec >> (early) [ 0.000000] [<ffffffff81cfba2d>] start_kernel+0x1da/0x3c7 >> (early) [ 0.000000] [<ffffffff81cfb388>] >> x86_64_start_reservations+0x132/0x136 >> (early) [ 0.000000] [<ffffffff81cfef06>] xen_start_kernel+0x5bc/0x5c3 >> >> >> >> Some more information about my configuration: >> >> Dom0 (ubuntu 12.04, 3.2.0-24-generic #39-Ubuntu): >> * Kernel parameter pci=resource_alignment=01:05.0 set. >> >> * xen-pciback is loaded as module with options in >> /etc/modprobe.d/xen-pciback.conf: >> # hide (0000:01:05.0) >> options xen-pciback passthrough=1 >> options xen-pciback permissive >> options xen-pciback hide=(0000:01:05.0) >> >> * saa7146 driver is blacklisted: >> /etc/modprobe.d/blacklist-saa7146.conf: >> blacklist saa7146 >> >> * xm pci-list-assignable-devices lists mentioned PCI device >> >> * guest's xen.cfg looks as follows: >> kernel = "/usr/local/xendomains/precise_test/kernel.img" >> ramdisk = "/usr/local/xendomains/precise_test/initrd.img" >> memory = 512 >> vcpus = 1 >> name = "precisetest" >> vif = [ 'mac=00:16:00:00:42:23' ] >> disk = [ 'file:/usr/local/xendomains/precise_test/xvda.img,xvda,w' ] >> root = "/dev/xvda1" >> pci = [ '01:05.0' ] >> extra = "iommu=soft debug loglevel=10 earlyprintk=xenboot console=hvc0 ro >> xencons=tty" >> >> >> DomU ubuntu 12.04, 3.2.0-24-generic #39-Ubuntu): >> * xen-pcifront is loaded as module >> >> * System starts when iommu=soft is not set and lspci shows passed device. >> However, the device is not usable >> >> At this point I got stuck and have no clue how to further debug my setup. >> Please let me know, if I missed something. >> >> Logfiles: >> Kernel config (same kernel is used on dom0 and domU): >> http://pastebin.com/6qf85KjJ >> Dom0 dmesg: http://pastebin.com/FAXk8eF9 >> Dom0 xm dmesg: http://pastebin.com/MXhvWkPF >> Dom0 xend.log: http://pastebin.com/Ma0Xy4BA >> Dom0 domain-builder-ng.log: http://pastebin.com/R5mmPBZi >> Dom0 xen-hotplug.log; http://pastebin.com/haKwKnnD >> Dom0 xend-debug.log: http://pastebin.com/bU5X2hg4 >> DomU boot.log: http://pastebin.com/R2dYGpp1 >> >> Thank you very much for your support >> >> best regards, >> Christian >> > > Did no one of you encounter this problem before? I cannot imagine that my > setup is that special. > > As far as I understand, the error handling has been introduced with this patch https://lkml.org/lkml/2011/8/24/432 According to Konrad Rzeszutek, two situations might be responsible for the kernel panic: "We can fail seting up Xen-SWIOTLB if: - The host does not have enough contiguous DMA32 memory available (can happen on a machine that has fragmented memory from starting, stopping many guests). - Not enough low memory (almost never happens)." Is there a way to check which condition is matched? The panic already occurs when I've just started dom0 Thanks for your support
|