linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Kirkwood: Add support for Excito Bubba B3
Date: Fri, 10 Jan 2014 17:19:32 -0700	[thread overview]
Message-ID: <20140111001931.GM18269@obsidianresearch.com> (raw)
In-Reply-To: <20140110230248.GO9681@lunn.ch>

On Sat, Jan 11, 2014 at 12:02:48AM +0100, Andrew Lunn wrote:
> > > So, I'd prefer to handle this more gracefully.  I don't have much
> > > experience at the low-level init of the caches, couldn't we enable and
> > > flush rather than throwing the error?
> > 
> > It cannot be solved in cache-feroceon-l2.c.
> > 
> > In many cases you won't even get that far:
> > - It will blow up in head.S when the cache is off: decompressor wrote
> >   writeback data to into the L2 and uncached fetches see memory
> >   content prior to decompression
> > - It will blow up after head.S enables the L1: decompressor wrote
> >   data into the L2 but the relocation writes done with the L1 off
> >   made changes to memory that were not captured in the L2.
> 
> My impression with booting a lot of times while doing i bisect, was
> that it got as far as:
> 
> Uncompressing Linux... done, booting the kernel.
> Booting Linux on physical CPU 0x0
> Linux version 3.13.0-rc1-dirty (lunn at laptop) (gcc version 4.4.5 (Debian 4.4.5-8) ) #7 PREEMPT Fri Jan 3 09:25:07 CST 2014           
> CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
> CPU: VIVT data cache, VIVT instruction cache
> Machine: Marvell Kirkwood (Flattened Device Tree), model: QNAP TS219 family
> Memory policy: ECC disabled, Data cache writeback
> 
> every time.

It should be deterministic, but 'random' in the sense it is sensitive
to exactly the data pattern generated by the decompressor and exactly
the data pattern generated by the relocation writes - so the
corruption will vary depending on the kernel image content (position
of the relocations) and also the size of the L2.

You are likely seeing the 2nd failure I predicted, which is a failure
when a cache line containing a relocation is used, and happened to be
in the L2.

The first failure would require the kernel image to be smaller than
the cache or the cache eviction policy to be such that the initial
part of the decompressed image remains dirty and unevicted in the
L2.

> It does however seem possible to insert platform specific code soon
> after it prints:
> 
> Machine: Marvell Kirkwood (Flattened Device Tree), model: QNAP TS219 family

So if you attempt to do the flush/disable at this point you are
relying on the L2 containing no dirty lines that overlap with lines
that were changed by the relocator while the cache was off.

This is *probably* true in many cases, but it is sktechy, and creates
a hidden hard to find pitfall. This is basically the same 'probably'
that enables non-relocated kernels to boot.

Basically, you might get a bootable system, but it is technically
wrong and has a theoretical hole.

Jason

  reply	other threads:[~2014-01-11  0:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-28 16:12 [PATCH] ARM: Kirkwood: Add support for Excito Bubba B3 Andrew Lunn
2013-12-28 17:01 ` Jason Cooper
2013-12-28 20:59   ` Andrew Lunn
2013-12-28 21:25     ` Jason Cooper
2014-01-02 19:49   ` Jason Gunthorpe
2014-01-02 22:36     ` Ian Campbell
2014-01-02 23:08       ` Jason Gunthorpe
2014-01-03  0:44         ` Andrew Lunn
2014-01-10 19:20         ` Jason Cooper
2014-01-10 19:44           ` Jason Gunthorpe
2014-01-10 19:54             ` Jason Cooper
2014-01-10 23:02             ` Andrew Lunn
2014-01-11  0:19               ` Jason Gunthorpe [this message]
2014-01-11 15:59           ` Russell King - ARM Linux
2014-01-13 14:44             ` Jason Cooper

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=20140111001931.GM18269@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.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).