From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anglh-0000fs-IU for qemu-devel@nongnu.org; Wed, 06 Apr 2016 02:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anglg-0003re-Hi for qemu-devel@nongnu.org; Wed, 06 Apr 2016 02:16:45 -0400 Received: from ozlabs.org ([103.22.144.67]:36073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anglg-0003rZ-68 for qemu-devel@nongnu.org; Wed, 06 Apr 2016 02:16:44 -0400 Date: Wed, 6 Apr 2016 15:19:06 +1000 From: David Gibson Message-ID: <20160406051906.GZ16485@voom.fritz.box> References: <1459919166-21640-1-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="abYdCjSRCBwcb+dP" Content-Disposition: inline In-Reply-To: <1459919166-21640-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [FIX PATCH] spapr: Fix ibm,lrdr-capacity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: nfonteno@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com --abYdCjSRCBwcb+dP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 06, 2016 at 10:36:06AM +0530, Bharata B Rao wrote: > ibm,lrdr-capacity has a field to describe the maximum address in bytes > and therefore, the most memory that can be allocated to this guest. We > are using maxmem for this field, but instead should use the actual RAM > address corresponding to the end of hotplug region. >=20 > Signed-off-by: Bharata B Rao > --- > Applies on ppc-for-2.6 branch of David Gibson's tree. Thanks, applied to ppc-for-2.6. >=20 > hw/ppc/spapr_rtas.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c > index 2db2292..f073258 100644 > --- a/hw/ppc/spapr_rtas.c > +++ b/hw/ppc/spapr_rtas.c > @@ -684,6 +684,9 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rt= as_addr, > int i; > uint32_t lrdr_capacity[5]; > MachineState *machine =3D MACHINE(qdev_get_machine()); > + sPAPRMachineState *spapr =3D SPAPR_MACHINE(machine); > + uint64_t max_hotplug_addr =3D spapr->hotplug_memory.base + > + memory_region_size(&spapr->hotplug_memor= y.mr); > =20 > ret =3D fdt_add_mem_rsv(fdt, rtas_addr, rtas_size); > if (ret < 0) { > @@ -733,8 +736,8 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rt= as_addr, > =20 > } > =20 > - lrdr_capacity[0] =3D cpu_to_be32(((uint64_t)machine->maxram_size) >>= 32); > - lrdr_capacity[1] =3D cpu_to_be32(machine->maxram_size & 0xffffffff); > + lrdr_capacity[0] =3D cpu_to_be32(max_hotplug_addr >> 32); > + lrdr_capacity[1] =3D cpu_to_be32(max_hotplug_addr & 0xffffffff); > lrdr_capacity[2] =3D 0; > lrdr_capacity[3] =3D cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE); > lrdr_capacity[4] =3D cpu_to_be32(max_cpus/smp_threads); --=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 --abYdCjSRCBwcb+dP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXBJxKAAoJEGw4ysog2bOSEKYQANqWahERyWLu5TotgMYhgdxw deZHeT6MRsVeKoz7OAIsQILczD1yx4mr33KhvtwjZRVAIBO+lFiI5a1CsMemiUJ0 N0QnwaDCFxsr3HIZlB4eHp7Xa2Y9AxaSk5Ta/gCh5ZxgzV6+fdIf+39AhbRni9DB UPqc+zv3Xp204zN3nBSk0/bWwQqe2CLG04kVOI1l69kyXMXaKOqEJTNM8OjaTqq8 uKiLlPdxNWY2VVH6Y0aUpq008GHKwDf/wrsIeEXiHKztIpSGcFiGau+kOEYtSKxc HkqfDyHqlm9+6Xbp96xYfPYYYEubQsz1+dXxhPgCca9so4ZzCH4KnKZXB/eKc3kE bOoeU3m1trgp4SwW2wNwbDsH0cwR32zpxwIK1EC81gjYO5SJfOCNGKNo9K0qq0gS XolrWl81O+fGIR4kvaGnDMmrc1wUpcyIvsjMAACr7V+rd7g70Dvh/H12SR6y21OF d6pH0SVs9SwpAAbZaeVmo21yhcGrfillIFBqsR8hfzm8aMCxFv2adYKfzEmLFubM Mf+KrPgyrolKt4S6IRz9ynXkZwLFkWRsILy2Hf/FeWc4qrofGg3vARBNuMkdkUqj KpLMAfblpZ+AOLNtNyEmrJ7ChyRoYMt9cAtBjM5YDTFJtfvzXzAkFFIWGflNZXcu Hxg0J+dtfuPW8XpFF3Lz =b20u -----END PGP SIGNATURE----- --abYdCjSRCBwcb+dP--