ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread()

This avoids races in the VFP code where the dead thread may have
state on another CPU.  By moving this code to exit_thread(), we
will be running as the thread, and therefore be running on the
current CPU.

This means that we can ensure that the only local state is accessed
in the thread notifiers.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Esse commit está contido em:
Russell King
2009-12-18 14:34:43 +00:00
commit 797245f5da
5 arquivos alterados com 19 adições e 18 exclusões

Ver arquivo

@@ -51,7 +51,7 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
* initialised state information on the first fault.
*/
case THREAD_NOTIFY_RELEASE:
case THREAD_NOTIFY_EXIT:
crunch_task_release(thread);
break;

Ver arquivo

@@ -274,17 +274,18 @@ void show_regs(struct pt_regs * regs)
__backtrace();
}
ATOMIC_NOTIFIER_HEAD(thread_notify_head);
EXPORT_SYMBOL_GPL(thread_notify_head);
/*
* Free current thread data structures etc..
*/
void exit_thread(void)
{
thread_notify(THREAD_NOTIFY_EXIT, current_thread_info());
}
ATOMIC_NOTIFIER_HEAD(thread_notify_head);
EXPORT_SYMBOL_GPL(thread_notify_head);
void flush_thread(void)
{
struct thread_info *thread = current_thread_info();
@@ -299,9 +300,6 @@ void flush_thread(void)
void release_thread(struct task_struct *dead_task)
{
struct thread_info *thread = task_thread_info(dead_task);
thread_notify(THREAD_NOTIFY_RELEASE, thread);
}
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");

Ver arquivo

@@ -70,7 +70,7 @@ static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t)
* initialised state information on the first fault.
*/
case THREAD_NOTIFY_RELEASE:
case THREAD_NOTIFY_EXIT:
iwmmxt_task_release(thread);
break;