Ingo, this patch is almost certainly bogus, and can lead to some
_really_ hard to find random problems. Notably:
@@ -770,7 +792,7 @@
* 0 return value means that this irq is already being
* handled by some other CPU. (or is disabled)
*/
- unsigned int irq = regs.orig_eax & 0xff;
+ int irq = regs.orig_eax;
int cpu = smp_processor_id();
kstat.irqs[cpu][irq]++;
@@ -206,7 +221,7 @@
__asm__( \
"\n"__ALIGN_STR"\n" \
SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
- "pushl $"#nr"-256\n\t" \
+ "pushl $"#nr"\n\t" \
"jmp common_interrupt");
/*
which on the face of it looks sane, but you've now invalidated a really
important rule: "orig_eax" _must_ be either a non-negative system call
number, or negative for faults and interrupts.
The thing is, that signal handling uses "orig_eax" to determine whether
they should look for system call restarting. What the above patch will
result in is:
- we take an interrupt that causes us to get a signal
- at the time of the interrupt, %eax happened to be -ERESTARTNOHAND
or one of the other "magic" error codes.
- we look at "orig_eax" and notice that we were doing a system call (or
so we thought), so now we decrement eip by 2 to "roll back" the
system call, and reset %eax to the original value.
- BOOM. We're screwed, and we've just randomly corrupted register state
in some random user process.
Other than the above fairly serious (but hard to trigger and not very
obvious) bug, the patch looks sane. I would suggest you revert just
that part of your changes, and maybe add a comment on exactly _why_
orig_eax has to be negative.
Linus
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]