diff options
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/desc.h | 28 | ||||
-rw-r--r-- | arch/x86/include/asm/hw_irq.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/segment.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/traps.h | 20 |
4 files changed, 49 insertions, 5 deletions
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index d93956744cfd..3d73437600d7 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h | |||
@@ -327,10 +327,25 @@ static inline void write_trace_idt_entry(int entry, const gate_desc *gate) | |||
327 | { | 327 | { |
328 | write_idt_entry(trace_idt_table, entry, gate); | 328 | write_idt_entry(trace_idt_table, entry, gate); |
329 | } | 329 | } |
330 | |||
331 | static inline void _trace_set_gate(int gate, unsigned type, void *addr, | ||
332 | unsigned dpl, unsigned ist, unsigned seg) | ||
333 | { | ||
334 | gate_desc s; | ||
335 | |||
336 | pack_gate(&s, type, (unsigned long)addr, dpl, ist, seg); | ||
337 | /* | ||
338 | * does not need to be atomic because it is only done once at | ||
339 | * setup time | ||
340 | */ | ||
341 | write_trace_idt_entry(gate, &s); | ||
342 | } | ||
330 | #else | 343 | #else |
331 | static inline void write_trace_idt_entry(int entry, const gate_desc *gate) | 344 | static inline void write_trace_idt_entry(int entry, const gate_desc *gate) |
332 | { | 345 | { |
333 | } | 346 | } |
347 | |||
348 | #define _trace_set_gate(gate, type, addr, dpl, ist, seg) | ||
334 | #endif | 349 | #endif |
335 | 350 | ||
336 | static inline void _set_gate(int gate, unsigned type, void *addr, | 351 | static inline void _set_gate(int gate, unsigned type, void *addr, |
@@ -353,11 +368,14 @@ static inline void _set_gate(int gate, unsigned type, void *addr, | |||
353 | * Pentium F0 0F bugfix can have resulted in the mapped | 368 | * Pentium F0 0F bugfix can have resulted in the mapped |
354 | * IDT being write-protected. | 369 | * IDT being write-protected. |
355 | */ | 370 | */ |
356 | static inline void set_intr_gate(unsigned int n, void *addr) | 371 | #define set_intr_gate(n, addr) \ |
357 | { | 372 | do { \ |
358 | BUG_ON((unsigned)n > 0xFF); | 373 | BUG_ON((unsigned)n > 0xFF); \ |
359 | _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS); | 374 | _set_gate(n, GATE_INTERRUPT, (void *)addr, 0, 0, \ |
360 | } | 375 | __KERNEL_CS); \ |
376 | _trace_set_gate(n, GATE_INTERRUPT, (void *)trace_##addr,\ | ||
377 | 0, 0, __KERNEL_CS); \ | ||
378 | } while (0) | ||
361 | 379 | ||
362 | extern int first_system_vector; | 380 | extern int first_system_vector; |
363 | /* used_vectors is BITMAP for irq is not managed by percpu vector_irq */ | 381 | /* used_vectors is BITMAP for irq is not managed by percpu vector_irq */ |
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 92b3bae08b74..cba45d99ac1a 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h | |||
@@ -187,6 +187,9 @@ extern __visible void smp_invalidate_interrupt(struct pt_regs *); | |||
187 | #endif | 187 | #endif |
188 | 188 | ||
189 | extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECTOR])(void); | 189 | extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECTOR])(void); |
190 | #ifdef CONFIG_TRACING | ||
191 | #define trace_interrupt interrupt | ||
192 | #endif | ||
190 | 193 | ||
191 | typedef int vector_irq_t[NR_VECTORS]; | 194 | typedef int vector_irq_t[NR_VECTORS]; |
192 | DECLARE_PER_CPU(vector_irq_t, vector_irq); | 195 | DECLARE_PER_CPU(vector_irq_t, vector_irq); |
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index c48a95035a77..6f1c3a8a33ab 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h | |||
@@ -214,6 +214,9 @@ | |||
214 | #ifdef __KERNEL__ | 214 | #ifdef __KERNEL__ |
215 | #ifndef __ASSEMBLY__ | 215 | #ifndef __ASSEMBLY__ |
216 | extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][2+2+5]; | 216 | extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][2+2+5]; |
217 | #ifdef CONFIG_TRACING | ||
218 | #define trace_early_idt_handlers early_idt_handlers | ||
219 | #endif | ||
217 | 220 | ||
218 | /* | 221 | /* |
219 | * Load a segment. Fall back on loading the zero | 222 | * Load a segment. Fall back on loading the zero |
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 7036cb60cd87..58d66fe06b61 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h | |||
@@ -37,6 +37,23 @@ asmlinkage void machine_check(void); | |||
37 | #endif /* CONFIG_X86_MCE */ | 37 | #endif /* CONFIG_X86_MCE */ |
38 | asmlinkage void simd_coprocessor_error(void); | 38 | asmlinkage void simd_coprocessor_error(void); |
39 | 39 | ||
40 | #ifdef CONFIG_TRACING | ||
41 | asmlinkage void trace_page_fault(void); | ||
42 | #define trace_divide_error divide_error | ||
43 | #define trace_bounds bounds | ||
44 | #define trace_invalid_op invalid_op | ||
45 | #define trace_device_not_available device_not_available | ||
46 | #define trace_coprocessor_segment_overrun coprocessor_segment_overrun | ||
47 | #define trace_invalid_TSS invalid_TSS | ||
48 | #define trace_segment_not_present segment_not_present | ||
49 | #define trace_general_protection general_protection | ||
50 | #define trace_spurious_interrupt_bug spurious_interrupt_bug | ||
51 | #define trace_coprocessor_error coprocessor_error | ||
52 | #define trace_alignment_check alignment_check | ||
53 | #define trace_simd_coprocessor_error simd_coprocessor_error | ||
54 | #define trace_async_page_fault async_page_fault | ||
55 | #endif | ||
56 | |||
40 | dotraplinkage void do_divide_error(struct pt_regs *, long); | 57 | dotraplinkage void do_divide_error(struct pt_regs *, long); |
41 | dotraplinkage void do_debug(struct pt_regs *, long); | 58 | dotraplinkage void do_debug(struct pt_regs *, long); |
42 | dotraplinkage void do_nmi(struct pt_regs *, long); | 59 | dotraplinkage void do_nmi(struct pt_regs *, long); |
@@ -55,6 +72,9 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *); | |||
55 | #endif | 72 | #endif |
56 | dotraplinkage void do_general_protection(struct pt_regs *, long); | 73 | dotraplinkage void do_general_protection(struct pt_regs *, long); |
57 | dotraplinkage void do_page_fault(struct pt_regs *, unsigned long); | 74 | dotraplinkage void do_page_fault(struct pt_regs *, unsigned long); |
75 | #ifdef CONFIG_TRACING | ||
76 | dotraplinkage void trace_do_page_fault(struct pt_regs *, unsigned long); | ||
77 | #endif | ||
58 | dotraplinkage void do_spurious_interrupt_bug(struct pt_regs *, long); | 78 | dotraplinkage void do_spurious_interrupt_bug(struct pt_regs *, long); |
59 | dotraplinkage void do_coprocessor_error(struct pt_regs *, long); | 79 | dotraplinkage void do_coprocessor_error(struct pt_regs *, long); |
60 | dotraplinkage void do_alignment_check(struct pt_regs *, long); | 80 | dotraplinkage void do_alignment_check(struct pt_regs *, long); |