Re: Kernel OOPS on boot

From: Mitchell Blank Jr (mitch@sfgoth.com)
Date: Thu Oct 26 2000 - 09:36:28 EST


Richard B. Johnson wrote:
> > And here is the broken routine:
> >
> > 000003f4 <do_test_wp_bit>:
[...]
> This is not good code. It does the following:
>
> o Gets a parameter off the stack and puts into eax (a pointer).
> o Put the value 1 into ecx.
> o Take a byte from the pointed-to location and put it into dl.
> o Put the byte in dl back into memory where it came from!
> o Clear ecx
> o Copy ecx to eax for a return value of 0

If you look at the original routine (arch/i386/mm/init.c:test_wp_bit),
you'll see that its purpose is to test the capabilities of the CPU's
MMU (to differentiate the old 386's that didn't honor WP in supervisor
mode), which is why it does this little dance - to provoke a page
fault.

Anyway, the probable fix has already been posted (i.e. don't use gcc
2.7.2.*)

-Mitch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 31 2000 - 21:00:18 EST