From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCIdf-0007Xh-NY for qemu-devel@nongnu.org; Mon, 06 Jul 2015 22:29:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCIdd-0005Ly-JS for qemu-devel@nongnu.org; Mon, 06 Jul 2015 22:29:39 -0400 Date: Tue, 7 Jul 2015 11:35:39 +1000 From: David Gibson Message-ID: <20150707013539.GI17857@voom.redhat.com> References: <1435567472-20338-1-git-send-email-bharata@linux.vnet.ibm.com> <1435567472-20338-3-git-send-email-bharata@linux.vnet.ibm.com> <20150706174948.5dc3b8a8@thh440s> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tctmm6wHVGT/P6vA" Content-Disposition: inline In-Reply-To: <20150706174948.5dc3b8a8@thh440s> Subject: Re: [Qemu-devel] [PATCH v6 2/6] spapr: Add LMB DR connectors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-devel@nongnu.org, imammedo@redhat.com, aik@ozlabs.ru, agraf@suse.de, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, Bharata B Rao , nfont@linux.vnet.ibm.com --tctmm6wHVGT/P6vA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 06, 2015 at 05:49:48PM +0200, Thomas Huth wrote: > On Mon, 29 Jun 2015 14:14:28 +0530 > Bharata B Rao wrote: >=20 > > Enable memory hotplug for pseries 2.4 and add LMB DR connectors. > > With memory hotplug, enforce RAM size, NUMA node memory size and maxmem > > to be a multiple of SPAPR_MEMORY_BLOCK_SIZE (256M) since that's the > > granularity in which LMBs are represented and hot-added. > >=20 > > LMB DR connectors will be used by the memory hotplug code. > >=20 > > Signed-off-by: Bharata B Rao > > Signed-off-by: Michael Roth > > [spapr_drc_reset implementation] > > --- > > hw/ppc/spapr.c | 88 ++++++++++++++++++++++++++++++++++++++++++= ++++++++ > > include/hw/ppc/spapr.h | 1 + > > 2 files changed, 89 insertions(+) > >=20 > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index 241ecad..bee868c 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > ... > > +/* > > + * If RAM size, maxmem size and individual node mem sizes aren't align= ed > > + * to SPAPR_MEMORY_BLOCK_SIZE(256MB), then refuse to start the guest > > + * since we can't support such unaligned sizes with DRCONF_MEMORY. > > + */ > > +static void spapr_validate_node_memory(MachineState *machine) > > +{ > > + int i; > > + > > + if (machine->maxram_size % SPAPR_MEMORY_BLOCK_SIZE || > > + machine->ram_size % SPAPR_MEMORY_BLOCK_SIZE) { > > + error_report("Can't support memory configuration where RAM siz= e " > > + "0x" RAM_ADDR_FMT " or maxmem size " > > + "0x" RAM_ADDR_FMT " isn't aligned to %lld MB", > > + machine->ram_size, machine->maxram_size, > > + SPAPR_MEMORY_BLOCK_SIZE/M_BYTE); > > + exit(EXIT_FAILURE); > > + } > > + > > + for (i =3D 0; i < nb_numa_nodes; i++) { > > + if (numa_info[i].node_mem && > > + numa_info[i].node_mem % SPAPR_MEMORY_BLOCK_SIZE) { > > + error_report("Can't support memory configuration where mem= ory " > > + "size %lx of node %d isn't aligned to %lld MB= ", > > + numa_info[i].node_mem, i, > > + SPAPR_MEMORY_BLOCK_SIZE/M_BYTE); >=20 > FYI, this causes a compiler warning when compiling for a 32-bit host: >=20 > hw/ppc/spapr.c: In function 'spapr_validate_node_memory': > hw/ppc/spapr.c:1638:26: warning: format '%lx' expects argument of type 'l= ong unsigned int', but argument 2 has type 'uint64_t' [-Wformat=3D] >=20 > I think you have to use PRIx64 or something similar here. I've added a patch to correct this to spapr-next. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --tctmm6wHVGT/P6vA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVmyzrAAoJEGw4ysog2bOSpegQAMrxxz98m1wWPb2vq1SSXmP3 0s7M9UW6Gux4gVEz5RlXIjcmgtXHqMzAXDT7kEF2+byE3G3IPC2/8ianlOCQBm5F 2qiD3jIELxJ/IeKT9sHfFfYrCQ2nvLQ8o2uZd9YIQUdFvUMMGGxTG8PgdFOIAo3R PZlBesY/I70SqH4xQWfN+KnyDLtiv2+Lsqa7k0e50Ll+9pCuEiuS+OC5icQhi/9p ZrTs4uB71qs1m4truPpUaUuT87ZDs4zyVrt2rVWsWk5DzI/PuDKV8TcjdM+F64RD hw6inpT/ILy+OKg5s/1b6ADGy1CWC9SVIf2R+mJFZMaqf/0z/y19aVIGNBX7Z9QO 2MQ6Ox6QpLO2QA9n6Ok96ltcu7kU+zmqJmTV4kETrYPx2mJn2u9mucpO9Sb4eccv Z237Y64xvpsMM1DHO6kloPmwzfF15bEQ9LdOdwwntqV4RMiqbMk4RI1rFFzmARXl u/JorRAPEQs1d2e4T8wsnHK0EJNJbwg/XlVUgXD6MBDH9mxJq2eF18oL9d+I/o/z +URy1M64F1jaIY3hmwo+VKliXHrNB0IR4S4BFjVmwvMxz0W46meRb1TjyaFiSR4E go3dKHMkHmIv9+/1mHyQ4rZd/ZLxOQNLp0HnXS1ExzzFwHEGRT+NqDbHBWJuSAu5 +/UDy2SKzjDTimlkxeOE =AdsO -----END PGP SIGNATURE----- --tctmm6wHVGT/P6vA--