Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Aug 2008 01:54:36 +0200
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        qemu-devel@nongnu.org
Cc:        freebsd-emulation@FreeBSD.org
Subject:   qemu svn r5075 on FreeBSD - some observations (usb, vmwarevga, screen updates, monitor...)
Message-ID:  <20080823235435.GA5405@saturn.kn-bremen.de>

next in thread | raw e-mail | index | archive | help
Hi!

 I just played with qemu svn again on FreeBSD (experimental port
update here:
	http://people.freebsd.org/~nox/qemu/qemu-devel-20080823.patch
), and noticed a few things:

1. at least umass became slower, down from more than 1 MB/s to little
over 200 KB/s on one box here, emulated images (`usb_add disk:...') were
even more slow.

2, -vmwarevga seems to be broken with -kernel-kqemu (at least for linux
guests, it crashes the guest's xserver), and causes qemu to hang in
vmsvga_fifo_run without -kernel-kqemu sometimes (it never finds the end of
the fifo, and badcmd can also be reached with args not being reset so it
goobles up (unsigned)-1 fifo entries too.)  The following patch at least
stops the hangs, I still get `Unknown command 0x%02x in SVGA command FIFO'
messages probably because the fifo still gets out of sync:

Index: qemu/hw/vmware_vga.c
@@ -76,6 +76,7 @@
     uint32_t wblue;
     int syncing;
     int fb_size;
+    int empty;
 
     union {
         uint32_t *fifo;
@@ -487,7 +488,7 @@
 
 static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s)
 {
-    if (!s->config || !s->enable)
+    if (!s->config || !s->enable || s->empty)
         return 1;
     return (s->cmd->next_cmd == s->cmd->stop);
 }
@@ -495,6 +496,10 @@
 static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s)
 {
     uint32_t cmd = s->fifo[CMD(stop) >> 2];
+    if (s->cmd->next_cmd == s->cmd->stop) {
+        s->empty = 1;
+        return 0;
+    }
     s->cmd->stop = cpu_to_le32(CMD(stop) + 4);
     if (CMD(stop) >= CMD(max))
         s->cmd->stop = s->cmd->min;
@@ -512,6 +517,7 @@
     int args = 0;
     int x, y, dx, dy, width, height;
     struct vmsvga_cursor_definition_s cursor;
+    s->empty = 0;
     while (!vmsvga_fifo_empty(s))
         switch (cmd = vmsvga_fifo_read(s)) {
         case SVGA_CMD_UPDATE:
@@ -533,6 +539,7 @@
             vmsvga_fill_rect(s, colour, x, y, width, height);
             break;
 #else
+            args = 0;
             goto badcmd;
 #endif
 
@@ -547,6 +554,7 @@
             vmsvga_copy_rect(s, x, y, dx, dy, width, height);
             break;
 #else
+            args = 0;
             goto badcmd;
 #endif
 
@@ -609,6 +617,7 @@
             break; /* Nop */
 
         default:
+            args = 0;
         badcmd:
             while (args --)
                 vmsvga_fifo_read(s);

 and here is the xorg vmwarevga crash with -kernel-kqemu:

X.Org X Server 1.4.0.90
Release Date: 5 September 2007
X Protocol Version 11, Revision 0
Build Operating System: Linux Debian (xorg-server 2:1.4.1~git20080517-2)
Current Operating System: Linux sidux 2.6.25-9.slh.1-sidux-686 #1 SMP PREEMPT Tue Jun 24 23:26:13 UTC 2008 i686
Build Date: 09 June 2008  03:18:20PM
 
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Aug 23 18:40:58 2008
(==) Using config file: "/etc/X11/xorg.conf"
(==) ServerLayout "Xorg Configured"
(**) |-->Screen "Screen 0" (0)
(**) |   |-->Monitor "Monitor 0"
(==) No device specified for screen "Screen 0".
	Using the first device section listed.
(**) |   |-->Device "Device 0"
(**) |-->Input Device "Keyboard 0"
(**) |-->Input Device "VMMouse 0"
(**) Option "AllowMouseOpenFail" "true"
(==) Automatically adding devices
(==) Automatically enabling devices
(==) No FontPath specified.  Using compiled-in default.
(WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
	Entry deleted from font path.
(WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
	Entry deleted from font path.
(WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.
	Entry deleted from font path.
(==) FontPath set to:
	/usr/share/fonts/X11/misc,
	/usr/share/fonts/X11/100dpi/:unscaled,
	/usr/share/fonts/X11/75dpi/:unscaled,
	/usr/share/fonts/X11/100dpi,
	/usr/share/fonts/X11/75dpi
(==) RgbPath set to "/etc/X11/rgb"
(==) ModulePath set to "/usr/lib/xorg/modules"
(**) Extension "Composite" is disabled
(II) Open ACPI successful (/var/run/acpid.socket)
(II) Loader magic: 0x81e2560
(II) Module ABI versions:
	X.Org ANSI C Emulation: 0.3
	X.Org Video Driver: 2.0
	X.Org XInput driver : 2.0
	X.Org Server Extension : 0.3
	X.Org Font Renderer : 0.5
(II) Loader running on linux
(II) LoadModule: "pcidata"
(II) Loading /usr/lib/xorg/modules//libpcidata.so
(II) Module pcidata: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.0.0
	ABI class: X.Org Video Driver, version 2.0
(++) using VT number 7

(II) PCI: PCI scan (all values are in hex)
(II) PCI: 00:00:0: chip 8086,1237 card 0000,0000 rev 02 class 06,00,00 hdr 00
(II) PCI: 00:01:0: chip 8086,7000 card 0000,0000 rev 00 class 06,01,00 hdr 80
(II) PCI: 00:01:1: chip 8086,7010 card 0000,0000 rev 00 class 01,01,80 hdr 00
(II) PCI: 00:01:3: chip 8086,7113 card 0000,0000 rev 03 class 06,80,00 hdr 00
(II) PCI: 00:02:0: chip 15ad,0405 card 15ad,0405 rev 00 class 03,00,00 hdr 00
(II) PCI: 00:03:0: chip 10ec,8029 card 0000,0000 rev 00 class 02,00,00 hdr 00
(II) PCI: 00:04:0: chip 1274,5000 card 4942,4c4c rev 00 class 04,01,00 hdr 00
(II) PCI: End of PCI scan
(II) Host-to-PCI bridge:
(II) Bus 0: bridge is at (0:0:0), (0,0,0), BCTRL: 0x0008 (VGA_EN is set)
(II) Bus 0 I/O range:
	[0] -1	0	0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) Bus 0 non-prefetchable memory range:
	[0] -1	0	0x00000000 - 0xffffffff (0x0) MX[B]
(II) Bus 0 prefetchable memory range:
	[0] -1	0	0x00000000 - 0xffffffff (0x0) MX[B]
(II) PCI-to-ISA bridge:
(II) Bus -1: bridge is at (0:1:0), (0,-1,-1), BCTRL: 0x0008 (VGA_EN is set)
(--) PCI:*(0:2:0) VMware Inc [VMware SVGA II] PCI Display Adapter rev 0, Mem @ 0xf0000000/23, I/O @ 0xc010/4
(II) Addressable bus resource ranges are
	[0] -1	0	0x00000000 - 0xffffffff (0x0) MX[B]
	[1] -1	0	0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) OS-reported resource ranges:
	[0] -1	0	0x00100000 - 0x3fffffff (0x3ff00000) MX[B]E(B)
	[1] -1	0	0x000f0000 - 0x000fffff (0x10000) MX[B]
	[2] -1	0	0x000c0000 - 0x000effff (0x30000) MX[B]
	[3] -1	0	0x00000000 - 0x0009ffff (0xa0000) MX[B]
	[4] -1	0	0x0000ffff - 0x0000ffff (0x1) IX[B]
	[5] -1	0	0x00000000 - 0x000000ff (0x100) IX[B]
(II) Active PCI resource ranges:
	[0] -1	0	0xf0000000 - 0xf07fffff (0x800000) MX[B](B)
	[1] -1	0	0x0000c200 - 0x0000c2ff (0x100) IX[B]
	[2] -1	0	0x0000c100 - 0x0000c1ff (0x100) IX[B]
	[3] -1	0	0x0000c000 - 0x0000c00f (0x10) IX[B]
	[4] -1	0	0x0000c010 - 0x0000c01f (0x10) IX[B](B)
(II) Active PCI resource ranges after removing overlaps:
	[0] -1	0	0xf0000000 - 0xf07fffff (0x800000) MX[B](B)
	[1] -1	0	0x0000c200 - 0x0000c2ff (0x100) IX[B]
	[2] -1	0	0x0000c100 - 0x0000c1ff (0x100) IX[B]
	[3] -1	0	0x0000c000 - 0x0000c00f (0x10) IX[B]
	[4] -1	0	0x0000c010 - 0x0000c01f (0x10) IX[B](B)
(II) OS-reported resource ranges after removing overlaps with PCI:
	[0] -1	0	0x00100000 - 0x3fffffff (0x3ff00000) MX[B]E(B)
	[1] -1	0	0x000f0000 - 0x000fffff (0x10000) MX[B]
	[2] -1	0	0x000c0000 - 0x000effff (0x30000) MX[B]
	[3] -1	0	0x00000000 - 0x0009ffff (0xa0000) MX[B]
	[4] -1	0	0x0000ffff - 0x0000ffff (0x1) IX[B]
	[5] -1	0	0x00000000 - 0x000000ff (0x100) IX[B]
(II) All system resource ranges:
	[0] -1	0	0x00100000 - 0x3fffffff (0x3ff00000) MX[B]E(B)
	[1] -1	0	0x000f0000 - 0x000fffff (0x10000) MX[B]
	[2] -1	0	0x000c0000 - 0x000effff (0x30000) MX[B]
	[3] -1	0	0x00000000 - 0x0009ffff (0xa0000) MX[B]
	[4] -1	0	0xf0000000 - 0xf07fffff (0x800000) MX[B](B)
	[5] -1	0	0x0000ffff - 0x0000ffff (0x1) IX[B]
	[6] -1	0	0x00000000 - 0x000000ff (0x100) IX[B]
	[7] -1	0	0x0000c200 - 0x0000c2ff (0x100) IX[B]
	[8] -1	0	0x0000c100 - 0x0000c1ff (0x100) IX[B]
	[9] -1	0	0x0000c000 - 0x0000c00f (0x10) IX[B]
	[10] -1	0	0x0000c010 - 0x0000c01f (0x10) IX[B](B)
(II) LoadModule: "extmod"
(II) Loading /usr/lib/xorg/modules/extensions//libextmod.so
(II) Module extmod: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.0.0
	Module class: X.Org Server Extension
	ABI class: X.Org Server Extension, version 0.3
(II) Loading extension SHAPE
(II) Loading extension MIT-SUNDRY-NONSTANDARD
(II) Loading extension BIG-REQUESTS
(II) Loading extension SYNC
(II) Loading extension MIT-SCREEN-SAVER
(II) Loading extension XC-MISC
(II) Loading extension XFree86-VidModeExtension
(II) Loading extension XFree86-Misc
(II) Loading extension XFree86-DGA
(II) Loading extension DPMS
(II) Loading extension TOG-CUP
(II) Loading extension Extended-Visual-Information
(II) Loading extension XVideo
(II) Loading extension XVideo-MotionCompensation
(II) Loading extension X-Resource
(II) LoadModule: "dbe"
(II) Loading /usr/lib/xorg/modules/extensions//libdbe.so
(II) Module dbe: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.0.0
	Module class: X.Org Server Extension
	ABI class: X.Org Server Extension, version 0.3
(II) Loading extension DOUBLE-BUFFER
(II) LoadModule: "glx"
(II) Loading /usr/lib/xorg/modules/extensions//libglx.so
(II) Module glx: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.0.0
	ABI class: X.Org Server Extension, version 0.3
(==) AIGLX enabled
(II) Loading extension GLX
(II) LoadModule: "freetype"
(II) Loading /usr/lib/xorg/modules//fonts/libfreetype.so
(II) Module freetype: vendor="X.Org Foundation & the After X-TT Project"
	compiled for 1.4.0.90, module version = 2.1.0
	Module class: X.Org Font Renderer
	ABI class: X.Org Font Renderer, version 0.5
(II) Loading font FreeType
(II) LoadModule: "record"
(II) Loading /usr/lib/xorg/modules/extensions//librecord.so
(II) Module record: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.13.0
	Module class: X.Org Server Extension
	ABI class: X.Org Server Extension, version 0.3
(II) Loading extension RECORD
(II) LoadModule: "dri"
(II) Loading /usr/lib/xorg/modules/extensions//libdri.so
(II) Module dri: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.0.0
	ABI class: X.Org Server Extension, version 0.3
(II) Loading extension XFree86-DRI
(II) LoadModule: "vmware"
(II) Loading /usr/lib/xorg/modules/drivers//vmware_drv.so
(II) Module vmware: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 10.16.2
	Module class: X.Org Video Driver
	ABI class: X.Org Video Driver, version 2.0
(II) LoadModule: "kbd"
(II) Loading /usr/lib/xorg/modules/input//kbd_drv.so
(II) Module kbd: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.3.1
	Module class: X.Org XInput Driver
	ABI class: X.Org XInput driver, version 2.0
(II) LoadModule: "mouse"
(II) Loading /usr/lib/xorg/modules/input//mouse_drv.so
(II) Module mouse: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 1.3.0
	Module class: X.Org XInput Driver
	ABI class: X.Org XInput driver, version 2.0
(II) VMWARE: driver for VMware SVGA: vmware0405, vmware0710
(II) Primary Device is: PCI 00:02:0
(--) Chipset vmware0405 found
(II) resource ranges after xf86ClaimFixedResources() call:
	[0] 0	0	0x000b8000 - 0x000bffff (0x8000) MX[B]
	[1] 0	0	0x000b0000 - 0x000b7fff (0x8000) MX[B]
	[2] 0	0	0x000a0000 - 0x000affff (0x10000) MX[B]
	[3] -1	0	0x00100000 - 0x3fffffff (0x3ff00000) MX[B]E(B)
	[4] -1	0	0x000f0000 - 0x000fffff (0x10000) MX[B]
	[5] -1	0	0x000c0000 - 0x000effff (0x30000) MX[B]
	[6] -1	0	0x00000000 - 0x0009ffff (0xa0000) MX[B]
	[7] -1	0	0xf0000000 - 0xf07fffff (0x800000) MX[B](B)
	[8] 0	0	0x000003c0 - 0x000003df (0x20) IX[B]
	[9] 0	0	0x000003b0 - 0x000003bb (0xc) IX[B]
	[10] -1	0	0x0000ffff - 0x0000ffff (0x1) IX[B]
	[11] -1	0	0x00000000 - 0x000000ff (0x100) IX[B]
	[12] -1	0	0x0000c200 - 0x0000c2ff (0x100) IX[B]
	[13] -1	0	0x0000c100 - 0x0000c1ff (0x100) IX[B]
	[14] -1	0	0x0000c000 - 0x0000c00f (0x10) IX[B]
	[15] -1	0	0x0000c010 - 0x0000c01f (0x10) IX[B](B)
(II) resource ranges after probing:
	[0] 0	0	0x000b8000 - 0x000bffff (0x8000) MX[B]
	[1] 0	0	0x000b0000 - 0x000b7fff (0x8000) MX[B]
	[2] 0	0	0x000a0000 - 0x000affff (0x10000) MX[B]
	[3] -1	0	0x00100000 - 0x3fffffff (0x3ff00000) MX[B]E(B)
	[4] -1	0	0x000f0000 - 0x000fffff (0x10000) MX[B]
	[5] -1	0	0x000c0000 - 0x000effff (0x30000) MX[B]
	[6] -1	0	0x00000000 - 0x0009ffff (0xa0000) MX[B]
	[7] -1	0	0xf0000000 - 0xf07fffff (0x800000) MX[B](B)
	[8] 0	0	0x000003c0 - 0x000003df (0x20) IX[B]
	[9] 0	0	0x000003b0 - 0x000003bb (0xc) IX[B]
	[10] -1	0	0x0000ffff - 0x0000ffff (0x1) IX[B]
	[11] -1	0	0x00000000 - 0x000000ff (0x100) IX[B]
	[12] -1	0	0x0000c200 - 0x0000c2ff (0x100) IX[B]
	[13] -1	0	0x0000c100 - 0x0000c1ff (0x100) IX[B]
	[14] -1	0	0x0000c000 - 0x0000c00f (0x10) IX[B]
	[15] -1	0	0x0000c010 - 0x0000c01f (0x10) IX[B](B)
(II) Setting vga for screen 0.
(--) VMWARE(0): VMware SVGA regs at (0xc010, 0xc011)
(II) Loading sub module "vgahw"
(II) LoadModule: "vgahw"
(II) Loading /usr/lib/xorg/modules//libvgahw.so
(II) Module vgahw: vendor="X.Org Foundation"
	compiled for 1.4.0.90, module version = 0.1.0
	ABI class: X.Org Video Driver, version 2.0
(WW) System lacks support for changing MTRRs

Backtrace:
0: /usr/bin/X(xf86SigHandler+0x7e) [0x80c913e]
1: [0xb8021400]
2: /usr/lib/xorg/modules/drivers//vmware_drv.so [0xb7bffd37]
3: /usr/bin/X(InitOutput+0xa0f) [0x80ab32f]
4: /usr/bin/X(main+0x2b1) [0x8074561]
5: /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7da6455]
6: /usr/bin/X(FontFileCompleteXLFD+0x219) [0x8073a51]

Fatal server error:
Caught signal 11.  Server aborting

3. one one box (a c2d running FreeBSD/amd64) the qemu window stops updating
after a while until I move the mouse over it or over another window (I'm
using xfce configured for focus-follows-mouse.)  It still happens when I
disable powerd or SMP so its apparently not related to those...

4. command completion in the monitor is messed up, e.g. `cha' gets completed
to `chaang'.

5. there's an #include missing in block-raw-posix.c:

Index: qemu/block-raw-posix.c
@@ -55,6 +55,7 @@
 #include <linux/fd.h>
 #endif
 #ifdef __FreeBSD__
+#include <signal.h>
 #include <sys/disk.h>
 #endif
 
 I think thats it for now...

 Thanx,
	Juergen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080823235435.GA5405>