linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch 2/2] arm: Implement l2x0 cache disable function
Date: Sun, 4 Jul 2010 20:09:13 +0100	[thread overview]
Message-ID: <20100704190913.GA8596@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02C5ECEF1D@dbde02.ent.ti.com>

On Sat, Jul 03, 2010 at 12:31:53PM +0530, Shilimkar, Santosh wrote:
> > -----Original Message-----
> > From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-arm-
> > kernel-bounces at lists.infradead.org] On Behalf Of Catalin Marinas
> > Sent: Friday, July 02, 2010 10:25 PM
> > To: Thomas Gleixner
> > Cc: Tony Lindgren; LAK
> > Subject: Re: [patch 2/2] arm: Implement l2x0 cache disable function
> > 
> > On Fri, 2010-07-02 at 17:39 +0100, Thomas Gleixner wrote:
> > > Simply because you need to flush the cache in the decompressor of the
> > > new kernel before jumping into it and I doubt that Russell will be
> > > happy about adding an utter L2 mess to the decompressor.
> > 
> > The decompressor can create mappings as inner cacheable outer
> > non-cacheable and it would not pollute the L2 cache.
> > 
> > I wonder how the OMAP guys deal with an already enabled L2 cache during
> > decompressing.
> 
> $L2 isn't enabled during the decompression. It's done " __v7_setup" on OMAP3
> and just before " l2x0_init" on OMAP4

Not on the initial kernel, but on subsequent kernels booted via kexec,
because of this issue, L2 will be enabled.

So when the decompressor comes to set up its own page tables - it uses
the non-XP format - it ends up with tables setup with C=B=1, which
is interpreted as fully cacheable.  As the L2 unit is still enabled,
this causes the region to be cacheable at L2 as well as L1 - which
is not what the decompressor expects.

The result is that cache lines get loaded into L2, and marked dirty.
When the decompressor then turns off the cache in order to call the
kernel, things go awol because the dirty lines in L2 haven't been
flushed out.

I think it's overkill to add L2 support to the decompressor - and I
also think it's overkill to teach the decompressor about the XP format
tables, especially as the booting documents clearly state that caches
shall be disabled before calling the kernel.  Also, we really can't
insist that this is the case for boot loaders, and then do something
different when we call the next kernel.

Also consider the case where the kernel you're booting into doesn't
have L2 support enabled - maybe you disabled L2 support because it's
causing problems.  If you boot with L2 already enabled, then this
kernel is going to struggle because it can't handle the enabled L2.

As I've already said, the boot loader case won't expect to be called
via its reset vector with L2 enabled either - and could well go wrong
if this is done.

So, all the ways you look at it, having L2 enabled when you're exiting
the kernel to call some other piece of code (such as boot loader or
decompressor) is asking for trouble.

Let's ensure that we bring L2 to a clean and disabled state prior to
invoking a boot loader or subsequent kernel - even if that means we
have to make SMC calls to achieve that.

  parent reply	other threads:[~2010-07-04 19:09 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 16:05 [patch 0/2] ARM: Disable outer cache before kexec call Thomas Gleixner
2010-07-01 16:05 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
2010-07-01 16:05 ` [patch 2/2] arm: Implement l2x0 cache disable function Thomas Gleixner
     [not found]   ` <AANLkTillHUsJF8brOtHh8tl9Us493GsWfpjhXXsFExY7@mail.gmail.com>
2010-07-02 11:23     ` srinidhi
2010-07-02 11:47   ` Catalin Marinas
2010-07-02 15:29     ` Thomas Gleixner
2010-07-02 16:10       ` Catalin Marinas
2010-07-02 16:39         ` Thomas Gleixner
2010-07-02 16:51           ` Shilimkar, Santosh
2010-07-02 16:54           ` Catalin Marinas
2010-07-02 17:23             ` Russell King - ARM Linux
2010-07-03  7:01             ` Shilimkar, Santosh
2010-07-04 14:07               ` Catalin Marinas
2010-07-04 15:31                 ` Shilimkar, Santosh
2010-07-04 19:09               ` Russell King - ARM Linux [this message]
2010-07-05  9:12                 ` Catalin Marinas
2010-07-02 17:21         ` Russell King - ARM Linux
2010-07-02 16:48       ` Shilimkar, Santosh
2010-07-01 16:14 ` [patch 0/2] ARM: Disable outer cache before kexec call Catalin Marinas
2010-07-01 16:28   ` Thomas Gleixner
2010-07-01 16:35     ` Catalin Marinas
2010-07-01 16:52       ` Thomas Gleixner
2010-07-01 17:14         ` Catalin Marinas
2010-07-02 10:58         ` Tony Lindgren
2010-07-01 16:38     ` Shilimkar, Santosh
2010-07-01 16:41       ` Catalin Marinas
2010-07-01 16:44         ` Shilimkar, Santosh
2010-07-01 17:06       ` Russell King - ARM Linux
2010-07-01 17:21         ` Russell King - ARM Linux
2010-07-01 17:34           ` Catalin Marinas
2010-07-01 17:48             ` Russell King - ARM Linux
2010-07-01 20:08           ` Thomas Gleixner

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=20100704190913.GA8596@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).