qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	qemu-ppc <qemu-ppc@nongnu.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thiago Jung Bauermann" <bauerman@linux.ibm.com>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [PATCH] cpu: Add starts_halted() method
Date: Wed, 8 Jul 2020 18:45:57 +0200	[thread overview]
Message-ID: <da4b5a4c-7a72-6e07-b423-1487ad358c31@redhat.com> (raw)
In-Reply-To: <20200708152540.GZ7276@habkost.net>

On 7/8/20 5:25 PM, Eduardo Habkost wrote:
> On Wed, Jul 08, 2020 at 02:14:03PM +0100, Peter Maydell wrote:
>> On Wed, 8 Jul 2020 at 12:12, David Gibson <david@gibson.dropbear.id.au> wrote:
>>> On Wed, Jul 08, 2020 at 10:38:29AM +0200, Philippe Mathieu-Daudé wrote:
>>>> Class boolean field certainly sounds better, but I am not sure this
>>>> is a property of the machine. Rather the arch? So move the field
>>>> to CPUClass? Maybe not, let's discuss :)
>>>
>>> It is absolutely a property of the machine.  e.g. I don't think we
>>> want this for powernv.  pseries is a bit of a special case since it is
>>> explicitly a paravirt platform.  But even for emulated hardware, the
>>> board can absolutely strap things so that cpus do or don't start
>>> immediately.
>>
>> It's a property of the individual CPU, I think. One common setup
>> for Arm systems is that the primary CPU starts powered up but
>> the secondaries all start powered down.
> 
> Both statements can be true.  It can be a property of the
> individual CPU (although I'm not convinced it has to), but it
> still needs to be controlled by the machine.

From what said Peter, I understand this is a property of the
chipset. Chipsets are modelled unevenly.

IIUC QEMU started with single-core CPUs.
CPUState had same meaning for 'core' or 'cpu', 1-1 mapping.

Then multicore CPUs could be easily modelled using multiple
single-core CPUs, usually created in the machine code.

Then we moved to SoC models, creating the cores in the SoC.
Some SoCs have array of cores, eventually heterogeneous
(see the ZynqMP). We have containers of CPUState.

On an ARM-based SoC, you might have the first core started
(as said Peter) or not.

BCM2836 / BCM2837 and ZynqMP start will all ARM cores off.
On the BCM chipsets, a DSP core will boot the ARM cores.
On the ZynqMP, a MicroBlaze core boots them.
As QEMU doesn't models heterogeneous architectures, we start
modelling after the unmodelled cores booted us, so either one
or all cores on.

In this case, we narrowed down the 'start-powered-off' field
to the SoC, which happens to be how ARM SoCs are modelled.


Chipsets providing a JTAG interface can have a SRST signal,
the "system reset". When a JTAG probe is attached, it can
keeps the whole chipset in a reset state. This is equivalent
to QEMU '-S' mode (single step mode).


I don't know about pseries hardware, but if this is 'explicit
to paravirt platform', then I expect this to be the same with
other accelerators/architectures.

If paravirtualized -> cores start off by default. Let the
hypervisor start them. So still a property of the CPUState
depending on the accelerator used?


Regards,

Phil.



  parent reply	other threads:[~2020-07-08 22:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 20:43 [PATCH] cpu: Add starts_halted() method Thiago Jung Bauermann
2020-07-07 21:49 ` Eduardo Habkost
2020-07-07 23:28   ` Thiago Jung Bauermann
2020-07-08  8:38     ` Philippe Mathieu-Daudé
2020-07-08 10:00       ` David Gibson
2020-07-08 13:14         ` Peter Maydell
2020-07-08 15:25           ` Eduardo Habkost
2020-07-08 15:32             ` Peter Maydell
2020-07-08 16:03               ` Eduardo Habkost
2020-07-08 17:09                 ` Peter Maydell
2020-07-08 17:36                   ` Eduardo Habkost
2020-07-08 20:11                     ` Peter Maydell
2020-07-08 21:32                       ` Eduardo Habkost
2020-07-09  3:05                         ` Thiago Jung Bauermann
2020-07-09  3:26                           ` Thiago Jung Bauermann
2020-07-09 10:24                             ` Philippe Mathieu-Daudé
2020-07-10 20:02                               ` Thiago Jung Bauermann
2020-07-10 20:17                                 ` Eduardo Habkost
     [not found]                           ` <87k0zdm63s.fsf@linaro.org>
2020-07-10 20:16                             ` Thiago Jung Bauermann
2020-07-11 17:55                               ` Alex Bennée
2020-07-08 16:45             ` Philippe Mathieu-Daudé [this message]
2020-07-08 21:39               ` Eduardo Habkost
2020-07-09  5:11                 ` Philippe Mathieu-Daudé
2020-07-09  9:54                   ` Greg Kurz
2020-07-09 10:18                     ` Philippe Mathieu-Daudé
2020-07-09 10:55                       ` Greg Kurz
2020-07-09 12:21                         ` Philippe Mathieu-Daudé
2020-07-09 13:13                           ` Greg Kurz
2020-07-09 13:19                             ` Philippe Mathieu-Daudé
2020-07-09 13:40                             ` Peter Maydell

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=da4b5a4c-7a72-6e07-b423-1487ad358c31@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=bauerman@linux.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /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).