From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: Graphics card pass-through working with two pass pci-initialization Date: Fri, 27 May 2011 13:09:46 +0200 Message-ID: <4DDF867A.9040700@siemens.com> References: <1306227933-4880-1-git-send-email-kraxel@redhat.com> <1306227933-4880-2-git-send-email-kraxel@redhat.com> <20110525023406.GG8517@valinux.co.jp> <20110525043353.GH8517@valinux.co.jp> <4DDCC7A5.60706@redhat.com> <4DDCF9ED.5050208@redhat.com> <4DDDDA8D.6080807@web.de> <4DDDF62C.2010603@redhat.com> <4DDF3768.5010002@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Gerd Hoffmann , seabios@seabios.org, kvm@vger.kernel.org, Alex Williamson To: =?ISO-8859-1?Q?Andr=E9_Weidemann?= Return-path: Received: from thoth.sbs.de ([192.35.17.2]:29624 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370Ab1E0LJy (ORCPT ); Fri, 27 May 2011 07:09:54 -0400 In-Reply-To: <4DDF3768.5010002@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On 2011-05-27 07:32, Andr=E9 Weidemann wrote: > Hi Gerd, > I managed to pass through a graphics card to a Windows7 VM using your > kraxel.q35 seabios branch > (http://www.kraxel.org/cgit/seabios/log/?h=3Dkraxel.q35). >=20 > Here is my setup: > Intel DX58SO > Core i7 920 > Radeon HD 6950 > Kernel 2.6.35.7 > qemu-kvm git pull from May 26th >=20 > The gfx card is working well on the desktop even with Aero turned on. > I tried various 3D Games which worked good (some were a bit choppy ;-= ) > though). Cool! >=20 > There were 2 games that made Windows crash. > What is the way to debug what went wrong here? Likely that's very hard to analyze, specifically as pass-through may also widen pre-existing race windows that may reveal real bugs in the drivers. However, you could start with tracing the host kvm events around the crash using ftrace / trace-cmd. With a lot of luck, the traces may contain some suspicious access patterns. >=20 > One thing that is not working is the pass-through of a second device,= a > sound card in my case. As soon as I pass 2 devices to the VM, Windows > does not boot anymore. > If I continue and remove the second device from the command line the = VM > does not boot anymore with the passed through gfx card. The graphics > card drivers crashes Windows, with the error message of not being abl= e > to reset the graphics card. A reboot of the host cures this problem. Does it make a difference when you preserve the function address by specifying -device pci-assign,host=3D03:00.0,addr=3DXX.0 and -device pci-assign,host=3D03:00.1,addr=3DXX.1 (where XX is some free slot numbe= r in the guest)? >=20 > These are the command lines I used to start the VM: >=20 > echo "1002 6719" > /sys/bus/pci/drivers/pci-stub/new_id > echo 0000:03:00.0 > /sys/bus/pci/devices/0000\:03\:00.0/driver/unbind > echo 0000:03:00.0 > /sys/bus/pci/drivers/pci-stub/bind > echo "1002 6719" > /sys/bus/pci/drivers/pci-stub/remove_id >=20 > qemu-system-x86_64 \ > -boot order=3Dcd -cpu host -vnc 192.168.3.1:0 -k de \ > -smp 2,cores=3D2,sockets=3D1 \ > -drive file=3D${IMAGE},if=3Dide,index=3D0,cache=3Dwriteback -m 4096 \ > -drive file=3D/dev/sda3,if=3Dide,index=3D1,cache=3Dnone \ -drive > file=3D/dev/sdb3,if=3Dide,index=3D2,cache=3Dnone \ > -drive file=3D/dev/cdrom,if=3Dide,index=3D3,media=3Dcdrom,cache=3Dnon= e \ > -device pci-assign,host=3D03:00.0 \ > -net nic,model=3De1000,macaddr=3DDE:AD:BE:EF:42:42 \ > -net tap,script=3D/usr/local/bin/qemu-ifup \ > -usb -usbdevice host:045e:00f9 \ > -monitor telnet:192.168.3.1:11111,server,nowait,nodelay >=20 > Thank you very much for your work. >=20 I've started to create a wiki page to save success stories like this on= e and collect the open issues, see http://www.linux-kvm.org/wiki/index.php?title=3DVGA_device_assignment. Everyone is welcome to fix, update, or otherwise enhance it. Jan --=20 Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux