Re: Linux 2.6.24-rc5 x86 architecture no longer Oopses...

From: Ingo Molnar
Date: Thu Dec 20 2007 - 19:45:09 EST



* Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> > + raw_local_irq_save(flags);
> > __raw_spin_lock(&die.lock);
> > - raw_local_save_flags(flags);
> > die.lock_owner = smp_processor_id();
> > die.lock_owner_depth = 0;
> > bust_spinlocks(1);
> > - }
> > - else
> > - raw_local_save_flags(flags);
> > + } else
> > + raw_local_irq_save(flags);
> >
> > if (++die.lock_owner_depth < 3) {
> > unsigned long esp;
>
> Looks sane.
>
> I suppose there's some reason why we can't just use
> spin_lock_irqsave(). But that reason was either so obvious or so
> unimportant that a comment was not needed. Sigh.

bug was introduced via:

commit 39743c9ef717fd4f2b5583f010115c5f2482b8ae
Author: Andi Kleen <ak@xxxxxxx>
Date: Fri Oct 19 20:35:03 2007 +0200

x86: use raw locks during oopses

- spin_lock_irqsave(&die.lock, flags);
+ __raw_spin_lock(&die.lock);
+ raw_local_save_flags(flags);

that is not a correct open-coding of spin_lock_irqsave(): both the
ordering is wrong (irqs should be disabled _first_), and the wrong
flags-saving API was used.

so this is a post-2.6.23 regression and the fix is (now) obvious.

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