Re: crash in entry.S restore_all, 2.6.12-rc2, x86, PAGEALLOC

Linus Torvalds
2005-04-05T19:55:56Z

On Tue, 5 Apr 2005, Stas Sergeev wrote:
>
> > So I'd actually prefer to get that mystery explained..
> IIRC if the interrupt doesn't do the CPL
> switch, the interrupt gate doesn't save
> the stack, and so there may not be the
> full "struct pt_regs" when the kernel
> thread is interrupted.

Yes. But how do you have _such_ an empty stack when the interrupt comes
in? See what I mean? IOW, that requires that the kernel stack would have
only two words on it when the interrupt happens. How?

It may be a 4kB stack issue or something. Does this happen only with
CONFIG_4KSTACKS, and just after a stack switch to an irq stack, for
example?

So I definitely think the "bug" is in your optimization, I just think it
should be a valid optimization and we should just make sure our kernel
stack is never _so_ empty that "struct pt_regs" is not safe to
dereference.

Linus