Skip to content

Commit 5236eb9

Browse files
author
H. Peter Anvin
committed
Merge remote-tracking branch 'trace/tip/x86/trace' into x86/trace
Fix from Steven Rostedt.
2 parents 33e5ff6 + 2b4bc78 commit 5236eb9

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎arch/x86/include/asm/desc.h‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,21 +497,19 @@ static inline void load_trace_idt(void)
497497
#endif
498498

499499
/*
500-
* the load_current_idt() is called with interrupt disabled by local_irq_save()
500+
* The load_current_idt() must be called with interrupts disabled
501501
* to avoid races. That way the IDT will always be set back to the expected
502-
* descriptor.
502+
* descriptor. It's also called when a CPU is being initialized, and
503+
* that doesn't need to disable interrupts, as nothing should be
504+
* bothering the CPU then.
503505
*/
504506
static inline void load_current_idt(void)
505507
{
506-
unsigned long flags;
507-
508-
local_irq_save(flags);
509508
if (is_debug_idt_enabled())
510509
load_debug_idt();
511510
else if (is_trace_idt_enabled())
512511
load_trace_idt();
513512
else
514513
load_idt((const struct desc_ptr *)&idt_descr);
515-
local_irq_restore(flags);
516514
}
517515
#endif /* _ASM_X86_DESC_H */

‎arch/x86/kernel/tracepoint.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ static void set_trace_idt_ctr(int val)
2929

3030
static void switch_idt(void *arg)
3131
{
32+
unsigned long flags;
33+
34+
local_irq_save(flags);
3235
load_current_idt();
36+
local_irq_restore(flags);
3337
}
3438

3539
void trace_irq_vector_regfunc(void)

0 commit comments

Comments
 (0)