qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Thomas Huth <thuth@redhat.com>
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
Subject: Re: [Qemu-devel] [PATCHv2 2/4] spapr: Remove obsolete ram_limit field from sPAPRMachineState
Date: Fri, 29 May 2015 11:33:03 +1000	[thread overview]
Message-ID: <20150529013301.GB1481@voom.fritz.box> (raw)
In-Reply-To: <20150526100031.4aec99bf@thh440s>

[-- Attachment #1: Type: text/plain, Size: 2615 bytes --]

On Tue, May 26, 2015 at 10:00:31AM +0200, Thomas Huth wrote:
> On Tue, 26 May 2015 12:22:57 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > The ram_limit field was imported from sPAPREnvironment where it predates
> > the machine's ram size being available generically from machine->ram_size.
> > 
> > Worse, the existing code was inconsistent about where it got the ram size
> > from.  Sometimes it used spapr->ram_limit, sometimes the global 'ram_size'
> > and sometimes a local 'ram_size' masking the global.
> > 
> > This cleans up the code to consistently use machine->ram_size, eliminating
> > spapr->ram_limit in the process.
> > 
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > ---
> >  hw/ppc/spapr.c         | 22 ++++++++++++----------
> >  hw/ppc/spapr_hcall.c   |  3 ++-
> >  include/hw/ppc/spapr.h |  1 -
> >  3 files changed, 14 insertions(+), 12 deletions(-)
> > 
> > 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, int nodeid, hwaddr start,
> >  
> >  static int spapr_populate_memory(sPAPRMachineState *spapr, void *fdt)
> >  {
> > +    MachineState *machine = &spapr->parent_obj;
> 
> Here you use &spapr->parent_obj ... below you use MACHINE(spapr) ...
> looks somewhat inconsequent ==> 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 = MACHINE(spapr);
> >      CPUPPCState *env = &cpu->env;
> >      target_ulong flags = args[0];
> >      target_ulong pte_index = args[1];
> 
> Apart from the above nit, patch looks fine to me, so:
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> 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.

-- 
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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-05-29  4:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26  2:22 [Qemu-devel] [PATCHv2 0/4] sPAPRMachineState cleanups David Gibson
2015-05-26  2:22 ` [Qemu-devel] [PATCHv2 1/4] spapr: Merge sPAPREnvironment into sPAPRMachineState David Gibson
2015-05-26  7:10   ` Thomas Huth
2015-05-26  2:22 ` [Qemu-devel] [PATCHv2 2/4] spapr: Remove obsolete ram_limit field from sPAPRMachineState David Gibson
2015-05-26  8:00   ` Thomas Huth
2015-05-29  1:33     ` David Gibson [this message]
2015-05-26  2:22 ` [Qemu-devel] [PATCHv2 3/4] spapr: Remove obsolete entry_point " David Gibson
2015-05-26  8:01   ` Thomas Huth
2015-05-26  2:22 ` [Qemu-devel] [PATCHv2 4/4] spapr: Add sPAPRMachineClass David Gibson
2015-05-26  8:19   ` Thomas Huth
2015-05-29  1:35     ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150529013301.GB1481@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=lvivier@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).