aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/process_32.c2
-rw-r--r--arch/x86/kernel/process_64.c2
-rw-r--r--arch/x86/kernel/ptrace.c12
3 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index a7d50a547dc2..be3c7a299f02 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -603,11 +603,13 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
603 } 603 }
604#endif 604#endif
605 605
606#ifdef X86_BTS
606 if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS)) 607 if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS))
607 ptrace_bts_take_timestamp(prev_p, BTS_TASK_DEPARTS); 608 ptrace_bts_take_timestamp(prev_p, BTS_TASK_DEPARTS);
608 609
609 if (test_tsk_thread_flag(next_p, TIF_BTS_TRACE_TS)) 610 if (test_tsk_thread_flag(next_p, TIF_BTS_TRACE_TS))
610 ptrace_bts_take_timestamp(next_p, BTS_TASK_ARRIVES); 611 ptrace_bts_take_timestamp(next_p, BTS_TASK_ARRIVES);
612#endif
611 613
612 614
613 if (!test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) { 615 if (!test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 43f287744f9f..3baf9b9f4c87 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -604,11 +604,13 @@ static inline void __switch_to_xtra(struct task_struct *prev_p,
604 memset(tss->io_bitmap, 0xff, prev->io_bitmap_max); 604 memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
605 } 605 }
606 606
607#ifdef X86_BTS
607 if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS)) 608 if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS))
608 ptrace_bts_take_timestamp(prev_p, BTS_TASK_DEPARTS); 609 ptrace_bts_take_timestamp(prev_p, BTS_TASK_DEPARTS);
609 610
610 if (test_tsk_thread_flag(next_p, TIF_BTS_TRACE_TS)) 611 if (test_tsk_thread_flag(next_p, TIF_BTS_TRACE_TS))
611 ptrace_bts_take_timestamp(next_p, BTS_TASK_ARRIVES); 612 ptrace_bts_take_timestamp(next_p, BTS_TASK_ARRIVES);
613#endif
612} 614}
613 615
614/* 616/*
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index d862e396b099..f41fdc98efb1 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -544,6 +544,8 @@ static int ptrace_set_debugreg(struct task_struct *child,
544 return 0; 544 return 0;
545} 545}
546 546
547#ifdef X86_BTS
548
547static int ptrace_bts_get_size(struct task_struct *child) 549static int ptrace_bts_get_size(struct task_struct *child)
548{ 550{
549 if (!child->thread.ds_area_msr) 551 if (!child->thread.ds_area_msr)
@@ -826,6 +828,7 @@ void ptrace_bts_take_timestamp(struct task_struct *tsk,
826 828
827 ptrace_bts_write_record(tsk, &rec); 829 ptrace_bts_write_record(tsk, &rec);
828} 830}
831#endif /* X86_BTS */
829 832
830/* 833/*
831 * Called by kernel/ptrace.c when detaching.. 834 * Called by kernel/ptrace.c when detaching..
@@ -839,7 +842,9 @@ void ptrace_disable(struct task_struct *child)
839 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); 842 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
840#endif 843#endif
841 if (child->thread.ds_area_msr) { 844 if (child->thread.ds_area_msr) {
845#ifdef X86_BTS
842 ptrace_bts_realloc(child, 0, 0); 846 ptrace_bts_realloc(child, 0, 0);
847#endif
843 child->thread.debugctlmsr &= ~ds_debugctl_mask(); 848 child->thread.debugctlmsr &= ~ds_debugctl_mask();
844 if (!child->thread.debugctlmsr) 849 if (!child->thread.debugctlmsr)
845 clear_tsk_thread_flag(child, TIF_DEBUGCTLMSR); 850 clear_tsk_thread_flag(child, TIF_DEBUGCTLMSR);
@@ -961,6 +966,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
961 break; 966 break;
962#endif 967#endif
963 968
969 /*
970 * These bits need more cooking - not enabled yet:
971 */
972#ifdef X86_BTS
964 case PTRACE_BTS_CONFIG: 973 case PTRACE_BTS_CONFIG:
965 ret = ptrace_bts_config 974 ret = ptrace_bts_config
966 (child, data, (struct ptrace_bts_config __user *)addr); 975 (child, data, (struct ptrace_bts_config __user *)addr);
@@ -988,6 +997,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
988 ret = ptrace_bts_drain 997 ret = ptrace_bts_drain
989 (child, data, (struct bts_struct __user *) addr); 998 (child, data, (struct bts_struct __user *) addr);
990 break; 999 break;
1000#endif
991 1001
992 default: 1002 default:
993 ret = ptrace_request(child, request, addr, data); 1003 ret = ptrace_request(child, request, addr, data);
@@ -1226,12 +1236,14 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
1226 case PTRACE_SETOPTIONS: 1236 case PTRACE_SETOPTIONS:
1227 case PTRACE_SET_THREAD_AREA: 1237 case PTRACE_SET_THREAD_AREA:
1228 case PTRACE_GET_THREAD_AREA: 1238 case PTRACE_GET_THREAD_AREA:
1239#ifdef X86_BTS
1229 case PTRACE_BTS_CONFIG: 1240 case PTRACE_BTS_CONFIG:
1230 case PTRACE_BTS_STATUS: 1241 case PTRACE_BTS_STATUS:
1231 case PTRACE_BTS_SIZE: 1242 case PTRACE_BTS_SIZE:
1232 case PTRACE_BTS_GET: 1243 case PTRACE_BTS_GET:
1233 case PTRACE_BTS_CLEAR: 1244 case PTRACE_BTS_CLEAR:
1234 case PTRACE_BTS_DRAIN: 1245 case PTRACE_BTS_DRAIN:
1246#endif
1235 return sys_ptrace(request, pid, addr, data); 1247 return sys_ptrace(request, pid, addr, data);
1236 1248
1237 default: 1249 default: