Subject: Bye, bye, "generic kernels"

From: Harald Koerfgen <[email-masked]>
Date: Mon, 19 Jul 1999 19:41:45 +0200 (MEST)

Hi gang,

I am planning to commit the R3000 changes to the CVS this week. In preparation
for that I have cleaned up some things and made the CPU configuration finer
granulated (if you want it) so that it will be possible to configure Linux for
CPUs with, for example, an R4000 core but without ll/sc instructions.

As a side effect it will be no longer possible to build "generic" kernels, i.e.
kernels that are able to work on R3xxx and R4xxx machines and you'll have to
choose at least the right CPU core.

Wanting to have "generic" kernels leads to major uglinesses like avoidable
indirect function calls and self-modifying code and I don't like that.

AFAIK only the DECstations will be affected and I can happily live with that
when it leads to cleaner, leaner and faster code.

Comments?
---
Regards,
Harald

---

From: Harald Koerfgen <[email-masked]>
Date: Mon, 19 Jul 1999 21:54:41 +0200 (MEST)

On 19-Jul-99 Bradley D. LaRonde wrote:
> Off topic:  I'm wondering - why did I need to apply the R3000 patch for my
> R4000 processor build?  Is it just called the R3000 patch but really it's
> more than that?

Well, the VR4111 doesn't support ll/sc instructions and without the R3000 patch 
you will have no chance to get a working kernel.

> On topic:  I like the fine-grained CPU configuration.  By any chance did you
> include Vr4111 in there?

Not exactly. I was more thinking along the lines of:

"Hey, I have this wonderful CPU with an R4000 core (i.e. R4000 exception
handling) but it doesn't support ll/sc instructions so use the R3000 variant
for atomic operations"

or

"My CPU is based on an R3000 but it does have ll/sc instructions so use them"

or even

"Yes, my box has an R3000 variant but linux doesn't have to care about the
writeback buffer, some magical hardware does this".

That is already implemented (No big deal, to be honest. Just some config.in
hacking and replacing some "#if (_MIPS_ISA == _MIPS_ISA_MIPS1)" with "#if
!defined (CONFIG_CPU_HAS_LLSC)").

This concept can easily be expanded to, let's say, DMA snooping or "cache
coherent I/O", if needed.

An additional idea is to hide all these details from Joe Average, based on
assumptions from the machine and CPU type, but to make them available to
developers.

---
Regards,
Harald