kexec on e300 core / mpc5121
scottwood at freescale.com
Fri Aug 7 01:54:48 EST 2009
On Thu, Aug 06, 2009 at 02:20:50AM +0200, Kenneth Johansson wrote:
> > > Before you turn off the cache you need to flush out all dirty data. best
> > > done by simply reading in 32kb of crap from somewhere. otherwise you are
> > > sure to loose at least the stack and you do not want that.
> > 32KiB is usually not sufficient -- depending on the initial state, an
> > 8-way 32KiB cache with PLRU (such as in e300) can require up to 52KiB of
> > data (13 loads per set) to fully flush if you simply load+dcbf (in
> > separate passes) an arbitrary chunk of data which may already be in the
> > cache.
> if you have
> int crap[1024*32/4] __attribute__((aligned(32)))
> What will happen with the cache if you just load data into a register
> from that array ?? Wont it force out everything else in the cache to
> make room for the crap ?
Under certain circumstances, the newly loaded flush data will replace
previous flush data rather than the actual data you're trying to displace
-- especially if some of the "crap" is already in the cache, or if there
were some empty cache lines at the start of the process. It's not a true
If you read 52K, and then dcbf that same 52K, with interrupts disabled
(they can disturb the PLRU), you should be OK. It doesn't even need to
be dedicated junk, any memory will work.
More information about the Linuxppc-dev