aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_32.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-01-30 07:30:54 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:54 -0500
commit7e9916040b3020d0f36d68bb7512e3b80b623097 (patch)
tree7c391bcdb7a5d917b54ae968304e8a951997e16e /arch/x86/kernel/process_32.c
parent0a049bb0ab807b4a95dce9cd0b603c01c199a287 (diff)
x86: debugctlmsr context switch
This adds low-level support for a per-thread value of MSR_IA32_DEBUGCTLMSR. The per-thread value is switched in when TIF_DEBUGCTLMSR is set. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/process_32.c')
-rw-r--r--arch/x86/kernel/process_32.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index d9905c9d0fd5..d5462f228daf 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -602,10 +602,14 @@ static noinline void
602__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, 602__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
603 struct tss_struct *tss) 603 struct tss_struct *tss)
604{ 604{
605 struct thread_struct *next; 605 struct thread_struct *prev, *next;
606 606
607 prev = &prev_p->thread;
607 next = &next_p->thread; 608 next = &next_p->thread;
608 609
610 if (next->debugctlmsr != prev->debugctlmsr)
611 wrmsr(MSR_IA32_DEBUGCTLMSR, next->debugctlmsr, 0);
612
609 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) { 613 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
610 set_debugreg(next->debugreg[0], 0); 614 set_debugreg(next->debugreg[0], 0);
611 set_debugreg(next->debugreg[1], 1); 615 set_debugreg(next->debugreg[1], 1);