Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKP7n-0004tN-2E for qemu-devel@nongnu.org; Mon, 14 Dec 2009 23:35:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKP7i-0004sn-CG for qemu-devel@nongnu.org; Mon, 14 Dec 2009 23:35:02 -0500 Received: from [199.232.76.173] (port=57923 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKP7i-0004sk-9h for qemu-devel@nongnu.org; Mon, 14 Dec 2009 23:34:58 -0500 Received: from qw-out-1920.google.com ([74.125.92.147]:21783) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKP7i-0006hW-0F for qemu-devel@nongnu.org; Mon, 14 Dec 2009 23:34:58 -0500 Received: by qw-out-1920.google.com with SMTP id 5so872782qwc.4 for ; Mon, 14 Dec 2009 20:34:57 -0800 (PST) Date: Mon, 14 Dec 2009 23:34:54 -0500 From: Kevin O'Connor Subject: Re: Proper support for PCI-based option rom loading (was Re: [Qemu-devel] Re: qdev property bug?) Message-ID: <20091215043454.GD22611@morn.localdomain> References: <4B26931E.4000101@codemonkey.ws> <20091214194210.GB6150@redhat.com> <4B269933.3010906@codemonkey.ws> <20091214202019.GF6150@redhat.com> <4B26A0DE.5000304@redhat.com> <20091214203428.GI6150@redhat.com> <20091214203603.GJ6150@redhat.com> <4B26A3B2.2030006@codemonkey.ws> <20091214205141.GC6398@redhat.com> <4B26F678.4010603@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B26F678.4010603@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: seabios@seabios.org, qemu-devel@nongnu.org On Mon, Dec 14, 2009 at 08:37:44PM -0600, Anthony Liguori wrote: > Okay, I think I've figured out how this is supposed to work. With these > two patches to SeaBIOS and the patch to qemu, I can run: I'm not sure why "Do not guard qemu shadow ram work around in CONFIG_OPTIONROMS_DEPLOYED" patch is needed. The code today is: if (CONFIG_OPTIONROMS_DEPLOYED) { int reg = pci_config_readb(bdf, 0x5a + i); if ((reg & 0x11) != 0x11) { // Need to copy optionroms to work around qemu implementation void *mem = (void*)(BUILD_ROM_START + i * 32*1024); memcpy((void*)BUILD_BIOS_TMP_ADDR, mem, 32*1024); pci_config_writeb(bdf, 0x5a + i, 0x33); memcpy(mem, (void*)BUILD_BIOS_TMP_ADDR, 32*1024); clear = 1; } else { pci_config_writeb(bdf, 0x5a + i, 0x33); } } else { pci_config_writeb(bdf, 0x5a + i, 0x33); } So, in the non CONFIG_OPTIONROMS_DEPLOYED case, SeaBIOS will just do the write enable call (pci_config_writeb(bdf, 0x5a + i, 0x33)). The CONFIG_OPTIONROMS_DEPLOYED case should just be to copy the roms qemu has deployed. If SeaBIOS is filling in the 0xc0000-0xf0000 space, it shouldn't matter if the contents of that space is lost during the write enable. Let me know if I've missed something. -Kevin