From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4f0r-0006mJ-Lp for qemu-devel@nongnu.org; Wed, 21 Apr 2010 14:51:05 -0400 Received: from [140.186.70.92] (port=59019 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4f0p-0006hN-J0 for qemu-devel@nongnu.org; Wed, 21 Apr 2010 14:51:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4f0n-0003VL-Is for qemu-devel@nongnu.org; Wed, 21 Apr 2010 14:51:03 -0400 Received: from chello084112167138.7.11.vie.surfer.at ([84.112.167.138]:43090 helo=wiesinger.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4f0n-0003Ud-7B for qemu-devel@nongnu.org; Wed, 21 Apr 2010 14:51:01 -0400 Date: Wed, 21 Apr 2010 20:50:28 +0200 (CEST) From: Gerhard Wiesinger Subject: Re: [Qemu-devel] Re: QEMU-KVM and video performance In-Reply-To: <20100421183357.GK27575@shareable.org> Message-ID: References: <4BCEBE5C.4020404@redhat.com> <20100421183357.GK27575@shareable.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org On Wed, 21 Apr 2010, Jamie Lokier wrote: > Gerhard Wiesinger wrote: >> I'm using VESA mode 0x101 (640x480 256 colors), but performance is >> there very low (~1MB/s). Test is also WITHOUT any vga window change, so >> there isn't any page switching overhead involved in this test case. >> >>>> Any ideas for improvement? >>> >>> Currently when the physical memory map changes (which is what happens >>> when the vga window is updated), kvm drops the entire shadow cache. It's >>> possible to do this only for vga memory, but not easy. >> >> I don't think changing VGA window is a problem because there are >> 500.000-1Mio changes/s possible. > > 1MB/s, 500k-1M changes/s.... Coincidence? Is it taking a page fault > or trap on every write? To clarify: Memory Performance writing to segmen A000 is about 1MB/st. Calling INT 10 set/get window function with different windows (e.g. toggling between window page 0 and 1) is about 500.000 to 1Mio function calls per second. To get real good VGA performance both parameters should be: About >50MB/s for writes to segment A000 ~500.000 bank switches per second. >> Would it be possible to handle these writes through QEMU directly (without >> KVM), because performance is there very well (looking at the code there >> is some pointer arithmetic and some memory write done)? > > I've noticed extremely slow VGA performance too, when installing OSes. > It makes the difference between installing in a few minutes, and > installing taking hours - just because of the slow VGA. > > So generally I use qemu for installing old versions of Windows, then > change to KVM to run them after installing. > > Switching between KVM and qemu automatically based on guest code > behaviour, and making both memory models and device models compatible > at run time, is a difficult thing. I guess it's not worth the > difficulty just to speed up VGA. I think this is very easy to distingish: 1.) VGA Segment A000 is legacy and should be handled through QEMU and not through KVM (because it is much more faster). Also 16 color modes should be fast enough there. 2.) All other flat PCI memory accesses should be handled through KVM (there is a specialized driver loaded for that PCI device in the non legacy OS). Is that easily possible? Thnx. Ciao, Gerhard