From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd9oy-0006OW-3n for qemu-devel@nongnu.org; Wed, 01 Apr 2015 00:00:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yd9ou-0002W8-Tx for qemu-devel@nongnu.org; Wed, 01 Apr 2015 00:00:04 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:56106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd9ou-0002VV-8T for qemu-devel@nongnu.org; Wed, 01 Apr 2015 00:00:00 -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, 1 Apr 2015 09:29:54 +0530 Date: Wed, 1 Apr 2015 09:29:49 +0530 From: Bharata B Rao Message-ID: <20150401035949.GC29806@in.ibm.com> References: <1427117764-23008-1-git-send-email-bharata@linux.vnet.ibm.com> <1427117764-23008-5-git-send-email-bharata@linux.vnet.ibm.com> <20150325001555.GN25043@voom.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150325001555.GN25043@voom.fritz.box> Subject: Re: [Qemu-devel] [RFC PATCH v2 04/23] spapr: Support ibm, lrdr-capacity device tree property 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, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, imammedo@redhat.com, afaerber@suse.de On Wed, Mar 25, 2015 at 11:15:55AM +1100, David Gibson wrote: > On Mon, Mar 23, 2015 at 07:05:45PM +0530, Bharata B Rao wrote: > > Add support for ibm,lrdr-capacity since this is needed by the guest > > kernel to know about the possible hot-pluggable CPUs and Memory. With > > this, pseries kernels will start reporting correct maxcpus in > > /sys/devices/system/cpu/possible. > > > > Define minimum hotpluggable memory size as 256MB and start storing maximum > > possible memory for the guest in sPAPREnvironment. > > [snip] > > @@ -666,6 +668,18 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, > > } > > > > } > > + > > + lrdr_capacity[0] = cpu_to_be32(spapr->maxram_limit >> 32); > > + lrdr_capacity[1] = cpu_to_be32(spapr->maxram_limit & 0xffffffff); > > + lrdr_capacity[2] = 0; > > + lrdr_capacity[3] = cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE); > > + lrdr_capacity[4] = cpu_to_be32(max_cpus/smp_threads); > > + ret = qemu_fdt_setprop(fdt, "/rtas", "ibm,lrdr-capacity", lrdr_capacity, > > + sizeof(lrdr_capacity)); > > + if (ret < 0) { > > + fprintf(stderr, "Couldn't add ibm,lrdr-capacity rtas property\n"); > > This should probably be report_error() these days. This file (hw/ppc/spapr_rtas.c) has lots of fprintf calls, may be it's a task for another day to change all these. Regards, Bharata.