diff options
Diffstat (limited to 'arch/x86/kernel/process_32.c')
-rw-r--r-- | arch/x86/kernel/process_32.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 5350763a2d0..2b9db937106 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -614,11 +614,21 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, | |||
614 | struct tss_struct *tss) | 614 | struct tss_struct *tss) |
615 | { | 615 | { |
616 | struct thread_struct *prev, *next; | 616 | struct thread_struct *prev, *next; |
617 | unsigned long debugctl; | ||
617 | 618 | ||
618 | prev = &prev_p->thread; | 619 | prev = &prev_p->thread; |
619 | next = &next_p->thread; | 620 | next = &next_p->thread; |
620 | 621 | ||
621 | if (next->debugctlmsr != prev->debugctlmsr) | 622 | debugctl = prev->debugctlmsr; |
623 | if (next->ds_area_msr != prev->ds_area_msr) { | ||
624 | /* we clear debugctl to make sure DS | ||
625 | * is not in use when we change it */ | ||
626 | debugctl = 0; | ||
627 | wrmsrl(MSR_IA32_DEBUGCTLMSR, 0); | ||
628 | wrmsr(MSR_IA32_DS_AREA, next->ds_area_msr, 0); | ||
629 | } | ||
630 | |||
631 | if (next->debugctlmsr != debugctl) | ||
622 | wrmsr(MSR_IA32_DEBUGCTLMSR, next->debugctlmsr, 0); | 632 | wrmsr(MSR_IA32_DEBUGCTLMSR, next->debugctlmsr, 0); |
623 | 633 | ||
624 | if (test_tsk_thread_flag(next_p, TIF_DEBUG)) { | 634 | if (test_tsk_thread_flag(next_p, TIF_DEBUG)) { |
@@ -642,6 +652,13 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, | |||
642 | } | 652 | } |
643 | #endif | 653 | #endif |
644 | 654 | ||
655 | if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS)) | ||
656 | ptrace_bts_take_timestamp(prev_p, BTS_TASK_DEPARTS); | ||
657 | |||
658 | if (test_tsk_thread_flag(next_p, TIF_BTS_TRACE_TS)) | ||
659 | ptrace_bts_take_timestamp(next_p, BTS_TASK_ARRIVES); | ||
660 | |||
661 | |||
645 | if (!test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) { | 662 | if (!test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) { |
646 | /* | 663 | /* |
647 | * Disable the bitmap via an invalid offset. We still cache | 664 | * Disable the bitmap via an invalid offset. We still cache |