x86/hw-breakpoints: Actually flush thread breakpoints in flush_thread().
authorPaul Mundt <lethal@linux-sh.org>
Mon, 5 Oct 2009 10:23:06 +0000 (19:23 +0900)
committerFrederic Weisbecker <fweisbec@gmail.com>
Tue, 3 Nov 2009 17:05:44 +0000 (18:05 +0100)
flush_thread() tries to do a TIF_DEBUG check before calling in to
flush_thread_hw_breakpoint() (which subsequently clears the thread flag),
but for some reason, the x86 code is manually clearing TIF_DEBUG
immediately before the test, so this path will never be taken.

This kills off the erroneous clear_tsk_thread_flag() and lets
flush_thread_hw_breakpoint() actually get invoked.

Presumably folks were getting lucky with testing and the
free_thread_info() -> free_thread_xstate() path was taking care of the
flush there.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Alan Stern <stern@rowland.harvard.edu>
LKML-Reference: <20091005102306.GA7889@linux-sh.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
arch/x86/kernel/process.c

index 2275ce5..cf8ee00 100644 (file)
@@ -107,8 +107,6 @@ void flush_thread(void)
        }
 #endif
 
-       clear_tsk_thread_flag(tsk, TIF_DEBUG);
-
        if (unlikely(test_tsk_thread_flag(tsk, TIF_DEBUG)))
                flush_thread_hw_breakpoint(tsk);
        memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));