From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNtYo-0005sd-BQ for qemu-devel@nongnu.org; Fri, 16 Jan 2009 13:36:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNtYl-0005qV-7D for qemu-devel@nongnu.org; Fri, 16 Jan 2009 13:36:48 -0500 Received: from [199.232.76.173] (port=34043 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNtYl-0005qK-2J for qemu-devel@nongnu.org; Fri, 16 Jan 2009 13:36:47 -0500 Received: from mail-qy0-f20.google.com ([209.85.221.20]:55245) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNtYk-0004K7-MZ for qemu-devel@nongnu.org; Fri, 16 Jan 2009 13:36:46 -0500 Received: by qyk13 with SMTP id 13so2659671qyk.10 for ; Fri, 16 Jan 2009 10:36:45 -0800 (PST) Message-ID: <4970D3B1.5070504@codemonkey.ws> Date: Fri, 16 Jan 2009 12:36:33 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [6322] add a -vga none cli option (Stefano Stabellini) References: <49705B73.9060103@siemens.com> <49707765.3070706@eu.citrix.com> In-Reply-To: <49707765.3070706@eu.citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Stefano Stabellini wrote: > Jan Kiszka wrote: > > >> This hunk now generates: >> >> qemu/hw/pc.c: In function â¬Üpc_init1â¬": >> qemu/hw/pc.c:762: warning: â¬Üvga_bios_offsetâ¬" may be used uninitialized in this function >> >> For obvious reasons. Can we simply make the related >> cpu_register_physical_memory conditional as well? >> >> Jan >> >> > > > > You are right that patch caused variable initialization issues, this > patch should fix them. > > Signed-off-by: Stefano Stabellini > > diff --git a/hw/pc.c b/hw/pc.c > index d64e442..ff0f16d 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -759,7 +759,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, > { > char buf[1024]; > int ret, linux_boot, i; > - ram_addr_t ram_addr, vga_ram_addr, bios_offset, vga_bios_offset; > + ram_addr_t ram_addr, vga_ram_addr = 0x00, bios_offset, vga_bios_offset; > ram_addr_t below_4g_mem_size, above_4g_mem_size = 0; > int bios_size, isa_bios_size, vga_bios_size; > PCIBus *pci_bus; > @@ -831,10 +831,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, > ram_addr); > } > > - > - /* allocate VGA RAM */ > - vga_ram_addr = qemu_ram_alloc(vga_ram_size); > - > It's a little safer to leave this allocation in place because it maintains the 1-1 mapping of phys_ram_base and low memory. Unfortunately, I think there is still code that depends on this. Regards, Anthony Liguroi