From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Wolf Subject: Re: vga passthrough // vfio // qemu bridge Date: Fri, 19 Jul 2013 21:14:12 +0200 Message-ID: <51E99004.5000802@adiumentum.com> References: <51E53E28.8010008@adiumentum.com> <1373984743.8441.355.camel@ul30vt.home> <51E625FF.6070109@adiumentum.com> <51E917F4.9030800@adiumentum.com> <1374243680.13708.218.camel@ul30vt.home> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Alex Williamson Return-path: Received: from mail.andre-duewel.de ([178.63.55.43]:52187 "EHLO mail.andre-duewel.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299Ab3GSTOU (ORCPT ); Fri, 19 Jul 2013 15:14:20 -0400 In-Reply-To: <1374243680.13708.218.camel@ul30vt.home> Sender: kvm-owner@vger.kernel.org List-ID: Yes, thats my error, sorry for causing extra work... i compiled qemu 1.5.1 now with your patchset. but now i qemu shuts down with this error when windows tries to start: qemu-system-x86_64: hw/usb/core.c:413: usb_handle_packet: Zusicherung =C2=BBp->ep->type !=3D 3 || (dev->flags & (1 << USB_DEV_FLAG_IS_HOST))=C2= =AB nicht erf=C3=BCllt. Am 19.07.2013 16:21, schrieb Alex Williamson: > On Fri, 2013-07-19 at 12:41 +0200, Martin Wolf wrote: >> I just started over because of several small glitches that came from >> constantly >> reinstalling qemu. >> >> im still using saucy 13.10 alpha for the tests with a modified ubunt= u >> kernel (with >> alex patch) and since i found out that the patches of alex are now >> pulled into >> qemu 1.6 i chose to use qemu git. > Correction, the VGA quirks are pulled in, but the bus reset stuff is > not. > >> after some perparation (apt-get build-depends qemu) i configured qem= u >> with (./configure --target-list=3Dx86_64-softmmu) and installed it t= o >> /usr/local. >> >> when i wanted to start qemu-system-x64 the screen connected to the >> 7870 still did not start (the usb devices were instantly pulled so >> something must >> have happened). then i tried the seabios supplied by ubuntu(1.7.3), = then >> the screen went on , but after the driver installation i got a >> bluescreen connected >> to the ati driver again. > > QEMU hasn't updated the BIOS yet, so the VGA route initialization is > still missing. Updating seabios fixed that, but you're still missing > the bus reset parts of the vfio-vga-reset qemu branch, so the card ma= y > be in a bad state when the drivers load. Thanks, > > Alex > >> Am 17.07.2013 07:05, schrieb Martin Wolf: >>> thank you for the quick response alex, >>> >>> but i still need your help ;) >>> i cloned both git trees >>> (http://lists.gnu.org/archive/html/qemu-devel/2013-05/msg00432.html= ) >>> that was the easy part for me (it boots like a charm ...) ... then = i >>> built the qemu tree and found out >>> that it is just 1.4.50 and something was missing >>> so qemu would not start up ... >>> >>> would you be so kind alex and supply me with >>> the patches you meant yesterday i would need for qemu? >>> >>> ty in advance >>> >>> >>> >>> Am 16.07.2013 16:25, schrieb Alex Williamson: >>>> On Tue, 2013-07-16 at 14:35 +0200, Martin Wolf wrote: >>>>> Early 2012 i tested the old vga passthrough capabilities of KVM a= nd was >>>>> partly successful. >>>>> now with the new vfio driver i tried again according to alex's hi= nts and >>>>> this guide: >>>>> https://bbs.archlinux.org/viewtopic.php?id=3D162768 >>>>> >>>>> since im primarily using ubuntu i used the daily build of saucy. >>>>> it ships qemu 1.5 and seabios 1.7.3 so the requirements are met. >>>>> >>>>> according to the guide i prepared the vga card (amd 7870) >>>>> >>>>> [ 0.000000] Command line: BOOT_IMAGE=3D/boot/vmlinuz-3.10.0-2-= generic >>>>> root=3DUUID=3D26fed560-a972-499d-ab14-7fec6439fd3d ro intel_iommu= =3Don >>>>> pci-stub.ids=3D1002:6818,1002:aab0 quiet splash vt.handoff=3D7 >>>>> [ 0.000000] Kernel command line: >>>>> BOOT_IMAGE=3D/boot/vmlinuz-3.10.0-2-generic >>>>> root=3DUUID=3D26fed560-a972-499d-ab14-7fec6439fd3d ro intel_iommu= =3Don >>>>> pci-stub.ids=3D1002:6818,1002:aab0 quiet splash vt.handoff=3D7 >>>>> [ 0.569977] pci-stub: add 1002:6818 sub=3DFFFFFFFF:FFFFFFFF >>>>> cls=3D00000000/00000000 >>>>> [ 0.569987] pci-stub 0000:01:00.0: claimed by stub >>>>> [ 0.569994] pci-stub: add 1002:AAB0 sub=3DFFFFFFFF:FFFFFFFF >>>>> cls=3D00000000/00000000 >>>>> [ 0.569998] pci-stub 0000:01:00.1: claimed by stub >>>>> >>>>> then did this just to be sure: >>>>> echo "options vfio_iommu_type1 allow_unsafe_interrupts=3D1" > >>>>> /etc/modprobe.d/vfio_iommu_type1.conf >>>>> (or was that wrong?) >>>>> im using a z87 haswell mainboard >>>> Hopefully not needed, only use this option if you need to. vfio w= ill >>>> print an error to dmesg and qemu will fail to start if you need it= =2E >>>> >>>>> after that i binded the two devices to vfio-pci with: >>>>> vfio-bind 0000:01:00.0 0000:01:00.1 (the script in the guide) >>>>> >>>>> afterwards i was able to start the kvm with >>>>> qemu-system-x86_64 -enable-kvm -M q35 -m 8192 -cpu host \ >>>>> -smp 8,sockets=3D1,cores=3D4,threads=3D8 \ >>>>> -bios /usr/share/qemu/bios.bin -vga none \ >>>>> -device >>>>> ioh3420,bus=3Dpcie.0,addr=3D1c.0,multifunction=3Don,port=3D1,chas= sis=3D1,id=3Droot.1 \ >>>>> -device >>>>> vfio-pci,host=3D01:00.0,bus=3Droot.1,addr=3D00.0,multifunction=3D= on,x-vga=3Don \ >>>>> -device vfio-pci,host=3D01:00.1,bus=3Droot.1,addr=3D00.1 \ >>>>> -device ahci,bus=3Dpcie.0,id=3Dahci \ >>>>> -drive file=3D/home/martin/windows.img,if=3Dnone,id=3Ddisk,format= =3Draw -device >>>>> virtio-blk-pci,drive=3Ddisk \ >>>>> -drive file=3D/home/martin/X17-59885.iso,id=3Disocd -device >>>>> ide-cd,bus=3Dahci.0,drive=3Disocd \ >>>>> -net nic,model=3Dvirtio \ >>>>> -net user \ >>>>> -usb -usbdevice host:1532:000c \ >>>>> -drive file=3D/home/martin/Downloads/virtio-win-0.1-59.iso,id=3Di= socd1 >>>>> -device ide-cd,bus=3Dahci.1,drive=3Disocd1 >>>>> >>>>> to my surprise i instantly got the windows installation running >>>>> installed the virtio drivers for nic and storage >>>>> and had 15 mins later a working win7 installation. >>>>> now i installed the amd driver (13.4) and rebooted. >>>>> i got a bluescreen. similar to my old expiriences so i thought do= a >>>>> clean host reboot and try again. >>>>> but still the same. so i tried to load the bios.rom for the card = (found >>>>> it on techpowerup) again no luck. >>>>> maybe someone knows a hint? >>>> I think most of the folks using the guide you reference are using = my >>>> vfio-vga-reset branches of qemu & kernel (or patches extracted fro= m >>>> them). These add an important step for reproducibility, by being = able >>>> to reset the bus for the graphics card, giving us a way to reset t= he >>>> device. The other thing in the qemu branch are improved quirks. = I've >>>> just posted these to qemu-devel and plan to get them pulled for 1.= 6. >>>> Note that for ATI/AMD cards, a critical quirks is intercepting the= byte >>>> at I/O port address 0x3c3. Without this, the VGA BIOS can't boots= trap >>>> itself. The vfio-vga-reset branch has a conditional replacement o= f >>>> this, which doesn't seem to work for everyone. I believe the vers= ion I >>>> posted to qemu-devel yesterday is a better implementation of that = quirk. >>>> >>>>> ------- >>>>> >>>>> about qemu bridge >>>>> i tried to set up a bridge with the config but qemu always told m= e that >>>>> qemu-bridge-helper is not present. >>>>> all i found out that it propably got removed from the package bec= ause of >>>>> the lack of control over the tap >>>>> devices. >>>>> now my question how can i still bridge the vm into my network wit= hout >>>>> that helper? >>>> I don't know what qemu-bridge-helper is/was, but you're probably b= etter >>>> off asking bridge questions in a separate thread instead of buried= here. >>>> Thanks, >>>> >>>> Alex >>>> > > --=20 Adiumentum GmbH Gf. Martin Wolf Banderbacherstra=C3=9Fe 76 90513 Zirndorf 0911 / 9601470 mwolf@adiumentum.com