qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jia Liu <proljc@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v8 01/16] target-or32: Add target stubs and QOM cpu
Date: Thu, 05 Jul 2012 17:31:59 +0200	[thread overview]
Message-ID: <4FF5B36F.2000604@suse.de> (raw)
In-Reply-To: <4FF59717.2030901@redhat.com>

Am 05.07.2012 15:31, schrieb Paolo Bonzini:
> Il 05/07/2012 15:22, Andreas Färber ha scritto:
>>>> +static void openrisc_any_initfn(Object *obj)
>>>> +{
>>>> +    OpenRISCCPU *cpu = OPENRISC_CPU(obj);
>>>> +
>>>> +    set_feature(cpu, OPENRISC_FEATURE_OB32S);
>>>> +    set_feature(cpu, OPENRISC_FEATURE_OF32S);
>>>> +
>>>> +    cpu_reset(CPU(cpu));
>>>> +}
>> Paolo, could class_base_init or something help with this pattern of
>> needing to do something in every derived initfn?
> 
> I guess what you're looking for is some instance_post_init that is
> called at init time after instance_init?

Sort of. The pattern I was seeing is parent initializes something, child
modifies it, some action is performed on it.

Here we can get away by deferring the common action to realize stage,
just like we did for arm. My reasoning was that it's better to reset in
realizefn for reproducible behavior over system_reset. Not sure if we
can always escape to such a late stage, but we can worry about that when
we have a concrete use case. :)

Andreas

>> On the other hand I think we should move cpu_reset() into the realizefn
>> instead, that would avoid this issue here.
> 
> Yep.
> 
> Paolo

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-07-05 15:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1341110730-444-1-git-send-email-proljc@gmail.com>
     [not found] ` <1341110730-444-9-git-send-email-proljc@gmail.com>
2012-07-03 18:48   ` [Qemu-devel] [PATCH v8 08/16] target-or32: Add instruction translation Blue Swirl
2012-07-04  2:23     ` Jia Liu
2012-07-04 23:59       ` Jia Liu
2012-07-05 18:45         ` Blue Swirl
2012-07-06  0:23           ` Jia Liu
     [not found] ` <1341110730-444-2-git-send-email-proljc@gmail.com>
2012-07-05 13:22   ` [Qemu-devel] [PATCH v8 01/16] target-or32: Add target stubs and QOM cpu Andreas Färber
2012-07-05 13:31     ` Paolo Bonzini
2012-07-05 15:31       ` Andreas Färber [this message]
2012-07-09  7:08     ` Jia Liu

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=4FF5B36F.2000604@suse.de \
    --to=afaerber@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=proljc@gmail.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 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).