check MMU state

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Apr 6 02:03:14 EST 2003


On Sat, 2003-04-05 at 18:23, Thomas Gleixner wrote:
> On Saturday 05 April 2003 17:24, Benjamin Herrenschmidt wrote:
> > On Sat, 2003-04-05 at 18:15, Thomas Gleixner wrote:
> > > On Saturday 05 April 2003 16:49, Benjamin Herrenschmidt wrote:
> > > > > Is there a clean way to check, if the MMU is enabled on kernel entry
> > > > > ? I have to port Linux to a PMC-module, where the bootloader code
> > > > > should not be changed.
> > > >
> > > > The kernel entry can cope with both cases, provided that early_init
> > > > properly returns the physical address where the kernel is loaded,
> > > > regardless of the translations setup by the bootloader. Also, the
> > > > kernel has to be contiguous in physical memory.
> > >
> > > I don't reach early_init. The CPU is a 860 and I'm using 2.4.20-ben8. I
> > > get lost in initial_mmu. If I turn off the mmu before "bl initial_mmu"
> > > everything is fine.
> >
> > Ah well, I was talking about the "common" CPU case (CONFIG_6xx), I don't
> > know about 8xx but since the first thing the code  in head_8xx.S does is
> > "tlbia", I think you are in a bad situation running that with
> > translation enabled and no vectors around to handle the TLB miss...
> >
> > For machines without BATs, I tend to think that a bootloader loading
> > you with MMU on shall be shot. What I'd suggest is that you hack a piggy
> > back loader in the zImage wrapper that shuts MMU off before entering the
> > kernel. If you _have_ to run vmlinux as is, then stuff a bl to some code
> > to disable the MMU before reaching initial_mmu in head_8xx.S
> I have done this already, but just wanted to know, if there is a way to check
> the mmu-state in case that the bootloader code is corrected some day.

Just check MSR:IR/DR

Ben.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list