linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: L1 & L2 cache flush sequence on CortexA5 MPcore w.r.t low power modes
Date: Tue, 15 May 2012 19:17:37 +0100	[thread overview]
Message-ID: <20120515181737.GM10057@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20120515163618.GH13860@n2100.arm.linux.org.uk>

Hi Russell,

On Tue, May 15, 2012 at 05:36:18PM +0100, Russell King - ARM Linux wrote:
> I repeat: what happens in this situation on A9:
> 
> 	- clean cache
> 	- cache speculatively prefetches data from another core

If this prefetching occurs then either:

	(a) The line is clean (no problem)

	(b) Another core has written some data and we end up (speculatively)
	    loading dirty lines

Case (b) is only a problem if we actually commit to using the data later on.

> 	- clear SCTLR.C
> 	- _this_ core accesses the address associated with that prefetched
> 	  data

Yes. At this point it is cpu-specific whether or not we hit our dirty lines
from above. On A9, we will get the stale data from memory. However, this is
exactly the same situation we would find ourselves in if we tried to access
dirty data held in any cache with our SCTLR.C bit cleared. We're no longer
coherent at this stage, so need to avoid accessing shared data.

> _That_ is a data corruption issue - as soon as SCTLR.C is cleared, the CPUs
> view of data in memory _changes_, and is only restored to what it should
> be when the dirty cache lines are finally flushed out of the cache.  And
> then, hey presto, the data magically changes again.

Well we still can't see dirty data in any of the other L1 caches, so our view
of memory is going to be constantly out of date. The tricky bit is ensuring
that we don't rely on data being written by anybody else (and if we write
data ourself, we need to make sure it's suitably aligned so as not to get
clobbered by evictions from the other caches).

Will

  parent reply	other threads:[~2012-05-15 18:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14  7:03 L1 & L2 cache flush sequence on CortexA5 MPcore w.r.t low power modes Murali N
2012-05-14 15:50 ` Lorenzo Pieralisi
2012-05-14 15:58   ` Russell King - ARM Linux
2012-05-14 16:21     ` Lorenzo Pieralisi
2012-05-14 16:39       ` Russell King - ARM Linux
2012-05-14 17:15         ` Lorenzo Pieralisi
2012-05-15  9:25           ` Murali N
2012-05-15  9:40           ` Russell King - ARM Linux
2012-05-15 10:09             ` Lorenzo Pieralisi
2012-05-15 10:15               ` Russell King - ARM Linux
2012-05-15 16:28                 ` Lorenzo Pieralisi
2012-05-15 16:36                   ` Russell King - ARM Linux
2012-05-15 17:05                     ` Lorenzo Pieralisi
2012-09-19  8:55                       ` Antti P Miettinen
2012-09-20  9:54                         ` Lorenzo Pieralisi
2012-09-20 21:17                           ` Antti P Miettinen
2012-09-23 21:32                             ` Antti P Miettinen
2013-02-22  9:04                               ` Antti P Miettinen
2013-02-22  9:39                                 ` Lorenzo Pieralisi
2013-02-23 20:41                                   ` Antti P Miettinen
2013-02-25 13:36                                     ` Lorenzo Pieralisi
2012-05-15 18:17                     ` Will Deacon [this message]
2012-05-17  5:01                       ` Murali N
2012-05-17  7:30                         ` Shilimkar, Santosh
2013-12-24 17:52       ` Antti Miettinen
2014-01-06 12:43         ` Lorenzo Pieralisi

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=20120515181737.GM10057@mudshark.cambridge.arm.com \
    --to=will.deacon@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).