diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 5284cd2b5776..5e2ba634ea15 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -9,7 +9,9 @@ | |||
9 | #include <linux/pm.h> | 9 | #include <linux/pm.h> |
10 | #include <linux/clockchips.h> | 10 | #include <linux/clockchips.h> |
11 | #include <linux/random.h> | 11 | #include <linux/random.h> |
12 | #include <linux/user-return-notifier.h> | ||
12 | #include <trace/events/power.h> | 13 | #include <trace/events/power.h> |
14 | #include <linux/hw_breakpoint.h> | ||
13 | #include <asm/system.h> | 15 | #include <asm/system.h> |
14 | #include <asm/apic.h> | 16 | #include <asm/apic.h> |
15 | #include <asm/syscalls.h> | 17 | #include <asm/syscalls.h> |
@@ -17,6 +19,7 @@ | |||
17 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
18 | #include <asm/i387.h> | 20 | #include <asm/i387.h> |
19 | #include <asm/ds.h> | 21 | #include <asm/ds.h> |
22 | #include <asm/debugreg.h> | ||
20 | 23 | ||
21 | unsigned long idle_halt; | 24 | unsigned long idle_halt; |
22 | EXPORT_SYMBOL(idle_halt); | 25 | EXPORT_SYMBOL(idle_halt); |
@@ -103,14 +106,7 @@ void flush_thread(void) | |||
103 | } | 106 | } |
104 | #endif | 107 | #endif |
105 | 108 | ||
106 | clear_tsk_thread_flag(tsk, TIF_DEBUG); | 109 | flush_ptrace_hw_breakpoint(tsk); |
107 | |||
108 | tsk->thread.debugreg0 = 0; | ||
109 | tsk->thread.debugreg1 = 0; | ||
110 | tsk->thread.debugreg2 = 0; | ||
111 | tsk->thread.debugreg3 = 0; | ||
112 | tsk->thread.debugreg6 = 0; | ||
113 | tsk->thread.debugreg7 = 0; | ||
114 | memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); | 110 | memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); |
115 | /* | 111 | /* |
116 | * Forget coprocessor state.. | 112 | * Forget coprocessor state.. |
@@ -192,16 +188,6 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, | |||
192 | else if (next->debugctlmsr != prev->debugctlmsr) | 188 | else if (next->debugctlmsr != prev->debugctlmsr) |
193 | update_debugctlmsr(next->debugctlmsr); | 189 | update_debugctlmsr(next->debugctlmsr); |
194 | 190 | ||
195 | if (test_tsk_thread_flag(next_p, TIF_DEBUG)) { | ||
196 | set_debugreg(next->debugreg0, 0); | ||
197 | set_debugreg(next->debugreg1, 1); | ||
198 | set_debugreg(next->debugreg2, 2); | ||
199 | set_debugreg(next->debugreg3, 3); | ||
200 | /* no 4 and 5 */ | ||
201 | set_debugreg(next->debugreg6, 6); | ||
202 | set_debugreg(next->debugreg7, 7); | ||
203 | } | ||
204 | |||
205 | if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ | 191 | if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ |
206 | test_tsk_thread_flag(next_p, TIF_NOTSC)) { | 192 | test_tsk_thread_flag(next_p, TIF_NOTSC)) { |
207 | /* prev and next are different */ | 193 | /* prev and next are different */ |
@@ -224,6 +210,7 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, | |||
224 | */ | 210 | */ |
225 | memset(tss->io_bitmap, 0xff, prev->io_bitmap_max); | 211 | memset(tss->io_bitmap, 0xff, prev->io_bitmap_max); |
226 | } | 212 | } |
213 | propagate_user_return_notify(prev_p, next_p); | ||
227 | } | 214 | } |
228 | 215 | ||
229 | int sys_fork(struct pt_regs *regs) | 216 | int sys_fork(struct pt_regs *regs) |