diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 17:49:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 17:49:54 -0400 |
commit | e18425a0abc8eafa8e98ecffac517bb0c0904f4b (patch) | |
tree | 5eb743e7201850de19496183554bb34c766948c4 /arch/x86/mm/fault.c | |
parent | d1794f2c5b5817eb79ccc5e00701ca748d1b073a (diff) | |
parent | 5806b81ac1c0c52665b91723fd4146a4f86e386b (diff) |
Merge branch 'tracing/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (228 commits)
ftrace: build fix for ftraced_suspend
ftrace: separate out the function enabled variable
ftrace: add ftrace_kill_atomic
ftrace: use current CPU for function startup
ftrace: start wakeup tracing after setting function tracer
ftrace: check proper config for preempt type
ftrace: trace schedule
ftrace: define function trace nop
ftrace: move sched_switch enable after markers
ftrace: prevent ftrace modifications while being kprobe'd, v2
fix "ftrace: store mcount address in rec->ip"
mmiotrace broken in linux-next (8-bit writes only)
ftrace: avoid modifying kprobe'd records
ftrace: freeze kprobe'd records
kprobes: enable clean usage of get_kprobe
ftrace: store mcount address in rec->ip
ftrace: build fix with gcc 4.3
namespacecheck: fixes
ftrace: fix "notrace" filtering priority
ftrace: fix printout
...
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index d0f5fce77d95..455f3fe67b42 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/ptrace.h> | 12 | #include <linux/ptrace.h> |
13 | #include <linux/mmiotrace.h> | ||
13 | #include <linux/mman.h> | 14 | #include <linux/mman.h> |
14 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
15 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
@@ -49,6 +50,16 @@ | |||
49 | #define PF_RSVD (1<<3) | 50 | #define PF_RSVD (1<<3) |
50 | #define PF_INSTR (1<<4) | 51 | #define PF_INSTR (1<<4) |
51 | 52 | ||
53 | static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr) | ||
54 | { | ||
55 | #ifdef CONFIG_MMIOTRACE_HOOKS | ||
56 | if (unlikely(is_kmmio_active())) | ||
57 | if (kmmio_handler(regs, addr) == 1) | ||
58 | return -1; | ||
59 | #endif | ||
60 | return 0; | ||
61 | } | ||
62 | |||
52 | static inline int notify_page_fault(struct pt_regs *regs) | 63 | static inline int notify_page_fault(struct pt_regs *regs) |
53 | { | 64 | { |
54 | #ifdef CONFIG_KPROBES | 65 | #ifdef CONFIG_KPROBES |
@@ -598,6 +609,8 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
598 | 609 | ||
599 | if (notify_page_fault(regs)) | 610 | if (notify_page_fault(regs)) |
600 | return; | 611 | return; |
612 | if (unlikely(kmmio_fault(regs, address))) | ||
613 | return; | ||
601 | 614 | ||
602 | /* | 615 | /* |
603 | * We fault-in kernel-space virtual memory on-demand. The | 616 | * We fault-in kernel-space virtual memory on-demand. The |