From: "Andreas Färber" <afaerber@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Paul Brook <paul@codesourcery.com>,
Guan Xuetao <gxt@mprc.pku.edu.cn>,
qemu-devel@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [RFC 00/20] generic_cpu_init() and generic_cpu_create() functions
Date: Tue, 18 Dec 2012 23:57:58 +0100 [thread overview]
Message-ID: <50D0F4F6.4090500@suse.de> (raw)
In-Reply-To: <1355861053-11460-1-git-send-email-ehabkost@redhat.com>
Am 18.12.2012 21:03, schrieb Eduardo Habkost:
> This is just a proof of concept, of how I think we could gradually move to
> make the architectures share CPU creation/initialization code.
>
> I have implemented a quick cpu_realize() function, just for testing, while we
> don't have qdev realizefn support implemented.
>
> I have converted the following targets to use generic_cpu_init(): openrisc, arm,
> m68k, unicore32.
>
> To support other architectures with additional CPU lookup requirements
> (automatically adding "<arch>-cpu" suffix, or CPU model aliases), we can simply
> add fields to CPUClass for the target-specific behavior, that can be used by
> generic_cpu_create().
Without having looked at the series yet, what I have been experiencing
the last three rounds of CPU subclass conversions is that a per-target
name -> ObjectClass mapping works pretty well to abstract target'isms.
Therefore I was gonna pursue a CPUClass::find_by_name() hook or so as
generalization.
That would result in a name -> class, object_new(name(class)),
env->cpu_model_str = name, realize scheme. That would leave us with the
issues of QOM/device realization and of cpu_copy(). realize would in my
mind allow us to register a realizefn in CPU class_init, automatically
invoked by object_new, the targetted recursive realization allowing to
drop any realize call from cpu_init() and with a couple explicit
realization calls in *-user allowing us to repurpose cpu_init() for
creation. But maybe I'm overlooking something or we're looking at
different time frames. :-)
Andreas
> We can also extend generic_cpu_init() later to support
> parsing of "+feature,-feature" feature strings, to set properties on the CPU
> objects, like on x86.
>
> Note that this series is completely untested except for checking if the code
> compiles. I am just using the series as a way to demonstrate what I have in
> mind.
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-12-18 22:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 20:03 [Qemu-devel] [RFC 00/20] generic_cpu_init() and generic_cpu_create() functions Eduardo Habkost
2012-12-18 20:03 ` [Qemu-devel] [RFC 01/20] qemu-common.h: "use" env parameter in no-op version of qemu_init_vcpu() Eduardo Habkost
2012-12-18 20:03 ` [Qemu-devel] [RFC 02/20] cpu: introduce CPU_GET_ENV macros Eduardo Habkost
2012-12-18 20:03 ` [Qemu-devel] [RFC 03/20] cpu: make cpu_init return CPUState QOM object Eduardo Habkost
2012-12-18 20:03 ` [Qemu-devel] [RFC 04/20] cpu: replace trivial old_cpu_init functions Eduardo Habkost
2012-12-18 20:03 ` [Qemu-devel] [RFC 05/20] alpha: convert cpu_init to QOM Eduardo Habkost
2012-12-18 20:03 ` [Qemu-devel] [RFC 06/20] m68k: " Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 07/20] target-unicore32: " Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 08/20] cpu: move cpu_model_str to CPUState Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 09/20] cpu: introduce cpu_realize() Eduardo Habkost
2012-12-18 23:13 ` Andreas Färber
2012-12-18 20:04 ` [Qemu-devel] [RFC 10/20] cpu: introduce generic_cpu_init() & generic_cpu_create() functions Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 11/20] target-openrisc: implement CPU realize() method Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 12/20] hw/openrisc_sim.c: coding style/indentation fix Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 13/20] target-openrisc: replace cpu_openrisc_init() with generic_cpu_init() Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 14/20] target-arm: move final steps of cpu_arm_init() to realize function Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 15/20] target-arm: replace cpu_arm_init() with generic_cpu_init() Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 16/20] target-m68k: move final steps of cpu_m68k_init() to realize function Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 17/20] target-m68k: replace cpu_m68k_init() with generic_cpu_init() Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 18/20] target-unicore32: move final steps of uc32_cpu_init() to realize function Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 19/20] target-unicore32: replace uc32_cpu_init() with generic_cpu_init() Eduardo Habkost
2012-12-18 20:04 ` [Qemu-devel] [RFC 20/20] cpu: convert cpu_copy() to QOM Eduardo Habkost
2012-12-18 22:57 ` Andreas Färber [this message]
2012-12-19 0:08 ` [Qemu-devel] [RFC 00/20] generic_cpu_init() and generic_cpu_create() functions Eduardo Habkost
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=50D0F4F6.4090500@suse.de \
--to=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=imammedo@redhat.com \
--cc=paul@codesourcery.com \
--cc=peter.maydell@linaro.org \
--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 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).