From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: CPU reset vs DeviceState reset
Date: Mon, 2 Mar 2020 12:45:51 -0500 [thread overview]
Message-ID: <20200302174551.GK4440@habkost.net> (raw)
In-Reply-To: <CAFEAcA9rQ4_o53zfsdcGZWse3eYWksYJdYHLeUFhq6TcBX3_zw@mail.gmail.com>
My impression is that this is just historical legacy, but I'm not
sure how much work a conversion to the new system would require.
I see lots of cpu_reset() calls scattered around the code.
To make it worse, TYPE_CPU do have a DeviceClass::reset method
implemented, but cpu_reset() won't call it because it bypasses
the Device reset system completely. I will do some git
archaeology work to try to find out why the code is this way.
On Mon, Mar 02, 2020 at 05:20:33PM +0000, Peter Maydell wrote:
> Hi; I've just noticed that although TYPE_CPU is a subclass of
> TYPE_DEVICE, it seems to implement its own reset method
> ('reset' field in CPUClass struct) rather than just using the
> DeviceClass's 'reset'.
>
> Is there a reason for doing this, or is it just historical legacy
> from TYPE_CPU originally not being a subclass of TYPE_DEVICE?
>
> I ask because I'd like to be able to use 3-phase reset in the Arm
> CPU, and I'm wondering whether it would be better to make TYPE_CPU
> just use Device's reset system, or to treat TYPE_CPU as its own
> base class and implement Resettable there. The former seems more
> straightforward, unless I'm missing something that means we
> really do need to have the reset method be different.
>
> thanks
> -- PMM
>
--
Eduardo
next prev parent reply other threads:[~2020-03-02 17:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 17:20 CPU reset vs DeviceState reset Peter Maydell
2020-03-02 17:25 ` Peter Maydell
2020-03-02 17:45 ` Eduardo Habkost [this message]
2020-03-02 18:19 ` Philippe Mathieu-Daudé
2020-03-02 18:42 ` Peter Maydell
2020-03-02 21:42 ` Eduardo Habkost
2020-03-02 18:41 ` Peter Maydell
2020-03-02 21:40 ` Eduardo Habkost
2020-03-02 21:55 ` Peter Maydell
2020-03-02 22:12 ` 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=20200302174551.GK4440@habkost.net \
--to=ehabkost@redhat.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 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.