From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzvBg-0007Se-SD for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:29:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzvBf-0007Rw-DT for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:29:52 -0500 Received: from [199.232.76.173] (port=34849 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzvBf-0007Rl-5v for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:29:51 -0500 Received: from smtp.eu.citrix.com ([62.200.22.115]:44127) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzvBf-0000o6-94 for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:29:51 -0500 Message-ID: <4919A5BA.40604@eu.citrix.com> Date: Tue, 11 Nov 2008 15:33:14 +0000 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 5/5] vga optimization. References: <1226369769-5109-1-git-send-email-glommer@redhat.com> <1226369769-5109-2-git-send-email-glommer@redhat.com> <1226369769-5109-3-git-send-email-glommer@redhat.com> <1226369769-5109-4-git-send-email-glommer@redhat.com> <1226369769-5109-5-git-send-email-glommer@redhat.com> <1226369769-5109-6-git-send-email-glommer@redhat.com> <49199A50.40504@codemonkey.ws> In-Reply-To: <49199A50.40504@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori wrote: >Glauber Costa wrote: >> +static void map_linear_vram(CirrusVGAState *s) >> +{ >> + int phys_offset = s->vga_io_memory; >> + >> + if (!s->map_addr && s->lfb_addr && s->lfb_end) { >> + s->map_addr = s->lfb_addr; >> + s->map_end = s->lfb_end; >> + cpu_register_physical_memory(s->map_addr, s->map_end - s->map_addr, s->vram_offset); >> + vga_dirty_log_start((VGAState *)s); >> > >So you register this region and enable dirty tracking. I don't think it should be enabled here. >> + } >> + >> + if(!(s->cirrus_srcptr != s->cirrus_srcptr_end) >> + && !((s->sr[0x07] & 0x01) == 0) >> + && !((s->gr[0x0B] & 0x14) == 0x14) >> + && !(s->gr[0x0B] & 0x02)) { >> + phys_offset = s->vram_offset | IO_MEM_RAM; >> + } >> + cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000, phys_offset); >> > >But also potentially change 0xa0000..0xc0000 to RAM, but you don't >enable dirty tracking on this region. I think you either have to leave >this region as MMIO or enable dirty tracking on it too. > To be honest I don't understand why this is part is needed. @@ -2102,6 +2122,11 @@ static void vga_map(PCIDevice *pci_dev, int region_num, } else { cpu_register_physical_memory(addr, s->vram_size, s->vram_offset); } + + s->map_addr = addr; + s->map_end = addr + VGA_RAM_SIZE; + + vga_dirty_log_start(s); } I think you should set lfb_addr and lfb_end here instead of map_addr and map_end.