From: Paul Burton <paul.burton@imgtec.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/8] MIPS cache code cleanup
Date: Wed, 28 Jan 2015 22:21:14 +0000 [thread overview]
Message-ID: <20150128222114.GE6116@NP-P-BURTON> (raw)
In-Reply-To: <54C95453.8010009@gmail.com>
On Wed, Jan 28, 2015 at 10:27:47PM +0100, Daniel Schwierzeck wrote:
> Am 28.01.2015 um 22:05 schrieb Paul Burton:
> > On Wed, Jan 28, 2015 at 09:31:25PM +0100, Daniel Schwierzeck wrote:
> >> Hi Paul,
> >>
> >> Am 26.01.2015 um 16:02 schrieb Paul Burton:
> >>> This series cleans up the MIPS cache code somewhat, and unifies the
> >>> mips32 & mips64 implementations of it. This is largely in preparation
> >>> for further patches adding L2 cache support. The final patch of this
> >>> series fixes a bug encountered with recent cores on Malta boards.
> >>
> >> thanks for doing this. I also have this on my to-do list.
> >>
> >> Just a thought: if we finally have just the mips_cache_reset function in
> >> cache_init.S, couldn't we reimplement it in C entirely? I see no reason
> >> to implement it in assembler.
> >
> > The only issue with that is that mips_cache_reset currently runs before
> > we have a stack set up, so if the C compiler were to attempt to use the
> > stack things would fall over. I guess we could set up the temporary
> > stack earlier, and it's probably unlikely the compiler would actually
> > make use of it so it shouldn't really slow things down.
>
> I think if mips_cache_reset is a leaf function and takes no arguments or
> return values, the compiler shouldn't add any stack reservation in the
> function prologue.
My thoughts are more if the compiler tries to spill registers to the
stack. Whilst that seems unlikely to happen for such a small piece of
code, at least with optimisations turned on, I can imagine it happening
if someone adds more code (eg. L2 support ;) ) in future. At that point
we'd get crashes in the best case & weird corruption in the worst. The
compiler is also going to use the stack if optimisations are disabled
which isn't beyond the realms of possibility if debugging. So I don't
think there's any way we can use C & guarantee not to use the stack.
If we have an uncached stack then we can at least run, and assuming the
compiler doesn't make much use of the stack we could run without slowing
down too much. The only downside to this I can think of is that it
prevents us from ever moving the call to mips_cache_reset before the
call to lowlevel_init, which is something I have done for internal
builds in order to speed up execution on very slow systems (emulators
where running cached that bit earlier saves minutes in boot time).
That's something I'm somewhat hesitant to give up on... I'll keep
thinking.
> > Any chance we
> > could squeeze this into this merge window though, and I'll move the
> > cache init to C next time? That will simplify my L2 code somewhat too -
> > thanks for the suggestion!
>
> sure
Great :) I'll address the comments you made on patch 1 & submit a v2 of
that in the morning.
Thanks,
Paul
prev parent reply other threads:[~2015-01-28 22:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 15:02 [U-Boot] [PATCH 0/8] MIPS cache code cleanup Paul Burton
2015-01-26 15:02 ` [U-Boot] [PATCH 1/8] MIPS: avoid .set ISA for cache operations Paul Burton
2015-01-28 20:43 ` Daniel Schwierzeck
2015-01-28 21:08 ` Paul Burton
2015-01-28 21:18 ` Daniel Schwierzeck
2015-01-26 15:02 ` [U-Boot] [PATCH 2/8] MIPS: unify cache maintenance functions Paul Burton
2015-01-26 15:02 ` [U-Boot] [PATCH 3/8] MIPS: unify cache initialization code Paul Burton
2015-01-26 15:02 ` [U-Boot] [PATCH 4/8] MIPS: refactor L1 cache config reads to a macro Paul Burton
2015-01-26 15:02 ` [U-Boot] [PATCH 5/8] MIPS: refactor cache loops " Paul Burton
2015-01-26 15:02 ` [U-Boot] [PATCH 6/8] MIPS: inline mips_init_[id]cache functions Paul Burton
2015-01-26 15:02 ` [U-Boot] [PATCH 7/8] MIPS: allow systems to skip loads during cache init Paul Burton
2015-01-26 15:03 ` [U-Boot] [PATCH 8/8] MIPS: clear TagLo select 2 " Paul Burton
2015-01-28 20:57 ` Daniel Schwierzeck
2015-01-28 21:13 ` Paul Burton
2015-01-28 20:31 ` [U-Boot] [PATCH 0/8] MIPS cache code cleanup Daniel Schwierzeck
2015-01-28 21:05 ` Paul Burton
[not found] ` <54C95453.8010009@gmail.com>
2015-01-28 22:21 ` Paul Burton [this message]
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=20150128222114.GE6116@NP-P-BURTON \
--to=paul.burton@imgtec.com \
--cc=u-boot@lists.denx.de \
/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