From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Missing volatile in hard_smp_processor_id.
Date: Tue, 28 Jun 2011 00:16:22 +0100 [thread overview]
Message-ID: <20110627231622.GB6222@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4E090C4D.1000309@xenomai.org>
On Tue, Jun 28, 2011 at 01:03:41AM +0200, Gilles Chanteperdrix wrote:
> I know hard_smp_processor_id() disappeared after Linux 2.6.37, but this
> may be interesting for the stable and long term support branches. This
> issue is suspected to cause random segmentation faults on OMAP4 with
> CONFIG_HIGHMEM on.
1. hard_smp_processor_id() was only used in the platform hotplug code
to verify that the intended CPU number was the same as the hardware
CPU number. These checks were removed by bbc81fd (ARM: CPU hotplug:
remove bug checks in platform_cpu_die()).
2. OMAP - and as a general principle, no one else - does not and should
not make use of this macro. CPU numbers within Linux are 'logical' and
may not correspond with the hardware CPU number. However, there are
three places where we make the assumption that they're the same:
a) CPU bringup code
b) GIC cross-call code
c) Hotplug code
Even these places make no reference to the MPIDR register - the only
place which does is the very early assembly code.
_Anything_ which uses hard_smp_processor_id() is probably buggy. We have
get_cpu()..put_cpu() to deal with preemption etc, and in any case the
logical CPU number should always be used for indexing data structures.
Finally, there is no code merged into mainline which mis-uses this
macro.
So, all in all I see no reason to submit patches to stable trees for
something which doesn't cause a problem in those trees themselves.
prev parent reply other threads:[~2011-06-27 23:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 23:03 Missing volatile in hard_smp_processor_id Gilles Chanteperdrix
2011-06-27 23:16 ` Russell King - ARM Linux [this message]
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=20110627231622.GB6222@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