From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7aD0-0003X2-1w for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:14:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7aCw-0003Iv-O6 for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:14:37 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:37829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7aCw-0003Fo-5E for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:14:34 -0400 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Jun 2015 07:44:30 +0530 Date: Wed, 24 Jun 2015 07:44:24 +0530 From: Bharata B Rao Message-ID: <20150624021423.GB26051@in.ibm.com> References: <1434709077-17491-1-git-send-email-bharata@linux.vnet.ibm.com> <1434709077-17491-2-git-send-email-bharata@linux.vnet.ibm.com> <20150623013358.GW13352@voom.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150623013358.GW13352@voom.redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v4 1/5] spapr: Initialize hotplug memory address space Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, imammedo@redhat.com On Tue, Jun 23, 2015 at 11:33:58AM +1000, David Gibson wrote: > On Fri, Jun 19, 2015 at 03:47:53PM +0530, Bharata B Rao wrote: > > Initialize a hotplug memory region under which all the hotplugged > > memory is accommodated. Also enable memory hotplug by setting > > CONFIG_MEM_HOTPLUG. > > > > Modelled on i386 memory hotplug. > > > > Signed-off-by: Bharata B Rao > > --- > > default-configs/ppc64-softmmu.mak | 1 + > > hw/ppc/spapr.c | 28 ++++++++++++++++++++++++++++ > > include/hw/ppc/spapr.h | 12 ++++++++++++ > > 3 files changed, 41 insertions(+) > > > > diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak > > index ab62cc7..e77cb1a 100644 > > --- a/default-configs/ppc64-softmmu.mak > > +++ b/default-configs/ppc64-softmmu.mak > > @@ -52,3 +52,4 @@ CONFIG_XICS_KVM=$(and $(CONFIG_PSERIES),$(CONFIG_KVM)) > > # For PReP > > CONFIG_MC146818RTC=y > > CONFIG_ISA_TESTDEV=y > > +CONFIG_MEM_HOTPLUG=y > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index 5ca817c..87a29dc 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > > @@ -1549,6 +1549,34 @@ static void ppc_spapr_init(MachineState *machine) > > memory_region_add_subregion(sysmem, 0, rma_region); > > } > > > > + /* initialize hotplug memory address space */ > > + if (machine->ram_size < machine->maxram_size) { > > + ram_addr_t hotplug_mem_size = machine->maxram_size - machine->ram_size; > > + > > + if (machine->ram_slots > SPAPR_MAX_RAM_SLOTS) { > > + error_report("unsupported amount of memory slots: %"PRIu64, > > + machine->ram_slots); > > + exit(EXIT_FAILURE); > > + } > > + > > + spapr->hotplug_memory.base = ROUND_UP(machine->ram_size, > > + SPAPR_HOTPLUG_MEM_ALIGN); > > + > > + hotplug_mem_size += SPAPR_HOTPLUG_MEM_ALIGN * machine->ram_slots; > > I'm not sure what this adjustment is about. Are you putting a gap of > size SPAPR_HOTPLUG_MEM_ALIGN between each memory slot? That doesn't > see to match the DRC initialization code in the next patch which > assigns all the LMBs in the hotplug area contiguous addresses. Right, this is some leftover alignment bits from x86 implementation which to me looks like not needed in Power. Let me clean this up in the next iteration. Regards, Bharata.