All of lore.kernel.org
 help / color / mirror / Atom feed
* VFIO VGA test branches
@ 2013-05-03 22:56 ` Alex Williamson
  0 siblings, 0 replies; 38+ messages in thread
From: Alex Williamson @ 2013-05-03 22:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: kvm

Hi folks,

A number of people have been trying VFIO's VGA support, a few have even
been successful.  Resetting devices has been a problem and makes it
very, very difficult to really use VGA assignment effectively.  The code
in the branches below attempts to address this.  Discrete graphics
devices are typically on their own bus, which we can reset so we
theoretically get something pretty close to a power-on state for the GPU
on each run (or after each guest reset).  With this I'm able to get
multiple runs on my HD7850 with no need to reset the host.  Hopefully
this will also cleanup after any host uses of the device so we can
unload driver rather than blacklisting them.

If you've been playing with VFIO and VGA, please give the branches below
a shot and report successes and failures.  Note that this new reset is
only enable with the x-vga=on option, so should not do gratuitous bus
resets for other devices.  Thanks,

Alex

git://github.com/awilliam/linux-vfio.git vfio-vga-reset
git://github.com/awilliam/qemu-vfio.git vfio-vga-reset

PS - The above linux branch is v3.9 based which has a known kvm emulator
bug.  If you're on Intel and nothing happens, try:

sudo modprobe -r kvm_intel
sudo modprobe kvm_intel emulate_invalid_guest_state=0

This is required to execute the VGA BIOS on my HD7850.

If things still don't work, apply the following patch:

--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -40,7 +40,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
 
-/* #define DEBUG_VFIO */
+#define DEBUG_VFIO
 #ifdef DEBUG_VFIO
 #define DPRINTF(fmt, ...) \
     do { fprintf(stderr, "vfio: " fmt, ## __VA_ARGS__); } while (0)

And log the output (there will be lots).

Also, AMD/ATI and Nvidia are the only devices expected to have a
reasonable shot at working.  I'm seeing reports of success on AMD/ATI HD
5xxx, 6xxx, and 7xxx, as well as Nvidia Geforce 7-series, 8-series, 4xx
series, and 6xx series.  Older cards from those vendors probably aren't
very interesting to support (honestly I wouldn't care much about 7/8
series Nvidia or HD5xxx AMD, except I happen to have some for testing -
use emulated VGA if you don't care about performance).

Intel IGD graphics has numerous issues since it's partially incorporated
into the chipset.  Please don't bother to report IGD is broken unless
you're interested in fixing it.


^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [Qemu-devel] VFIO VGA test branches
@ 2013-05-10 21:31 Justin Gottula
  2013-05-10 21:38 ` Alex Williamson
  0 siblings, 1 reply; 38+ messages in thread
From: Justin Gottula @ 2013-05-10 21:31 UTC (permalink / raw)
  To: alex.williamson; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 563 bytes --]

Hi,

The kernel won't compile with CONFIG_HOTPLUG_PCI=m:

drivers/pci/hotplug/pci_hotplug_core.c:548:5: error: redefinition of
‘pci_hp_reset_slot’
 int pci_hp_reset_slot(struct hotplug_slot *hotplug, int probe)
     ^
In file included from drivers/pci/hotplug/pci_hotplug_core.c:41:0:
include/linux/pci_hotplug.h:141:19: note: previous definition of
‘pci_hp_reset_slot’ was here
 static inline int pci_hp_reset_slot(struct hotplug_slot *slot, int probe)
                   ^
make[3]: *** [drivers/pci/hotplug/pci_hotplug_core.o] Error 1


Justin

[-- Attachment #2: Type: text/html, Size: 703 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [Qemu-devel] VFIO VGA test branches
@ 2013-06-04  8:06 Michael Nelson
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Nelson @ 2013-06-04  8:06 UTC (permalink / raw)
  To: alex.williamson, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3107 bytes --]

Here is some more data for vfio-vga.

I have tried NVIDIA (MSI) GT610 and ATI (MSI) 7850 cards separately in
primary and secondary (to Cirrus) modes. The ATI can boot as primary in VGA
mode, but installing Catalyst causes the VM to reboot repeatedly on bootup.
The NVIDIA doesn't get past POST as primary. Neither card works as a
secondary with their drivers; they each complain that there aren't enough
resources available (code 12) in Windows device manager.

I have tried a few different KVM device settings, but feel like I am poking
in the dark at this point. What I am currently using is at the bottom of
the e-mail. I have URLs pointing to the various compressed logs since they
are fairly large. If there is any other data I can provide, please let me
know, I would really like to get this working :).

Machine:

Motherboard: Intel DQ67SW (BIOS: WQ6710H.86A.0052.2011.0520.1802 05/20/2011)
CPU: i5-2400
Kernel: 3.9 - current vfio-vga-reset branch
Qemu: 1.4.50 - current vfio-vga-reset branch
Guest: Windows Server 2008 R2 64-bit

