All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Igor Mammedov <imammedo@redhat.com>,
	qemu-devel@nongnu.org, anthony@codemonkey.ws, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH 2/2] pseries: Use new hook to correct reset sequence
Date: Mon, 6 Aug 2012 10:31:53 +1000	[thread overview]
Message-ID: <20120806003153.GD16664@truffala.fritz.box> (raw)
In-Reply-To: <501BEAAC.1040405@suse.de>

On Fri, Aug 03, 2012 at 05:13:48PM +0200, Andreas Färber wrote:
> Am 03.08.2012 04:31, schrieb David Gibson:
> > On Thu, Aug 02, 2012 at 05:44:49PM +0200, Andreas Färber wrote:
> >> Am 02.08.2012 04:10, schrieb David Gibson:
[snip]
> >>> -static void spapr_cpu_reset(void *opaque)
> >>> -{
> >>> -    PowerPCCPU *cpu = opaque;
> >>> -    CPUPPCState *env = &cpu->env;
> >>> +    PowerPCCPU *cpu = container_of(env, PowerPCCPU, env);
> >>
> >> NACK. Please don't undo the cleanups I have applied! Functions should
> >> take a QOM PowerPCCPU, not its internal CPUPPCState. Fields are
> >> gradually being moved from CPUxxxState into CPUState.
> > 
> > Um, ok.  So how do I iterate the PowerPCCPUs instead of the CPUPPCStates?
> 
> You can't, yet. The QOM CPUState part 4 series (that got stalled due to
> APIC modelling) moved quite some fields to CPUState but not enough to
> change the first_cpu type despite the really long (74?) series.
> 
> So the solution here is to iterate the CPUPPCState, call
> ppc_env_get_cpu() on it and pass that as opaque as before.

So, move the container_of to the caller and use the wrapper for it (I
thought one might exist, but I hadn't spotted it).  Ok, I can do that.

> I could add a cpu_foreach() function though if that helps in the
> meantime? Either way the idea is to limit the number of places to touch
> in the upcoming refactorings.

If you like, but I'm not planning to delay these patches to wait for
it.

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

      reply	other threads:[~2012-08-06  1:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02  2:10 [Qemu-devel] [0/2] Allow machine to control ordering of reset David Gibson
2012-08-02  2:10 ` [Qemu-devel] [PATCH 1/2] Allow QEMUMachine to override reset sequencing David Gibson
2012-08-02  2:37   ` Anthony Liguori
2012-08-02  3:50     ` Benjamin Herrenschmidt
2012-08-02 15:17       ` Paolo Bonzini
2012-08-02 20:46         ` Benjamin Herrenschmidt
2012-08-02 20:58           ` Anthony Liguori
2012-08-03  2:54         ` David Gibson
2012-08-03  3:08     ` David Gibson
2012-08-02 15:00   ` Lluís Vilanova
2012-08-03  2:25     ` David Gibson
2012-08-02  2:10 ` [Qemu-devel] [PATCH 2/2] pseries: Use new hook to correct reset sequence David Gibson
2012-08-02 15:44   ` Andreas Färber
2012-08-02 18:29     ` Anthony Liguori
2012-08-02 18:38       ` Andreas Färber
2012-08-02 19:40         ` Anthony Liguori
2012-08-03  2:37           ` David Gibson
2012-08-03 13:50             ` Anthony Liguori
2012-08-03 13:57               ` Peter Maydell
2012-08-03 14:22                 ` Anthony Liguori
2012-08-03 14:35                   ` Peter Maydell
2012-08-03 14:51           ` Andreas Färber
2012-08-03 15:01           ` Andreas Färber
2012-08-03 16:21             ` Anthony Liguori
2012-08-07 22:02             ` Benjamin Herrenschmidt
2012-08-07 22:32               ` Andreas Färber
2012-08-08  0:00                 ` Anthony Liguori
2012-08-08  7:58                   ` Peter Maydell
2012-08-08  8:44                     ` David Gibson
2012-08-08  1:45                 ` David Gibson
2012-08-08 15:22                   ` Andreas Färber
2012-08-09  0:12                     ` David Gibson
2012-08-03  2:31     ` David Gibson
2012-08-03 15:13       ` Andreas Färber
2012-08-06  0:31         ` David Gibson [this message]

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=20120806003153.GD16664@truffala.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.