From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OBNaB-0001nU-98 for qemu-devel@nongnu.org; Mon, 10 May 2010 03:39:19 -0400 Received: from [140.186.70.92] (port=54346 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBNX2-0007Os-A8 for qemu-devel@nongnu.org; Mon, 10 May 2010 03:39:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBNU5-0004Vm-Nz for qemu-devel@nongnu.org; Mon, 10 May 2010 03:35:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4178) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBNU5-0004Vf-9e for qemu-devel@nongnu.org; Mon, 10 May 2010 03:33:01 -0400 Message-ID: <4BE7B6A9.8060007@redhat.com> Date: Mon, 10 May 2010 10:32:57 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: QEMU-KVM and video performance References: <4BCEBE5C.4020404@redhat.com> <20100421183357.GK27575@shareable.org> <4BCF6699.2060201@redhat.com> <4BCFF4B5.7010302@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerhard Wiesinger Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 05/09/2010 10:35 PM, Gerhard Wiesinger wrote: >>> >>>> Please run kvm_stat and report output for both tests to confirm. >>>> >>> >>> See below. 2nd column is per second statistic when running the test. >> >> efer_reload 0 0 >> exits 18470836 554582 >> fpu_reload 2147833 3469 >> halt_exits 2083 0 >> halt_wakeup 2047 0 >> host_state_reload 2148186 3470 >> hypercalls 0 0 >> insn_emulation 7688203 554244 >> >> This indicates that kvm is emulating instead of direct mapping. >> That's probably a bug. If you fix it, performance will increase >> dramatically. > > > Where can I start here? > Any ideas how to? > > One of my ideas: Move hw/vga.c functions > vga_mem_readb > vga_mem_readw > vga_mem_readl > vga_mem_writeb > vga_mem_writew > vga_mem_writel > to KVM to avoid switching from KVM to QEMU (I can write C code even > kernel but I'm not comfortable with KVM). Howto? That is already done (generically), it's called coalesced mmio. You only have 3470 qemu exits/sec compared to 554244 kvm writes/sec. >> Switching between tcg and kvm is hard, but not needed. For 256 color >> modes, direct map is possible and should yield good performance. >> Bank switching can be improved perhaps 3x, but will never be fast. > > Where can I start for KVM performance for the bank switching (256 > color mode)? (e.g. BIOS writes to VGA window I/O port to switch the bank) > Any ideas how to improve (architecture for the change)? For 256 color more the first priority is to find out why direct mapping is not used. I'd suggest tracing the code that makes this decision (in hw/*vga.c) and seeing if it's right or not. -- error compiling committee.c: too many arguments to function