Skip to content

Commit

Permalink
Merge remote-tracking branch 'trace/tip/x86/trace' into x86/trace
Browse files Browse the repository at this point in the history
Fix from Steven Rostedt.
  • Loading branch information
H. Peter Anvin committed Jun 24, 2013
2 parents 33e5ff6 + 2b4bc78 commit 5236eb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 4 additions & 6 deletions arch/x86/include/asm/desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,21 +497,19 @@ static inline void load_trace_idt(void)
#endif

/*
* the load_current_idt() is called with interrupt disabled by local_irq_save()
* The load_current_idt() must be called with interrupts disabled
* to avoid races. That way the IDT will always be set back to the expected
* descriptor.
* descriptor. It's also called when a CPU is being initialized, and
* that doesn't need to disable interrupts, as nothing should be
* bothering the CPU then.
*/
static inline void load_current_idt(void)
{
unsigned long flags;

local_irq_save(flags);
if (is_debug_idt_enabled())
load_debug_idt();
else if (is_trace_idt_enabled())
load_trace_idt();
else
load_idt((const struct desc_ptr *)&idt_descr);
local_irq_restore(flags);
}
#endif /* _ASM_X86_DESC_H */
4 changes: 4 additions & 0 deletions arch/x86/kernel/tracepoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ static void set_trace_idt_ctr(int val)

static void switch_idt(void *arg)
{
unsigned long flags;

local_irq_save(flags);
load_current_idt();
local_irq_restore(flags);
}

void trace_irq_vector_regfunc(void)
Expand Down

0 comments on commit 5236eb9

Please sign in to comment.