qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] spapr: move registration of "host" CPU core type to machine code
Date: Wed, 27 Sep 2017 16:21:43 +1000	[thread overview]
Message-ID: <20170927062143.GN12504@umbus> (raw)
In-Reply-To: <20170926091928.50e115ff@bahia.lan>

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

On Tue, Sep 26, 2017 at 09:19:28AM +0200, Greg Kurz wrote:
> On Tue, 26 Sep 2017 12:57:39 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Mon, Sep 25, 2017 at 11:47:33AM +0200, Greg Kurz wrote:
> > > The CPU core abstraction belongs to the machine code. This also gets
> > > rid of some code duplication.
> > > 
> > > Signed-off-by: Greg Kurz <groug@kaod.org>
> > > ---
> > > 
> > > hw/ppc/spapr_cpu_core.h is also included elsewhere in target/ppc/kvm.c
> > > but this is already handled by the following cleanup patch:  
> > 
> > I don't really see what the advantage of this is.  As others have
> > pointed out it leads to the host type being registered very late,
> > which could cause problems.
> > 
> 
> Well, the goal was to consolidate the code to register sPAPRCPUCore types in
> the spapr code, instead of open-coding it in spapr_cpu_core.c and kvm.c... 
> 
> But now I realize that delaying the registration even more is a bad idea. And,
> the other way round, registering a static type earlier as asked by Igor would
> require all parent types to be already registered, which seems to be impossible
> to guarantee with the current code.
> 
> Maybe we could at least have kvm_ppc_register_host_cpu_type() to call a
> function in spapr_cpu_core.c instead of duplicating the registration
> code ?

I think that sounds like a better idea.  It's still a little bodgy
with the abstraction boundaries, but I think that's unavoidable: this
fundamentally depends on both KVM's presence and use of the PAPR
machine type.  Whichever place we put it, you could argue it belongs
better in the other one.

-- 
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: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-09-27  6:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25  9:47 [Qemu-devel] [PATCH] spapr: move registration of "host" CPU core type to machine code Greg Kurz
2017-09-25 13:41 ` Igor Mammedov
2017-09-25 15:48   ` Greg Kurz
2017-09-25 21:47     ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-09-27 12:19       ` Igor Mammedov
2017-09-27 15:32         ` Greg Kurz
2017-09-29  6:41           ` Igor Mammedov
2017-09-29  7:25             ` Greg Kurz
2017-09-26  2:57 ` [Qemu-devel] " David Gibson
2017-09-26  7:19   ` Greg Kurz
2017-09-26  8:29     ` Igor Mammedov
2017-09-27  6:39       ` David Gibson
2017-09-27 12:11         ` Igor Mammedov
2017-09-28  4:01           ` David Gibson
2017-09-27  6:21     ` David Gibson [this message]
2017-09-27  8:13       ` Igor Mammedov
2017-09-27 11:49       ` [Qemu-devel] [RFC] ppc: define spapr core types statically Igor Mammedov
2017-09-27 16:18         ` Greg Kurz
2017-09-28  4:22           ` David Gibson
2017-09-29  6:44           ` Igor Mammedov

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=20170927062143.GN12504@umbus \
    --to=david@gibson.dropbear.id.au \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=groug@kaod.org \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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).