linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: versatile: don't mark pen as __INIT
Date: Mon, 17 Jun 2013 11:10:50 +0100	[thread overview]
Message-ID: <20130617101050.GD6809@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <alpine.LFD.2.03.1306111136060.18597@syhkavp.arg>

On Tue, Jun 11, 2013 at 04:43:59PM +0100, Nicolas Pitre wrote:
> On Tue, 11 Jun 2013, Mark Rutland wrote:
> 
> > On Tue, Jun 11, 2013 at 12:24:41AM +0100, Russell King - ARM Linux wrote:
> > > On Mon, Jun 10, 2013 at 04:07:24PM +0100, Mark Rutland wrote:
> > > > When booting fewer cores than are physically present on a versatile
> > > > platform (e.g. when passing maxcpus=N on the command line), some
> > > > secondary cores may remain in the holding pen, which is marked __INIT.
> > > > Late in the boot process, the memory comprising the holding pen will be
> > > > released to the kernel for more general use, and may be overwritten with
> > > > arbitrary data, which can cause the held secondaries to start behaving
> > > > unpredictably. This can lead to all manner of odd behaviour from the
> > > > kernel.
> > > > 
> > > > Instead don't mark the section as __INIT. This means we can't reuse the
> > > > pen memory, but we won't get secondaries corrupting the rest of the
> > > > kernel.
> > > 
> > > __CPUINIT is appropriate here; __CPUINIT will be kept around if you have
> > > hotplug CPU suport, but if you don't it will be discarded after all
> > > secondary CPUs have booted.  And without hotplug CPU, you can't ask
> > > for the offline CPUs to be onlined.
> > 
> > Since 384a290283: "ARM: gic: use a private mapping for CPU target interfaces",
> > each CPU's gic_cpu_map entry is initialised to 0xff, so a call to
> > gic_raise_softirq will target *all* CPUs attached to the GIC if one of the CPUs
> > targetted has not been initialised.
> > 
> > Thus any call to versatile_boot_secondary will wake up *all* secondaries
> > physically present, throwing them all into the pen. If we use a subset of these
> > (e.g. from having "maxcpus=N" on the command line), some will be left in the
> > pen, even though we didn't ask for them explicitly. This will happen with or
> > without CPU_HOTPLUG.
> > 
> > Another option would be to add an optional description of a CPU's gic id to the
> > dt, which would allow us to avoid throwing these secondaries into the pen in
> > the first place.
> 
> You mean adding extra description in DT for hardware information that is 
> already perfectly self-discoverable, plus the code to parse it, just for 
> those rare cases where someone might want to use maxcpus=N on the kernel 
> cmdline while CONFIG_CPU_HOTPLUG=n ?
> 
> IMHO removing __CPUINIT from the holding pen is probably the preferable 
> alternative.

Ok, could I take that as your ack on the original patch?

Thanks,
Mark.

  reply	other threads:[~2013-06-17 10:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 15:07 [PATCH] arm: versatile: don't mark pen as __INIT Mark Rutland
2013-06-10 15:35 ` Jonathan Austin
2013-06-10 18:39 ` Stephen Boyd
2013-06-10 18:52   ` Mark Rutland
2013-06-10 19:09     ` Stephen Boyd
2013-06-10 19:22       ` Stephen Boyd
2013-06-10 20:39         ` Lorenzo Pieralisi
2013-06-10 21:23           ` Stephen Boyd
2013-06-10 23:24 ` Russell King - ARM Linux
2013-06-11  9:04   ` Mark Rutland
2013-06-11 15:43     ` Nicolas Pitre
2013-06-17 10:10       ` Mark Rutland [this message]
2013-06-17 11:25         ` Nicolas Pitre
2013-06-20 14:10           ` Mark Rutland
2013-06-18 13:26 ` Jon Medhurst (Tixy)
2013-06-18 15:13   ` Russell King - ARM Linux
2013-06-18 15:28     ` Jon Medhurst (Tixy)

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=20130617101050.GD6809@e106331-lin.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --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).