[PATCH] MSR_RI not cleared early enough in entry.S

Paul Mackerras paulus at samba.org
Tue Sep 28 15:44:05 EST 2004


Craig Chaney writes:

> An exception between the update of the kernel stack pointer and the clearing
> of MSR_RI can cause a problem.  If r1 has been updated to point to userspace,
> this will trigger an error condition at the top of EXCEPTION_PROLOG_COMMON,
> and we get the "Bad kernel stack pointer" error.

You are correct, but in fact we will get the same bad kernel stack
pointer error whether RI is set or clear.

What exception do you think we might get?  Once we have successfully
loaded r1 from the stack there should be no possibility of getting any
exceptions until after the rfid, except for a machine check.  If we
get a machine check in these circumstances we're toast but that should
be extremely unlikely.

I think it is slightly more correct to clear RI before loading r1, but
it won't make any difference to the actual outcome in any scenario
that I can see.

Paul.



More information about the Linuxppc64-dev mailing list