Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: David Daney <ddaney.cavm@gmail.com>,
	linux-mips@linux-mips.org, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: Single MIPS kernel
Date: Wed, 22 Oct 2014 22:42:09 +0200	[thread overview]
Message-ID: <20141022204209.GE12502@linux-mips.org> (raw)
In-Reply-To: <alpine.LFD.2.11.1410222010280.21390@eddie.linux-mips.org>

On Wed, Oct 22, 2014 at 08:19:07PM +0100, Maciej W. Rozycki wrote:

> > > Another reason is that the protocol between the bootloader and the kernel
> > > varies by platform.  So you would have to have several different entry
> > > points, one for each booting protocol.
> > > 
> > > I am not sure how the bootloaders would know which entry point to use.
> > 
> > That's where I foresaw the needs for the ISA style platform probe right
> > at the kernel entry point before fanning out to a platform-specific
> > entry point.
> > 
> > Since we already support compressed kernels I'm wondering if relocation
> > might also be performed by the compression wrapper along with the
> > hardware probe.  That would leave the vmlinux itself untouched and
> > the wrapper could be installed on the target.
> 
>  Wouldn't it make sense to make a unified kernel virtually mapped?  That 
> would avoid the issue with RAM being present at different locations across 
> systems and also if big pages were used, that I believe are available 
> almost universally across the MIPS family, any performance hit would be 
> minimal.  There would be hardly any increase in the binary image size too.  
> Run-time mappings such as `kmalloc' or `ioremap' could continue using 
> unmapped segments.

I think some MIPS III CPUs were restricted to just 4MB max. page size.
NEC VR4xxx I think.  Still a pair would map 8MB which on the affected
small memory systems should suffice.  16MB, 64MB are more typical sizes.

R3000 is a different kettle.  To 4k or not to 4k is not a question ;-)

Now mapping the kernel alone wouldn't solve the security issue mentioned
by David.  The image would still lie around in KSEG0 / XKPHYS for whatever
wants to run over so that should ideally also be a flexible address.

Otoh the mapped kernel certainly would have the lowest size overhead.
I have faint memories of restrictions for TLB instructions or was it
TLB exception handlers into mapped space, would have to do some rtfming
on that topic.

Years ago I did test the impact of one less available TLB entry with
lmbench; the loss was around 2%.  That was on a CPU with 64 entries.

  Ralf

  reply	other threads:[~2014-10-22 20:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22  8:34 Single MIPS kernel Ralf Baechle
2014-10-22 10:53 ` John Crispin
2014-10-22 17:36   ` Florian Fainelli
2014-10-22 17:56 ` David Daney
2014-10-22 19:05   ` Ralf Baechle
2014-10-22 19:19     ` Maciej W. Rozycki
2014-10-22 20:42       ` Ralf Baechle [this message]
2014-10-22 21:10         ` David Daney
2014-10-22 21:53         ` James Hogan
2014-10-22 21:53           ` James Hogan
2014-10-22 22:18           ` David Daney
2014-10-22 18:03 ` David Daney
2014-10-22 19:20   ` Ralf Baechle
2014-10-22 22:15     ` Ben Hutchings
2014-10-22 23:22       ` Ralf Baechle
2014-10-23  1:02         ` Ben Hutchings
2014-10-23  3:13           ` Joshua Kinard

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=20141022204209.GE12502@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=ben@decadent.org.uk \
    --cc=ddaney.cavm@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.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