aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/ptrace.c
diff options
context:
space:
mode:
authorStephane Eranian <eranian@hpl.hp.com>2006-09-26 04:52:28 -0400
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 04:52:28 -0400
commitd3a4f48d4866b8623ca9adde8ce4e5fde979c132 (patch)
tree04413a1f18c6f49688d6008b583b20a287920a0f /arch/x86_64/kernel/ptrace.c
parent2f766d16062d0147edff91be15de4a950667ca42 (diff)
[PATCH] x86-64 TIF flags for debug regs and io bitmap in ctxsw
Hello, Following my discussion with Andi. Here is a patch that introduces two new TIF flags to simplify the context switch code in __switch_to(). The idea is to minimize the number of cache lines accessed in the common case, i.e., when neither the debug registers nor the I/O bitmap are used. This patch covers the x86-64 modifications. A patch for i386 follows. Changelog: - add TIF_DEBUG to track when debug registers are active - add TIF_IO_BITMAP to track when I/O bitmap is used - modify __switch_to() to use the new TIF flags <signed-off-by>: eranian@hpl.hp.com Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/ptrace.c')
-rw-r--r--arch/x86_64/kernel/ptrace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index 2d50024c9f30..d35ec1bc696a 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -420,9 +420,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
420 if ((0x5554 >> ((data >> (16 + 4*i)) & 0xf)) & 1) 420 if ((0x5554 >> ((data >> (16 + 4*i)) & 0xf)) & 1)
421 break; 421 break;
422 if (i == 4) { 422 if (i == 4) {
423 child->thread.debugreg7 = data; 423 child->thread.debugreg7 = data;
424 if (data)
425 set_tsk_thread_flag(child, TIF_DEBUG);
426 else
427 clear_tsk_thread_flag(child, TIF_DEBUG);
424 ret = 0; 428 ret = 0;
425 } 429 }
426 break; 430 break;
427 } 431 }
428 break; 432 break;