diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 28ad9f4d8b94..eccdb57094e3 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <asm/idle.h> | 20 | #include <asm/idle.h> |
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | #include <asm/i387.h> | 22 | #include <asm/i387.h> |
23 | #include <asm/ds.h> | ||
24 | #include <asm/debugreg.h> | 23 | #include <asm/debugreg.h> |
25 | 24 | ||
26 | unsigned long idle_halt; | 25 | unsigned long idle_halt; |
@@ -50,8 +49,6 @@ void free_thread_xstate(struct task_struct *tsk) | |||
50 | kmem_cache_free(task_xstate_cachep, tsk->thread.xstate); | 49 | kmem_cache_free(task_xstate_cachep, tsk->thread.xstate); |
51 | tsk->thread.xstate = NULL; | 50 | tsk->thread.xstate = NULL; |
52 | } | 51 | } |
53 | |||
54 | WARN(tsk->thread.ds_ctx, "leaking DS context\n"); | ||
55 | } | 52 | } |
56 | 53 | ||
57 | void free_thread_info(struct thread_info *ti) | 54 | void free_thread_info(struct thread_info *ti) |
@@ -198,11 +195,16 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, | |||
198 | prev = &prev_p->thread; | 195 | prev = &prev_p->thread; |
199 | next = &next_p->thread; | 196 | next = &next_p->thread; |
200 | 197 | ||
201 | if (test_tsk_thread_flag(next_p, TIF_DS_AREA_MSR) || | 198 | if (test_tsk_thread_flag(prev_p, TIF_BLOCKSTEP) ^ |
202 | test_tsk_thread_flag(prev_p, TIF_DS_AREA_MSR)) | 199 | test_tsk_thread_flag(next_p, TIF_BLOCKSTEP)) { |
203 | ds_switch_to(prev_p, next_p); | 200 | unsigned long debugctl = get_debugctlmsr(); |
204 | else if (next->debugctlmsr != prev->debugctlmsr) | 201 | |
205 | update_debugctlmsr(next->debugctlmsr); | 202 | debugctl &= ~DEBUGCTLMSR_BTF; |
203 | if (test_tsk_thread_flag(next_p, TIF_BLOCKSTEP)) | ||
204 | debugctl |= DEBUGCTLMSR_BTF; | ||
205 | |||
206 | update_debugctlmsr(debugctl); | ||
207 | } | ||
206 | 208 | ||
207 | if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ | 209 | if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ |
208 | test_tsk_thread_flag(next_p, TIF_NOTSC)) { | 210 | test_tsk_thread_flag(next_p, TIF_NOTSC)) { |