On Sat, 2013-06-22 at 17:42 +0000, Seiji Aguchi wrote:
> > +static inline void load_current_idt(void)
> > +{
> > +       unsigned long flags;
> > +
> > +       local_irq_save(flags);
> > +       if (is_debug_idt_enabled())
> > +               load_debug_idt();
> > +       else
> > +               load_idt((const struct desc_ptr *)&idt_descr);
> > +       local_irq_restore(flags);
> > +}
> > 
> > It's not safe to call local_irq_save() here. From entry_64.S:
> > 
> > .macro TRACE_IRQS_OFF_DEBUG
> >     call debug_stack_set_zero
> >     TRACE_IRQS_OFF
> >     call debug_stack_reset
> > .endm
> > 
> > We must change the idt before we can trace irqs being disabled. The
> > local_irq_save() here is going to be traced by lockdep. Why do we need
> > to disable interrupts? It's pretty pointless since this same code can be
> > called by NMIs.
> 
> OK, I agree to remove the local_irq_save().
> 
> I thought it is safe to disable interrupt to avoid potential races, 
> because the load_current_id() is a common function and someone else may use 
> it near future.

It should not be that common of a function. Not many should use it.

I'm testing a patch now and should post it in a few hours.

-- Steve


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

Reply via email to