From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx6: fix v7_invalidate_l1 by adding I-Cache invalidation
Date: Tue, 3 Jan 2012 17:41:23 +0000 [thread overview]
Message-ID: <20120103174123.GE2914@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20111231092148.GG12182@S2100-06.ap.freescale.net>
On Sat, Dec 31, 2011 at 05:21:49PM +0800, Shawn Guo wrote:
> I was ever told by Russell that ARM_ARM permits that cache holds random
> data out of a power-up. But I'm not sure if the validity mark can also
> be randomized.
It's worse than that: the ARM ARM says that some caches may require a
CPU specific sequence to initialize them after power-up. It's also
implemenation defined whether entries in the cache can be hit while
the caches are disabled. I believe that there's nothing mentioned
about the state of the validity bits either (which, from my reading,
could be in a random state.)
As far as the architecture goes, it doesn't matter provided there is
an implementation defined sequence which results in the caches being
properly initialized.
I suspect that an implementation which choses to leave the validity bits
in a random state _and_ which searches the instruction cache with I=0 in
the control register would not be reasonable as each time you power up,
you're playing russian roulette with the contents of the I cache
interfering with the very first instruction to be executed by the CPU.
However, an implementation which guaranteed that there wouldn't be an
I-cache entry at the reset vector, and specified a sequence which would
fit inside one cache line, and which had the properties above _would_
conform.
So, this makes for a really interesting situation: by the time we get
anywhere near the kernel, it may already be too late to invalidate the
caches if it hasn't already been done.
We really need boot loaders to have already initialized the caches.
In the case of secondary CPU bringup, it's possible that the secondary
CPU may start executing from our trampoline code, and this is why
platforms are able to specify their own initial code for this.
next prev parent reply other threads:[~2012-01-03 17:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-30 9:26 [PATCH] ARM: imx6: fix v7_invalidate_l1 by adding I-Cache invalidation Shawn Guo
2011-12-30 10:47 ` Jason Liu
2011-12-31 9:21 ` Shawn Guo
2012-01-03 17:41 ` Russell King - ARM Linux [this message]
2012-01-03 17:28 ` Russell King - ARM Linux
2012-01-03 17:58 ` Catalin Marinas
2012-01-05 6:37 ` [PATCH] ARM: proc-v7: remove harvard cache stuff Shawn Guo
2012-01-05 6:42 ` Kyungmin Park
2012-01-05 9:48 ` Catalin Marinas
2012-01-17 14:18 ` Will Deacon
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=20120103174123.GE2914@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).