From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLN92-000155-SV for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:40:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLN8t-0000xD-Kb for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:40:17 -0500 Received: from [199.232.76.173] (port=44277 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLN8t-0000we-0M for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:40:11 -0500 Received: from mail.gmx.net ([213.165.64.20]:47693) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NLN8s-0001no-DZ for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:40:10 -0500 Message-ID: From: "Sebastian Herbszt" References: <20091214203603.GJ6150@redhat.com> <4B26A3B2.2030006@codemonkey.ws> <20091214205141.GC6398@redhat.com> <4B26F678.4010603@codemonkey.ws> <4B27541F.9020603@redhat.com> <4B27E1C2.5090506@codemonkey.ws> <20091215211900.GG26712@redhat.com> <4B280374.5010604@codemonkey.ws> <20091215215244.GI26712@redhat.com> <4B28064A.1070501@codemonkey.ws> <20091215215942.GJ26712@redhat.com> <4B280D20.5050203@codemonkey.ws> <4E3D53DBD9F24DC689E42B2E79AF735A@FSCPC> <4B28F388.70600@redhat.com> In-Reply-To: <4B28F388.70600@redhat.com> Subject: Re: Proper support for PCI-based option rom loading (was Re: [Qemu-devel] Re: qdev property bug?) Date: Thu, 17 Dec 2009 21:33:01 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "Michael S. Tsirkin" , glommer@redhat.com, Alexander Graf , qemu-devel@nongnu.org, Kevin O'Connor Gerd Hoffmann wrote: > On 12/15/09 23:51, Sebastian Herbszt wrote: >> Qemu will map rom1.bin to PC_ROM_MIN_OPTION (0xc8000) and map rom2.bin >> to 0xd0000. > > No. > > rom1.bin will be loaded to max(0xc8000, 0xc0000 + cirrus-bios-size) > aligned to 2k, which (with cirrus) is 0xc90000. My bad - for some reason i assumed the vga bios has to be 32k max. > rom2.bin will be loaded after rom1.bin (also 2k aligned), so the address > will depend on rom1.bin size. > >> Either qemu will map vga bios to PC_ROM_MIN_VGA (0xc0000) or >> SeaBIOS will map it there (with pci 3.0 it could map it somewhere else, >> but i doubt thats >> a good idea). In case the vga bios size is below 0x8000, some rom space >> is lost. > > Because it is larger than 0x8000 option roms will be overwritten when > loaded to 0xc8000 > >> SeaBIOS >> will scan the option rom space starting at PC_ROM_MIN_OPTION and adjust >> its RomEnd in >> case a rom is found. Then it will start the pci scan and map pci option >> roms after RomEnd. > > Doesn't fly. > > I think either qemu or seabios should load *all* roms. I think the idea > to provide non-pci roms via fw_cfg and let seabios load them is the best > idea we had so far. I don't think that is what happens on real hardware with ISA cards which have an option rom. Therefore i suggest inverting some of my suggestion from above and put the qemu loaded roms not at the beginning of the option rom space, but starting at the end of it, e.g. rom1.bin below 0xe0000 and rom2.bin below rom1.bin (considering rom length and alignment). SeaBIOS could then locate those roms and setup it's "RomEnd" (max. pci rom loading address) according to it. - Sebastian