From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPhQG-00012K-MX for qemu-devel@nongnu.org; Tue, 09 Apr 2013 18:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPhQF-0004ma-N4 for qemu-devel@nongnu.org; Tue, 09 Apr 2013 18:53:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPhQF-0004mC-Fl for qemu-devel@nongnu.org; Tue, 09 Apr 2013 18:53:51 -0400 Message-ID: <1365548028.16420.180.camel@bling.home> From: Alex Williamson Date: Tue, 09 Apr 2013 16:53:48 -0600 In-Reply-To: <32071.216.218.134.12.1365546804.squirrel@lavabit.com> References: <29682.93.184.66.138.1365510165.squirrel@lavabit.com> <1365527892.16420.153.camel@bling.home> <32071.216.218.134.12.1365546804.squirrel@lavabit.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] VFIO-VGA Issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: deniv@lavabit.com Cc: qemu-devel@nongnu.org On Tue, 2013-04-09 at 18:33 -0400, deniv@lavabit.com wrote: > Here's debug output from qemu, the last lines repeat indefinitely: > > vfio: vfio_initfn(0000:01:00.0) group 1 > vfio: region_add 0 - 7fffffff [0x7f605fe00000] > vfio: SKIPPING region_add fec00000 - fec00fff > vfio: SKIPPING region_add fed00000 - fed003ff > vfio: SKIPPING region_add fee00000 - feefffff > vfio: SKIPPING region_add fffe0000 - ffffffff > vfio: Device 0000:01:00.0 flags: 3, regions: 9, irgs: 3 > vfio: Device 0000:01:00.0 region 0: > vfio: size: 0x10000000, offset: 0x0, flags: 0x7 > vfio: Device 0000:01:00.0 region 1: > vfio: size: 0x0, offset: 0x10000000000, flags: 0x0 > vfio: Device 0000:01:00.0 region 2: > vfio: size: 0x40000, offset: 0x20000000000, flags: 0x7 > vfio: Device 0000:01:00.0 region 3: > vfio: size: 0x0, offset: 0x30000000000, flags: 0x0 > vfio: Device 0000:01:00.0 region 4: > vfio: size: 0x100, offset: 0x40000000000, flags: 0x3 > vfio: Device 0000:01:00.0 region 5: > vfio: size: 0x0, offset: 0x50000000000, flags: 0x0 > vfio: Device 0000:01:00.0 ROM: > vfio: size: 0x20000, offset: 0x60000000000, flags: 0x1 > vfio: Device 0000:01:00.0 config: > vfio: size: 0x1000, offset: 0x70000000000, flags: 0x3 > vfio: vfio_load_rom(0000:01:00.0) > vfio: vfio_bar_write(0000:01:00.0:BAR4+0x0, 0x4010, 4) > vfio: vfio_bar_read(0000:01:00.0:BAR4+0x4, 4) = 0xe000000c > vfio: Enabled ATI/AMD quirk 0x4010 for device 0000:01:00.0 > vfio: Enabled ATI/AMD quirk 0x3c3 for device 0000:01:00.0 ... > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 > vfio: vfio_vga_read(0x3c3, 1) = 0x0 This is a quirk that I haven't fully figured out yet. ATI/AMD cards use VGA register 0x3c3 to read upper byte of the address of the I/O port BAR, but sometimes it reads 0. Try the patch below to have it always return the virtual BAR address and let me know if it works. Thanks, Alex --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c @@ -1117,7 +1117,7 @@ static uint64_t vfio_ati_3c3_quirk_read(void *opaque, uint64_t data = vfio_vga_read(&vdev->vga.region[QEMU_PCI_VGA_IO_HI], addr + 0x3, size); - if (data == quirk->data) { + if (1 || data == quirk->data) { data = pci_get_byte(pdev->config + PCI_BASE_ADDRESS_4 + 1); DPRINTF("%s(0x3c3, 1) = 0x%"PRIx64"\n", __func__, data); }