From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 2/2] ARM: SMP support for mach-virt
Date: Tue, 4 Dec 2012 16:35:55 +0000 [thread overview]
Message-ID: <20121204163555.GH14363@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20121204161113.GT23368@mudshark.cambridge.arm.com>
On Tue, Dec 04, 2012 at 04:11:13PM +0000, Will Deacon wrote:
> On Tue, Dec 04, 2012 at 02:37:25PM +0000, Russell King - ARM Linux wrote:
> > On Tue, Dec 04, 2012 at 01:40:10PM +0000, Will Deacon wrote:
> > > On Tue, Dec 04, 2012 at 01:33:26PM +0000, Russell King - ARM Linux wrote:
> > > > The memory that these 'offline' CPUs is executing then gets overwritten,
> > > > and that's game over for those CPUs.
> > >
> > > That's not strictly true. The device-tree passed to the kernel should have a
> > > /memreserve/ entry for the SMP pen to avoid exactly this scenario. In real
> > > hardware, this still sucks because you have spinning CPUs burning up power
> > > but that's not such a problem with a virtual platform.
> >
> > Umm. So let's see. If I'm running v3.6 stock kernel and want to kexec
> > into a v3.7 stock kernel. The SMP pen is part of the v3.6 kernel, which
> > will be located at 32K into the RAM. The v3.7 kernel will also want to
> > occupy the same place. At some point you have to overwrite the v3.6
> > kernel with the v3.7 kernel image.
>
> If the 3.6 kernel didn't bring those CPUs online, they will sit in the
> bootloader pen (out of the way of the kernel image) rather than the kernel
> pen so I don't think there will be a problem.
... or in the case of sane hardware, the CPUs will be powered down.
> The problem you're describing actually happens when the 3.6 kernel onlines
> all of the CPUs, because now it has no way to hotplug them off safely. This
> is also an issue with non-virtualised hardware but we could solve it for the
> virtual platform by having a para-virtualised device for doing CPU hotplug.
That situation exists on ARM Ltd platforms where there's no way to
properly return them back to the boot loader. We should not be forcing
this ARM Ltd platform deficiency onto other platforms as part of a
"design", even virtual platforms.
Most other real-world platforms out there have a way to power off the
unused secondary CPUs - Tegra and OMAP both do.
As far as virtual platforms go, how secondary CPUs are dealt with should
already have been solved; I really can't imagine that KVM and XEN on
other architectures end up with CPUs spinning in a loop inside the guest
kernel waiting for the guest OS to ask them to boot. Neither can I imagine
that KVM and XEN end up with CPUs spinning in the guest OS when CPUs are
asked to be hot-unplugged.
> > That happens _before_ the DT has been parsed, so any memreserve stuff
> > will be ignored. And it's at that point that your "offline" secondary
> > CPUs will have their instructions overwritten.
> >
> > That's fine if the pen ends up being at the same place but that's not
> > something we guarantee.
>
> Having CPUs in limbo between the bootloader the being online in the kernel
> is something we should just avoid. Isn't that pen __init anyway?
If you have hotplug enabled, all the secondary bringup code should be
in the __cpuinit and __cpuinitdata sections.
next prev parent reply other threads:[~2012-12-04 16:35 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-03 17:52 [RFC PATCH 0/2] Add support for a fake, para-virtualised machine Will Deacon
2012-12-03 17:52 ` [RFC PATCH 1/2] ARM: Dummy Virtual Machine platform support Will Deacon
2012-12-03 17:52 ` [RFC PATCH 2/2] ARM: SMP support for mach-virt Will Deacon
2012-12-03 21:55 ` Rob Herring
2012-12-04 12:40 ` Will Deacon
2012-12-04 13:33 ` Russell King - ARM Linux
2012-12-04 13:40 ` Will Deacon
2012-12-04 14:37 ` Russell King - ARM Linux
2012-12-04 16:11 ` Will Deacon
2012-12-04 16:35 ` Russell King - ARM Linux [this message]
2012-12-04 17:24 ` Will Deacon
2012-12-04 19:37 ` Arnd Bergmann
2012-12-04 16:45 ` Rob Herring
2012-12-04 17:16 ` Will Deacon
2012-12-04 17:23 ` Rob Herring
2012-12-04 17:24 ` Marc Zyngier
2012-12-04 17:30 ` Will Deacon
2012-12-11 16:04 ` Stefano Stabellini
2012-12-11 16:09 ` Will Deacon
2012-12-11 16:34 ` Stefano Stabellini
2012-12-11 16:41 ` Ian Campbell
2012-12-11 16:43 ` Will Deacon
2012-12-11 17:14 ` Stefano Stabellini
2012-12-11 17:24 ` Will Deacon
2012-12-04 18:10 ` Nicolas Pitre
2012-12-03 21:54 ` [RFC PATCH 0/2] Add support for a fake, para-virtualised machine Rob Herring
2012-12-04 12:30 ` Will Deacon
2012-12-04 14:12 ` Rob Herring
2012-12-04 17:00 ` Nicolas Pitre
2012-12-04 17:11 ` Will Deacon
2012-12-04 18:02 ` Nicolas Pitre
2012-12-04 18:14 ` Will Deacon
2012-12-05 14:52 ` Catalin Marinas
2012-12-05 15:07 ` Nicolas Pitre
2012-12-05 15:10 ` Will Deacon
2012-12-05 15:07 ` Will Deacon
2012-12-05 15:15 ` Catalin Marinas
2012-12-11 16:19 ` Stefano Stabellini
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=20121204163555.GH14363@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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).