All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: Andrew Baumann <Andrew.Baumann@microsoft.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Grégory ESTRADE" <gregory.estrade@gmail.com>,
	"Stefan Weil" <sw@weilnetz.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 6/7] bcm2836: add bcm2836 soc device
Date: Tue, 12 Jan 2016 15:14:36 -0800	[thread overview]
Message-ID: <CAPokK=rT2LcLQk0JwpXrBNJ-v418asBZjzz+zjS_OzwhfONVZw@mail.gmail.com> (raw)
In-Reply-To: <BLUPR0301MB20349F632BDD3C52631961259ECA0@BLUPR0301MB2034.namprd03.prod.outlook.com>

On Tue, Jan 12, 2016 at 2:56 PM, Andrew Baumann
<Andrew.Baumann@microsoft.com> wrote:
> Hi Peter,
>
> Thanks again for the reviews.
>
>> From: Peter Crosthwaite [mailto:crosthwaitepeter@gmail.com]
>> Sent: Monday, 11 January 2016 19:57
>> On Thu, Dec 31, 2015 at 04:31:33PM -0800, Andrew Baumann wrote:
>> > +    /* TODO: probably shouldn't be using smp_cpus here */
>>
>> I agree. I have started ignoring smp_cpus completely for new ARM SoCs,
>> as if you change the number of CPUs for a SoC, it is not that SoC
>> anymore. The virt platform is suitable for CPU scalability, whereas
>> with ARM SoCs, cpu # variation is invalid.
>>
>> > +    assert(smp_cpus <= BCM2836_NCPUS);
>> > +    for (n = 0; n < smp_cpus; n++) {
>>
>> So can we just use BCM2836_NCPUS here as the loop bound? Any
>> conditionals out there check the existance of CPUs can be removed or
>> promoted to assert() as a BCM2836 must always have 4 CPUs.
>
> I'd love to do that, but there's at least one good reason to respect the -smp parameter and not start all the CPUs: with full-system emulation, qemu is noticeably faster emulating a single-core target than multi-core. E.g., Linux boots fine with -smp 1 (it fails to start the other CPUs but proceeds with just one), and many users will be better off running it this way, so I definitely don't want to break that.
>

What are the secondary CPUs doing in this case? In most systems they
end up penning on a WFI/WFE. Is Linux actually trying to do the SMP
bringup - are you are getting a secondary entry point?

If not and it is just a busy wait killing perf, start-powered-off
property might help. Is the firmware responsible for secondary-penning
an actual busy-wait or does it involve power-control periphs etc?

Regards,
Peter

> I tried always initing all 4 CPUs in bcm2836_init, and only starting a configurable number (based on a property) in realize. However, arm cpu_exec_init already adds the cpu to the global list of all CPUs, and if you try to start the system in this state it quickly segfaults on uninitialized state in the CPU, so it seems we shouldn't even init CPUs that won't later be started. However, I can't refer to properties in the _init method, which is why I'm stuck using the smp_cpus global.
>
> If you have a better suggestion, I'm all ears :) Would it make sense to defer calling init() until the realize method, when we can access a property?
>
> Cheers,
> Andrew

  reply	other threads:[~2016-01-12 23:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01  0:31 [Qemu-devel] [PATCH v3 0/7] Raspberry Pi 2 support Andrew Baumann
2016-01-01  0:31 ` [Qemu-devel] [PATCH v3 1/7] bcm2835_mbox: add BCM2835 mailboxes Andrew Baumann
2016-01-01  0:31 ` [Qemu-devel] [PATCH v3 2/7] bcm2835_property: add bcm2835 property channel Andrew Baumann
2016-01-12  3:53   ` Peter Crosthwaite
2016-01-01  0:31 ` [Qemu-devel] [PATCH v3 3/7] bcm2835_ic: add bcm2835 interrupt controller Andrew Baumann
2016-01-01  0:31 ` [Qemu-devel] [PATCH v3 4/7] bcm2835_peripherals: add rollup device for bcm2835 peripherals Andrew Baumann
2016-01-06  2:13   ` Alistair Francis
2016-01-06  6:07     ` Andrew Baumann
2016-01-06 13:32       ` Peter Crosthwaite
2016-01-06 20:04         ` Alistair Francis
2016-01-01  0:31 ` [Qemu-devel] [PATCH v3 5/7] bcm2836_control: add bcm2836 ARM control logic Andrew Baumann
2016-01-12  3:54   ` Peter Crosthwaite
2016-01-01  0:31 ` [Qemu-devel] [PATCH v3 6/7] bcm2836: add bcm2836 soc device Andrew Baumann
2016-01-12  3:56   ` Peter Crosthwaite
2016-01-12 22:56     ` Andrew Baumann
2016-01-12 23:14       ` Peter Crosthwaite [this message]
2016-01-13  0:09         ` Andrew Baumann
2016-01-01  0:31 ` [Qemu-devel] [PATCH v3 7/7] raspi: add raspberry pi 2 machine Andrew Baumann
2016-01-12  3:57   ` Peter Crosthwaite
2016-01-12 23:53     ` Andrew Baumann
2016-01-13  0:43       ` Peter Crosthwaite
2016-01-14 23:04         ` Andrew Baumann
2016-01-14 23:34           ` Peter Crosthwaite
2016-01-15  0:43             ` Andrew Baumann
2016-01-15  1:09               ` Peter Crosthwaite
2016-01-16  0:04         ` Andrew Baumann

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='CAPokK=rT2LcLQk0JwpXrBNJ-v418asBZjzz+zjS_OzwhfONVZw@mail.gmail.com' \
    --to=crosthwaitepeter@gmail.com \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=gregory.estrade@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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.