Qemu has this patch added to vfio_ati_3c3_quirk_read():
+    if (1 || data == quirk->data.address_match) {

NVIDIA:

When it is primary, the NVIDIA card ends up with a QEMU fatal error within
a couple seconds of startup (the EIP seems to vary slightly). I have seen
this with 3 different NVidia cards (Quadro FX 580, GeForce 8800 GTS, and a
brand new GT610):

qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000000a0000

EAX=00009e48 EBX=00000000 ECX=0000b79d EDX=000003d4
ESI=000000e2 EDI=0000823a EBP=00004918 ESP=00008234
EIP=0009ffca EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
[…]

QEMU output when card is primary is at:
http://www.tnld.net/~mikenel/vga/qemu-nv-primary.txt.bz2

QEMU output when card is secondary is at:
http://www.tnld.net/~mikenel/vga/qemu-nv-secondary.txt.bz2

ATI:

The ATI card is able to boot Windows in VGA mode once I add "if (1)" to the
3C3 quirk in QEMU. Once I install the Catalyst drivers and reboot, the
machine reboots itself 10-15 seconds after the Windows boot loader
finishes. I am not sure if it's blue screening and I am not seeing it --
there is no output.

QEMU output when card is primary is at:
http://www.tnld.net/~mikenel/vga/qemu-ati-primary.txt.bz2

QEMU output when card is secondary is at:
http://www.tnld.net/~mikenel/vga/qemu-ati-secondary.txt.bz2

KVM command line:

~/qemu/usr/local/bin/qemu-system-x86_64 \
-nodefconfig -readconfig /root/q35-chipset.cfg \
-enable-kvm \
-M q35 \
-cpu host \
-L ~/seabios-out -L ~/qemu/usr/local/share/qemu \
-m 1024 \
-drive file=/dev/vgsys/vm.delete,if=virtio -boot order=cad,menu=on \
-vga cirrus \
-device vfio-pci,host=00:1d.0,addr=3.0,bus=pcie.0 \
-netdev tap,ifname=vm_rest_lan,id=hostnet0,vhost=on \
-device
virtio-net-pci,netdev=hostnet0,id=net0,mac=54:52:00:00:59:03,addr=05.00 \
-vnc 0.0.0.0:1 \
-device
vfio-pci,host=01:00.0,addr=0.0,bus=ich9-pcie-port-1,multifunction=on,x-vga=on
\
-device vfio-pci,host=01:00.1,addr=0.1,bus=ich9-pcie-port-1 \

Thanks,
-mike

[-- Attachment #2: Type: text/html, Size: 4248 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2013-06-04  8:07 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03 22:56 VFIO VGA test branches Alex Williamson
2013-05-03 22:56 ` [Qemu-devel] " Alex Williamson
2013-05-08 16:05 ` Alex Williamson
2013-05-08 16:05   ` [Qemu-devel] " Alex Williamson
2013-05-13 20:55 ` Knut Omang
2013-05-13 20:55   ` [Qemu-devel] " Knut Omang
2013-05-13 22:23   ` Alex Williamson
2013-05-13 22:23     ` [Qemu-devel] " Alex Williamson
2013-05-14  6:42     ` Knut Omang
2013-05-19 15:35     ` Knut Omang
2013-05-19 15:35       ` [Qemu-devel] " Knut Omang
2013-05-19 19:26       ` Maik Broemme
2013-05-19 19:26         ` [Qemu-devel] " Maik Broemme
2013-05-20  3:17         ` Alex Williamson
2013-05-20  3:17           ` Alex Williamson
2013-05-20 11:05           ` Maik Broemme
2013-05-20 11:05             ` Maik Broemme
2013-05-28  1:40             ` Maik Broemme
2013-05-28  3:21               ` Alex Williamson
2013-05-28 18:45               ` Maik Broemme
2013-05-28 22:28                 ` Alex Williamson
2013-05-29 15:27                   ` Maik Broemme
2013-05-29 16:16                     ` Maik Broemme
2013-05-29 16:16                       ` [Qemu-devel] " Maik Broemme
2013-05-29 17:07                       ` Alex Williamson
2013-05-20 21:08         ` Knut Omang
2013-05-20  4:15       ` Alex Williamson
2013-05-20  4:15         ` [Qemu-devel] " Alex Williamson
2013-05-20 21:11         ` Knut Omang
2013-05-20 21:11           ` [Qemu-devel] " Knut Omang
2013-05-28  5:33           ` Knut Omang
2013-05-28 13:53             ` Alex Williamson
2013-05-10 21:31 Justin Gottula
2013-05-10 21:38 ` Alex Williamson
2013-05-17  8:09   ` Justin Gottula
2013-05-20  3:44     ` Alex Williamson
2013-05-22  3:31       ` Justin Gottula
2013-06-04  8:06 Michael Nelson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.