Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ARM: Make CPU_DCACHE_DISABLE depend on !SMP
Date: Thu, 08 Jan 2015 23:10:47 +0100	[thread overview]
Message-ID: <3495606.iOQOj3bxPc@wuerfel> (raw)
In-Reply-To: <CADtm3G5Ebf6WkHG3fyiY3pm7fEBBNoW3DDEEwpvBXGj0fVE6jQ@mail.gmail.com>

On Thursday 08 January 2015 13:54:29 Gregory Fong wrote:
> On Thu, Jan 8, 2015 at 7:53 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> > Le 08/01/2015 03:52, Russell King - ARM Linux a ?crit :
> >> On Thu, Jan 08, 2015 at 09:33:05AM +0100, Arnd Bergmann wrote:
> >>>
> >>> We stumbled on this a while back when Kaixu was trying to fix allmodconfig
> >>> builds to run on real hardware, but never submitted it in the end when
> >>> Russell didn't like some of the other parts required for that to work.
> >>>
> >>> This one clearly makes sense independently.
> >>
> >> What about platforms where exclusives to strongly ordered memory do work?
> >
> > Do we have a comprehensive list of these platforms?
> 
> I haven't had a chance to go through all of the TRMs, but section
> A3.4.5 of the ARMv7-A ARM says:
> 
> "It is IMPLEMENTATION DEFINED whether LDREX and STREX operations can
> be performed to a memory region
> with the Device or Strongly-ordered memory attribute. Unless the
> implementation documentation explicitly
> states that LDREX and STREX operations to a memory region with the
> Device or Strongly-ordered attribute are
> permitted, the effect of such operations is UNPREDICTABLE ."
> 
> From 6.4.5 "Synchronization primitives" in the Cortex-A15 TRM:
> 
> "Use of synchronization primitives on addresses in regions marked as
> Strongly-ordered or
> Device is UNPREDICTABLE in the ARMv7-A Architecture. Code that makes
> such accesses
> is not portable."
> 
> It looks like this is not generally permissible for ARMv7, maybe
> someone else can check the other versions.  Perhaps it would make
> sense to disallow disabling the D-cache for !SMP in general and
> special-case those architectures which do support exclusives to
> strongly ordered memory.

Too many negations, I assume you meant on SMP rather than !SMP.

My guess is that any implementation that has working LDREX/STREX
on uncached memory does not support SMP, because these instructions
tend to be implemented through the cache coherency logic on SMP
systems but could be implemented more easily without a dcache
on uniprocessor cores.

	Arnd

  reply	other threads:[~2015-01-08 22:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08  2:11 [RFC] ARM: Make CPU_DCACHE_DISABLE depend on !SMP Florian Fainelli
2015-01-08  8:33 ` Arnd Bergmann
2015-01-08 11:52   ` Russell King - ARM Linux
2015-01-08 15:53     ` Florian Fainelli
2015-01-08 21:54       ` Gregory Fong
2015-01-08 22:10         ` Arnd Bergmann [this message]
2015-01-08 22:13           ` Russell King - ARM Linux
2015-01-08 22:25             ` Florian Fainelli
2015-01-09 16:16               ` Russell King - ARM Linux
2015-01-09 18:35                 ` Florian Fainelli
2015-01-08 22:11         ` Gregory Fong
2015-01-09 17:57 ` Rabin Vincent

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=3495606.iOQOj3bxPc@wuerfel \
    --to=arnd@arndb.de \
    --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