Re: [PATCH 4/5] x86: Allow nesting of the debug stack IDT setting

From: H. Peter Anvin
Date: Thu May 31 2012 - 15:27:57 EST


On 05/31/2012 12:25 PM, Steven Rostedt wrote:
>> void debug_stack_set_zero(void)
>> {
>> if (this_cpu_inc_return(debug_stack_use_ctr) == 1)
>
> If an NMI comes in here, it will not update the IDT and will corrupt the
> stack. The load_idt() must happen for all calls. There's only two static
> IDT tables. It's either one or the other. Thus, if it loads it twice, it
> will just set it to the same value. The counter is to know when to set
> it back.
>

Now I'm really confused. Why would it have to set it if it is already set?

-hpa


--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

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