From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKbJa-0005HD-QM for qemu-devel@nongnu.org; Tue, 15 Dec 2009 12:36:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKbJW-0005G9-KS for qemu-devel@nongnu.org; Tue, 15 Dec 2009 12:36:02 -0500 Received: from [199.232.76.173] (port=58618 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKbJW-0005G6-GN for qemu-devel@nongnu.org; Tue, 15 Dec 2009 12:35:58 -0500 Received: from mail-yw0-f171.google.com ([209.85.211.171]:43759) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKbJW-0005A7-5H for qemu-devel@nongnu.org; Tue, 15 Dec 2009 12:35:58 -0500 Received: by ywh1 with SMTP id 1so99697ywh.18 for ; Tue, 15 Dec 2009 09:35:57 -0800 (PST) Message-ID: <4B27C8F7.8030608@codemonkey.ws> Date: Tue, 15 Dec 2009 11:35:51 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [SeaBIOS] Proper support for PCI-based option rom loading (was Re: [Qemu-devel] Re: qdev property bug?) 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> <20091215043454.GD22611@morn.localdomain> <4B278BE9.3010900@codemonkey.ws> <4B279B24.1090004@codemonkey.ws> <4B279E47.80109@redhat.com> In-Reply-To: <4B279E47.80109@redhat.com> 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: Avi Kivity Cc: Kevin O'Connor , seabios@seabios.org, qemu-devel@nongnu.org Avi Kivity wrote: > On 12/15/2009 04:20 PM, Anthony Liguori wrote: >> Anthony Liguori wrote: >>> >>> The bios gets mapped in 0xe0000 .. 0x100000 so if SeaBIOS fills the >>> 0xc0000-0xf0000 space it will write over half of the bios. >> >> I'm a little confused by this. SeaBIOS seems to assume that it only >> has to deal with the 0xf0000 .. 0x100000 space as the bios which is >> certainly true (i don't think there's anything special about the >> 0xe0000 .. 0xf0000 region). >> >> I'm not sure why we load the 128K worth of bios instead of just >> loading 64K. >> > > bochs bios required all 128kB, so this is probably a leftover. This is apparently well defined in the PIIX spec. There is a bit of a difference between the lower half and upper half of the BIOS region though and I expect this is part of what the problem is. FYI, the following patch works. Surprisingly, we only need to restore the 0xe8000..0xe8fff region. Still trying to understand what's happening. diff --git a/src/shadow.c b/src/shadow.c index f0f97c5..860f461 100644 --- a/src/shadow.c +++ b/src/shadow.c @@ -29,7 +29,8 @@ __make_bios_writable(u16 bdf) int clear = 0; int i; for (i=0; i<6; i++) { - if (CONFIG_OPTIONROMS_DEPLOYED) { + /* need to copy 0xe8000 bios region for qemu */ + if (i==5) { int reg = pci_config_readb(bdf, 0x5a + i); if ((reg & 0x11) != 0x11) { // Need to copy optionroms to work around qemu implementation Regards, Anthony Liguori