diff options
author | Seiji Aguchi <seiji.aguchi@hds.com> | 2013-10-30 16:37:00 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-11-08 17:15:45 -0500 |
commit | 25c74b10bacead867478480170083f69cfc0db48 (patch) | |
tree | 750066787398c55825485341988e19af9776b562 /arch/x86/kernel/traps.c | |
parent | 959c071f0974cda7702d7574647de7ad9259eb57 (diff) |
x86, trace: Register exception handler to trace IDT
This patch registers exception handlers for tracing to a trace IDT.
To implemented it in set_intr_gate(), this patch does followings.
- Register the exception handlers to
the trace IDT by prepending "trace_" to the handler's names.
- Also, newly introduce trace_page_fault() to add tracepoints
in a subsequent patch.
Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Link: http://lkml.kernel.org/r/52716DEC.5050204@hds.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/traps.c')
-rw-r--r-- | arch/x86/kernel/traps.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 8c8093b146ca..1c9d0ad5a193 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -713,7 +713,7 @@ void __init early_trap_init(void) | |||
713 | /* int3 can be called from all */ | 713 | /* int3 can be called from all */ |
714 | set_system_intr_gate_ist(X86_TRAP_BP, &int3, DEBUG_STACK); | 714 | set_system_intr_gate_ist(X86_TRAP_BP, &int3, DEBUG_STACK); |
715 | #ifdef CONFIG_X86_32 | 715 | #ifdef CONFIG_X86_32 |
716 | set_intr_gate(X86_TRAP_PF, &page_fault); | 716 | set_intr_gate(X86_TRAP_PF, page_fault); |
717 | #endif | 717 | #endif |
718 | load_idt(&idt_descr); | 718 | load_idt(&idt_descr); |
719 | } | 719 | } |
@@ -721,7 +721,7 @@ void __init early_trap_init(void) | |||
721 | void __init early_trap_pf_init(void) | 721 | void __init early_trap_pf_init(void) |
722 | { | 722 | { |
723 | #ifdef CONFIG_X86_64 | 723 | #ifdef CONFIG_X86_64 |
724 | set_intr_gate(X86_TRAP_PF, &page_fault); | 724 | set_intr_gate(X86_TRAP_PF, page_fault); |
725 | #endif | 725 | #endif |
726 | } | 726 | } |
727 | 727 | ||
@@ -737,30 +737,30 @@ void __init trap_init(void) | |||
737 | early_iounmap(p, 4); | 737 | early_iounmap(p, 4); |
738 | #endif | 738 | #endif |
739 | 739 | ||
740 | set_intr_gate(X86_TRAP_DE, ÷_error); | 740 | set_intr_gate(X86_TRAP_DE, divide_error); |
741 | set_intr_gate_ist(X86_TRAP_NMI, &nmi, NMI_STACK); | 741 | set_intr_gate_ist(X86_TRAP_NMI, &nmi, NMI_STACK); |
742 | /* int4 can be called from all */ | 742 | /* int4 can be called from all */ |
743 | set_system_intr_gate(X86_TRAP_OF, &overflow); | 743 | set_system_intr_gate(X86_TRAP_OF, &overflow); |
744 | set_intr_gate(X86_TRAP_BR, &bounds); | 744 | set_intr_gate(X86_TRAP_BR, bounds); |
745 | set_intr_gate(X86_TRAP_UD, &invalid_op); | 745 | set_intr_gate(X86_TRAP_UD, invalid_op); |
746 | set_intr_gate(X86_TRAP_NM, &device_not_available); | 746 | set_intr_gate(X86_TRAP_NM, device_not_available); |
747 | #ifdef CONFIG_X86_32 | 747 | #ifdef CONFIG_X86_32 |
748 | set_task_gate(X86_TRAP_DF, GDT_ENTRY_DOUBLEFAULT_TSS); | 748 | set_task_gate(X86_TRAP_DF, GDT_ENTRY_DOUBLEFAULT_TSS); |
749 | #else | 749 | #else |
750 | set_intr_gate_ist(X86_TRAP_DF, &double_fault, DOUBLEFAULT_STACK); | 750 | set_intr_gate_ist(X86_TRAP_DF, &double_fault, DOUBLEFAULT_STACK); |
751 | #endif | 751 | #endif |
752 | set_intr_gate(X86_TRAP_OLD_MF, &coprocessor_segment_overrun); | 752 | set_intr_gate(X86_TRAP_OLD_MF, coprocessor_segment_overrun); |
753 | set_intr_gate(X86_TRAP_TS, &invalid_TSS); | 753 | set_intr_gate(X86_TRAP_TS, invalid_TSS); |
754 | set_intr_gate(X86_TRAP_NP, &segment_not_present); | 754 | set_intr_gate(X86_TRAP_NP, segment_not_present); |
755 | set_intr_gate_ist(X86_TRAP_SS, &stack_segment, STACKFAULT_STACK); | 755 | set_intr_gate_ist(X86_TRAP_SS, &stack_segment, STACKFAULT_STACK); |
756 | set_intr_gate(X86_TRAP_GP, &general_protection); | 756 | set_intr_gate(X86_TRAP_GP, general_protection); |
757 | set_intr_gate(X86_TRAP_SPURIOUS, &spurious_interrupt_bug); | 757 | set_intr_gate(X86_TRAP_SPURIOUS, spurious_interrupt_bug); |
758 | set_intr_gate(X86_TRAP_MF, &coprocessor_error); | 758 | set_intr_gate(X86_TRAP_MF, coprocessor_error); |
759 | set_intr_gate(X86_TRAP_AC, &alignment_check); | 759 | set_intr_gate(X86_TRAP_AC, alignment_check); |
760 | #ifdef CONFIG_X86_MCE | 760 | #ifdef CONFIG_X86_MCE |
761 | set_intr_gate_ist(X86_TRAP_MC, &machine_check, MCE_STACK); | 761 | set_intr_gate_ist(X86_TRAP_MC, &machine_check, MCE_STACK); |
762 | #endif | 762 | #endif |
763 | set_intr_gate(X86_TRAP_XF, &simd_coprocessor_error); | 763 | set_intr_gate(X86_TRAP_XF, simd_coprocessor_error); |
764 | 764 | ||
765 | /* Reserve all the builtin and the syscall vector: */ | 765 | /* Reserve all the builtin and the syscall vector: */ |
766 | for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) | 766 | for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) |