From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyCCa-0002ed-Bm for qemu-devel@nongnu.org; Fri, 29 May 2015 00:47:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyCCX-00054O-6U for qemu-devel@nongnu.org; Fri, 29 May 2015 00:47:24 -0400 Date: Fri, 29 May 2015 11:33:03 +1000 From: David Gibson Message-ID: <20150529013301.GB1481@voom.fritz.box> References: <1432606979-28556-1-git-send-email-david@gibson.dropbear.id.au> <1432606979-28556-3-git-send-email-david@gibson.dropbear.id.au> <20150526100031.4aec99bf@thh440s> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline In-Reply-To: <20150526100031.4aec99bf@thh440s> Subject: Re: [Qemu-devel] [PATCHv2 2/4] spapr: Remove obsolete ram_limit field from sPAPRMachineState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: lvivier@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, afaerber@suse.de --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 26, 2015 at 10:00:31AM +0200, Thomas Huth wrote: > On Tue, 26 May 2015 12:22:57 +1000 > David Gibson wrote: >=20 > > The ram_limit field was imported from sPAPREnvironment where it predates > > the machine's ram size being available generically from machine->ram_si= ze. > >=20 > > Worse, the existing code was inconsistent about where it got the ram si= ze > > from. Sometimes it used spapr->ram_limit, sometimes the global 'ram_si= ze' > > and sometimes a local 'ram_size' masking the global. > >=20 > > This cleans up the code to consistently use machine->ram_size, eliminat= ing > > spapr->ram_limit in the process. > >=20 > > Signed-off-by: David Gibson > > --- > > hw/ppc/spapr.c | 22 ++++++++++++---------- > > hw/ppc/spapr_hcall.c | 3 ++- > > include/hw/ppc/spapr.h | 1 - > > 3 files changed, 14 insertions(+), 12 deletions(-) > >=20 > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index 0016f25..31b29d6 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > [...] > > @@ -649,6 +652,7 @@ static void spapr_populate_memory_node(void *fdt, i= nt nodeid, hwaddr start, > > =20 > > static int spapr_populate_memory(sPAPRMachineState *spapr, void *fdt) > > { > > + MachineState *machine =3D &spapr->parent_obj; >=20 > Here you use &spapr->parent_obj ... below you use MACHINE(spapr) ... > looks somewhat inconsequent =3D=3D> maybe also use MACHINE(spapr) here? Ah, good catch. Clearly not quite back into QOM headspace. > ... > > diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c > > index 1a20884..652ddf6 100644 > > --- a/hw/ppc/spapr_hcall.c > > +++ b/hw/ppc/spapr_hcall.c > > @@ -87,6 +87,7 @@ static inline bool valid_pte_index(CPUPPCState *env, = target_ulong pte_index) > > static target_ulong h_enter(PowerPCCPU *cpu, sPAPRMachineState *spapr, > > target_ulong opcode, target_ulong *args) > > { > > + MachineState *machine =3D MACHINE(spapr); > > CPUPPCState *env =3D &cpu->env; > > target_ulong flags =3D args[0]; > > target_ulong pte_index =3D args[1]; >=20 > Apart from the above nit, patch looks fine to me, so: >=20 > Reviewed-by: Thomas Huth >=20 > Another question out of curiosity: Do you know if the global "ram_size" > variable is scheduled to be removed soon in the future? I don't know, I'm afraid. --=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 --1LKvkjL3sHcu1TtY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVZ8HMAAoJEGw4ysog2bOSFhUP/jRQWjEerBE4Hj6lKMJ7owSN V+nklkt6LGG8g3pskJGrrbOcMqdQ1CSZMoe9ZM98c51rkipcFCzCdiYzLpeJjnf3 9D4Is2BiLcz5cQVxUxn2qcHqu95OOqaxGgNGMSiWxdfvnSr1ZvhhtKdl+Zk6M1sq yi6MTkZn5Mz8yRkGE5GaxPMqfgy/T/MHyq8Pix+htBTFCDq+jYULDyQge4dpIAhg PIc0wHUqNVKBq8bBjF3W2WHbbfaeFwvrR5XxNKIYPUkTElrGd5uP44KFU4O34gHg jmNxAiRcbnlWPsc+oHzUeDnU/iLxuFmsavE28Bjgc5dDvEoub0yTdyCp+cM1MTpV bF371W5aAtHlVL5TxGLAUCy+/+TQOoNMDDJ6IJ2ucPg7duXsCi4py4U3RJnroXbp YGAkJVc10zYsAUxy4Y8UZaR927L93gKklU/cRGVw52a4kLQcPZ4Dj4/iPuWnnLSC lKGPuKJMAxqCTK/B8bWmB/7CZod0H6NRIVYA9AS3CFy3spnUW3HpEsqTzkwTy0ca sV7haaMvF9oIj4c45u+/0KShbx7Bz/gelcm5KaLRf3p7lsyTc6sx1ivDbqX2CoSu qmXdYiEGrNeoxT56H0fVFlgsjG/bZr9+ved7PplpqFG4PlqHskNMuEEzSBYdfJyD JrnhrqiV/l8XV2D1Th4v =TYUC -----END PGP SIGNATURE----- --1LKvkjL3sHcu1TtY--