Re: [PATCH v9 2/3] trace,x86: add x86 irq vector tracepoints

From: Steven Rostedt
Date: Fri Feb 15 2013 - 20:59:59 EST


On Fri, 2013-02-15 at 16:09 -0800, H. Peter Anvin wrote:
> On 02/04/2013 02:49 PM, Seiji Aguchi wrote:
> > +
> > +static void switch_to_trace_idt(void *arg)
> > +{
> > + store_idt(this_cpu_ptr(&orig_idt_descr));
> > + load_idt(&trace_idt_descr);
> > +
> > + return;
> > +}
> > +
> > +static void restore_original_idt(void *arg)
> > +{
> > + if (this_cpu_read(orig_idt_descr.address)) {
> > + load_idt(this_cpu_ptr(&orig_idt_descr));
> > + this_cpu_write(orig_idt_descr.address, 0);
> > + }
> > +
> > + return;
> > +}
> > +
>
> The base address of the IDT doesn't generally change... the one
> exception is when we do the funny NMI workaround.
>
> For that reason, I would be happier if we just restored the standard
> value instead of saving/restoring stuff.
>
> The above code is probably broken if either side is in the funny NMI
> zone... unless you can guarantee it is *always* in the funny NMI zone
> (in which case you can just load nmi_idt_descr instead.
>
> Steve R., do you know what the constraints are with respect to that?
>

This switch should always be outside the funny NMI and debug zone.
I think you missed a patch that I sent you to deal with exactly this:

https://lkml.org/lkml/2013/2/1/532

I sent it directly to you, maybe it got buried in your INBOX.

-- Steve


--
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/