From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [RFC PATCH v2 05/21][SeaBIOS] pciinit: Fix pcimem_start value Date: Wed, 11 Jul 2012 13:56:19 +0200 Message-ID: <4FFD69E3.2030903@redhat.com> References: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com> <1342002726-18258-6-git-send-email-vasilis.liaskovitis@profitbricks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 To: Vasilis Liaskovitis Return-path: In-Reply-To: <1342002726-18258-6-git-send-email-vasilis.liaskovitis@profitbricks.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org 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. cheers, Gerd From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SovX6-0000xK-9P for qemu-devel@nongnu.org; Wed, 11 Jul 2012 07:56:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SovWw-0003dS-FA for qemu-devel@nongnu.org; Wed, 11 Jul 2012 07:56:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SovWw-0003d3-6c for qemu-devel@nongnu.org; Wed, 11 Jul 2012 07:56:30 -0400 Message-ID: <4FFD69E3.2030903@redhat.com> Date: Wed, 11 Jul 2012 13:56:19 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com> <1342002726-18258-6-git-send-email-vasilis.liaskovitis@profitbricks.com> In-Reply-To: <1342002726-18258-6-git-send-email-vasilis.liaskovitis@profitbricks.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Vasilis Liaskovitis 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 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. cheers, Gerd