From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUd9X-0005zk-IG for qemu-devel@nongnu.org; Fri, 11 Oct 2013 09:53:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUd9R-0006ap-JV for qemu-devel@nongnu.org; Fri, 11 Oct 2013 09:53:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUd9R-0006ai-BS for qemu-devel@nongnu.org; Fri, 11 Oct 2013 09:53:09 -0400 Date: Fri, 11 Oct 2013 15:53:02 +0200 From: Igor Mammedov Message-ID: <20131011155302.067df549@nial.usersys.redhat.com> In-Reply-To: <1381494950.23065.12.camel@nilsson.home.kraxel.org> References: <1381486765-27389-1-git-send-email-imammedo@redhat.com> <1381494950.23065.12.camel@nilsson.home.kraxel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] map 64-bit PCI BARs at location provided by emulator List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: pbonzini@redhat.com, kevin@koconnor.net, seabios@seabios.org, qemu-devel@nongnu.org, mst@redhat.com On Fri, 11 Oct 2013 14:35:50 +0200 Gerd Hoffmann wrote: > On Fr, 2013-10-11 at 12:19 +0200, Igor Mammedov wrote: > > Currently 64-bit PCI BARs are unconditionally mapped by BIOS right > > over 4G + RamSizeOver4G location, which doesn't allow to reserve > > extra space before 64-bit PCI window. For memory hotplug an extra > > RAM space might be reserved after present 64-bit RAM end and BIOS > > should map 64-bit PCI BARs after it. > > > > Introduce "etc/pcimem64-start" romfile to provide BIOS a hint > > where it should start mapping of 64-bit PCI BARs. If romfile is > > missing BIOS reverts to legacy behavior and starts mapping right > > after high memory. > > Looks good overall. > > > > struct pci_region r64_mem, r64_pref; > > + u64 base64 = le64_to_cpu(romfile_loadint("etc/pcimem64-start", > > + 0x100000000ULL + RamSizeOver4G)); > > Should we sanity-check base64 maybe? > Make sure it isn't smaller than 0x100000000ULL + RamSizeOver4G? If it would be less than 0x100000000ULL + RamSizeOver4G then it would mean that QEMU for some reason decided to overshadow present RAM with PCI hole. It would add a couple of extra bytes to BIOS and point where it should fail or at least print a warning that nobody will read at runtime. I think it's better to assert on QEMU side and abort even before guest started if it's considered as error. > > cheers, > Gerd > > >