From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzvFF-0001Gm-5Z for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:33:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzvFE-0001GA-Bb for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:33:32 -0500 Received: from [199.232.76.173] (port=51109 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzvFE-0001Fk-4W for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:33:32 -0500 Received: from qw-out-1920.google.com ([74.125.92.150]:39156) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzvFB-0001Zo-UB for qemu-devel@nongnu.org; Tue, 11 Nov 2008 10:33:30 -0500 Received: by qw-out-1920.google.com with SMTP id 5so2110580qwc.4 for ; Tue, 11 Nov 2008 07:33:25 -0800 (PST) Message-ID: <5d6222a80811110733p471c5603jb2e510aeadd3f587@mail.gmail.com> Date: Tue, 11 Nov 2008 13:33:24 -0200 From: "Glauber Costa" Subject: Re: [Qemu-devel] [PATCH 5/5] vga optimization. In-Reply-To: <4919A5BA.40604@eu.citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> <4919A5BA.40604@eu.citrix.com> 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 On Tue, Nov 11, 2008 at 1:33 PM, Stefano Stabellini wrote: > 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. > It is possible for the lfb to be set, but not mapped. So map_addr is what really indicates we're interested in tracking this region. Or I am totally wrong? -- Glauber Costa. "Free as in Freedom" http://glommer.net "The less confident you are, the more serious you have to act."