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

Stas Sergeev
2005-04-10T13:20:23Z

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

Hello.

Linus Torvalds wrote:
>> 2. How can one be sure there are no more
>> of the like places where the stack is left
>> empty?
> That's a good argument, and may be the strongest reason for _not_ doing
> the speculation. However, I don't think it really can happen anywhere
> else.
OK, so how do you feel about the attached
patch? I understand that from some point
of view it may look like a hack, but at
the same time it:
1. Allows to preserve the valueable optimization
2. Works for NMIs
3. Doesn't care whether or not there are more
of the like instances where the stack is left
empty.
4. Seems to work for me without the crashes:)

[-- Attachment #2: esp0.diff --]
[-- Type: text/x-patch, Size: 399 bytes --]

--- linux/arch/i386/kernel/process.c.old 2005-03-20 14:12:18.000000000 +0300
+++ linux/arch/i386/kernel/process.c 2005-04-10 16:54:39.000000000 +0400
@@ -394,7 +394,7 @@
childregs->esp = esp;

p->thread.esp = (unsigned long) childregs;
- p->thread.esp0 = (unsigned long) (childregs+1);
+ p->thread.esp0 = (unsigned long) (childregs+1) - 8;

p->thread.eip = (unsigned long) ret_from_fork;