From patchwork Tue Dec 15 17:35:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 41212 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 56ED6B6F16 for ; Wed, 16 Dec 2009 04:36:40 +1100 (EST) Received: from localhost ([127.0.0.1]:37739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKbK8-0005I5-VJ for incoming@patchwork.ozlabs.org; Tue, 15 Dec 2009 12:36:37 -0500 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) Received: by 10.150.88.3 with SMTP id l3mr10042181ybb.92.1260898554458; Tue, 15 Dec 2009 09:35:54 -0800 (PST) Received: from squirrel.codemonkey.ws ([24.174.33.212]) by mx.google.com with ESMTPS id 23sm15737iwn.7.2009.12.15.09.35.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Dec 2009 09:35:52 -0800 (PST) Message-ID: <4B27C8F7.8030608@codemonkey.ws> Date: Tue, 15 Dec 2009 11:35:51 -0600 From: Anthony Liguori User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Avi Kivity 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> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Kevin O'Connor , seabios@seabios.org, qemu-devel@nongnu.org X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 implementation Regards, Anthony Liguori 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