lkml.org 
[lkml]   [2009]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 06/11] Use virtual debug registers in process/thread handling code

* prasad@linux.vnet.ibm.com <prasad@linux.vnet.ibm.com> wrote:

> @@ -437,16 +448,6 @@ __switch_to_xtra(struct task_struct *pre
> else if (next->debugctlmsr != prev->debugctlmsr)
> update_debugctlmsr(next->debugctlmsr);
>
> - if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
> - set_debugreg(next->debugreg0, 0);
> - set_debugreg(next->debugreg1, 1);
> - set_debugreg(next->debugreg2, 2);
> - set_debugreg(next->debugreg3, 3);
> - /* no 4 and 5 */
> - set_debugreg(next->debugreg6, 6);
> - set_debugreg(next->debugreg7, 7);
> - }
> -
> if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
> test_tsk_thread_flag(next_p, TIF_NOTSC)) {
> /* prev and next are different */
> @@ -595,6 +596,12 @@ __switch_to(struct task_struct *prev_p,
>
> percpu_write(current_task, next_p);
>
> + /*
> + * Handle debug registers. This must be done _after_ current
> + * is updated.
> + */
> + if (unlikely(test_tsk_thread_flag(next_p, TIF_DEBUG)))
> + switch_to_thread_hw_breakpoint(next_p);

why does this have to be called after 'current' has been
updated? AFAICS switch_to_thread_hw_breakpoint() does not take a
look at 'current'.

Speaking of switch_to_thread_hw_breakpoint(), i dont like that
function at all:

- why does it have to do a list of debug registers?

- why does it worry about IPIs arriving when context-switches on
x86 are always done with interrupts disabled?

- also, what do the ->installed() and ->uninstalled() callbacks
do - nothing uses it!

Ingo


\
 
 \ /
  Last update: 2009-03-10 15:53    [W:0.066 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site