From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasilis Liaskovitis Subject: Re: [RFC PATCH v2 05/21][SeaBIOS] pciinit: Fix pcimem_start value Date: Wed, 11 Jul 2012 18:45:28 +0200 Message-ID: <20120711164528.GC15407@dhcp-192-168-178-175.profitbricks.localdomain> References: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com> <1342002726-18258-6-git-send-email-vasilis.liaskovitis@profitbricks.com> <4FFD69E3.2030903@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, seabios@seabios.org, avi@redhat.com, anthony@codemonkey.ws, gleb@redhat.com, imammedo@redhat.com, kevin@koconnor.net, wency@cn.fujitsu.com To: Gerd Hoffmann Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:61052 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932897Ab2GKQpc (ORCPT ); Wed, 11 Jul 2012 12:45:32 -0400 Received: by bkwj10 with SMTP id j10so1325040bkw.19 for ; Wed, 11 Jul 2012 09:45:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4FFD69E3.2030903@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi, On Wed, Jul 11, 2012 at 01:56:19PM +0200, Gerd Hoffmann wrote: > On 07/11/12 12:31, Vasilis Liaskovitis wrote: > > In order to hotplug memory between RamSize and BUILD_PCIMEM_START, the pci > > window needs to start at BUILD_PCIMEM_START (0xe0000000). > > Otherwise, the guest cannot online new dimms at those ranges due to pci_root > > window conflicts. (workaround for linux guest is booting with pci=nocrs) > > > static void pci_bios_map_devices(struct pci_bus *busses) > > { > > - pcimem_start = RamSize; > > + pcimem_start = BUILD_PCIMEM_START; > > It isn't that simple. For the 32bit pci window it will work, but will > leaves address space unused instead of assigning it to the 32bit pci > window. For the 64bit pci window it will not work. > > You have to walk the dimms and figure what the highest used address is, > for both below-4g and above-4g. Then fill two variable with it and make > the pci init code use that instead of RamSize and RamSizeOver4G. I see. I already have these values values computed in qemu-kvm, so I can pass them in a paravirt struct, or infer them from the dimm/srat paravirt info that I already pass to seabios. If i understand correctly, we would like the pcimem windows to use the maximum possible address space (constrained by the exact dimms/ranges which are defined) instead of leaving unused space. thanks, - Vasilis From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sp02l-0004vs-B7 for qemu-devel@nongnu.org; Wed, 11 Jul 2012 12:45:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sp02f-0008AU-Q7 for qemu-devel@nongnu.org; Wed, 11 Jul 2012 12:45:38 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:64929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sp02f-00088d-JJ for qemu-devel@nongnu.org; Wed, 11 Jul 2012 12:45:33 -0400 Received: by bkcji1 with SMTP id ji1so1085462bkc.4 for ; Wed, 11 Jul 2012 09:45:31 -0700 (PDT) Date: Wed, 11 Jul 2012 18:45:28 +0200 From: Vasilis Liaskovitis Message-ID: <20120711164528.GC15407@dhcp-192-168-178-175.profitbricks.localdomain> References: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com> <1342002726-18258-6-git-send-email-vasilis.liaskovitis@profitbricks.com> <4FFD69E3.2030903@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FFD69E3.2030903@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v2 05/21][SeaBIOS] pciinit: Fix pcimem_start value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: kvm@vger.kernel.org, gleb@redhat.com, seabios@seabios.org, qemu-devel@nongnu.org, kevin@koconnor.net, avi@redhat.com, anthony@codemonkey.ws, imammedo@redhat.com Hi, On Wed, Jul 11, 2012 at 01:56:19PM +0200, Gerd Hoffmann wrote: > On 07/11/12 12:31, Vasilis Liaskovitis wrote: > > In order to hotplug memory between RamSize and BUILD_PCIMEM_START, the pci > > window needs to start at BUILD_PCIMEM_START (0xe0000000). > > Otherwise, the guest cannot online new dimms at those ranges due to pci_root > > window conflicts. (workaround for linux guest is booting with pci=nocrs) > > > static void pci_bios_map_devices(struct pci_bus *busses) > > { > > - pcimem_start = RamSize; > > + pcimem_start = BUILD_PCIMEM_START; > > It isn't that simple. For the 32bit pci window it will work, but will > leaves address space unused instead of assigning it to the 32bit pci > window. For the 64bit pci window it will not work. > > You have to walk the dimms and figure what the highest used address is, > for both below-4g and above-4g. Then fill two variable with it and make > the pci init code use that instead of RamSize and RamSizeOver4G. I see. I already have these values values computed in qemu-kvm, so I can pass them in a paravirt struct, or infer them from the dimm/srat paravirt info that I already pass to seabios. If i understand correctly, we would like the pcimem windows to use the maximum possible address space (constrained by the exact dimms/ranges which are defined) instead of leaving unused space. thanks, - Vasilis