From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUEZS-0004II-V8 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 07:38:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUEZJ-00081R-Ui for qemu-devel@nongnu.org; Thu, 10 Oct 2013 07:38:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUEZJ-000819-Mc for qemu-devel@nongnu.org; Thu, 10 Oct 2013 07:38:13 -0400 Date: Thu, 10 Oct 2013 14:40:37 +0300 From: "Michael S. Tsirkin" Message-ID: <20131010114037.GE7582@redhat.com> References: <1381321384-17270-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1381321384-17270-1-git-send-email-imammedo@redhat.com> Subject: Re: [Qemu-devel] [RFC] map 64-bit PCI devices after all possible RAM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: pbonzini@redhat.com, kevin@koconnor.net, seabios@seabios.org, qemu-devel@nongnu.org, kraxel@redhat.com On Wed, Oct 09, 2013 at 02:23:04PM +0200, Igor Mammedov wrote: > I'm posting it to get an oppinion on one of possible approaches > on where to map a hotplug memory. > > This patch assumes that a space for hotplug memory is located right > after RamSizeOver4G region and QEMU will provide romfile to specify > where it ends so that BIOS could know from what base to start > 64-bit PCI devices mapping. > > Signed-off-by: Igor Mammedov Well there are two things bios does with RamSizeOver4G: determine where to map PCI devices, and fill in smbios. I wonder whether QEMU should fill smbios from qemu too, that would let us side-step the issue and just make RamSizeOver4G larger. Let's see how the ACPI patchset fares first ... > --- > src/fw/pciinit.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c > index b29db99..62f8d4e 100644 > --- a/src/fw/pciinit.c > +++ b/src/fw/pciinit.c > @@ -18,6 +18,8 @@ > #include "paravirt.h" // RamSize > #include "string.h" // memset > #include "util.h" // pci_setup > +#include "byteorder.h" // le64_to_cpu > +#include "romfile.h" // romfile_loadint > > #define PCI_DEVICE_MEM_MIN 0x1000 > #define PCI_BRIDGE_IO_MIN 0x1000 > @@ -764,6 +766,8 @@ static void pci_bios_map_devices(struct pci_bus *busses) > { > if (pci_bios_init_root_regions(busses)) { > struct pci_region r64_mem, r64_pref; > + u64 base64 = le64_to_cpu(romfile_loadint("etc/mem64-end", > + 0x100000000ULL + RamSizeOver4G)); > r64_mem.list.first = NULL; > r64_pref.list.first = NULL; > pci_region_migrate_64bit_entries(&busses[0].r[PCI_REGION_TYPE_MEM], > @@ -779,7 +783,7 @@ static void pci_bios_map_devices(struct pci_bus *busses) > u64 align_mem = pci_region_align(&r64_mem); > u64 align_pref = pci_region_align(&r64_pref); > > - r64_mem.base = ALIGN(0x100000000LL + RamSizeOver4G, align_mem); > + r64_mem.base = ALIGN(base64, align_mem); > r64_pref.base = ALIGN(r64_mem.base + sum_mem, align_pref); > pcimem64_start = r64_mem.base; > pcimem64_end = r64_pref.base + sum_pref; > -- > 1.8.3.1