MN10300: Fix ret_from_kernel_thread
authorDavid Howells <dhowells@redhat.com>
Tue, 28 May 2013 19:21:02 +0000 (20:21 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 30 May 2013 04:38:48 +0000 (13:38 +0900)
ret_from_kernel_thread needs to set A2 to the thread_info pointer before
jumping to syscall_exit.

Without this, we never correctly start userspace.

This was caused by the rejuggling of the fork/exec paths in commit
ddf23e87a804 ("mn10300: switch to saner kernel_execve() semantics")

Reported-by: Ken Cox <jkc@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Ken Cox <jkc@redhat.com>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/mn10300/kernel/entry.S

index 68fcab8f8f6f5eadebd5a18715034d6b33c8d781..9420057537200ebe601a5024ddc7b6664c122a3b 100644 (file)
@@ -60,6 +60,7 @@ ENTRY(ret_from_kernel_thread)
        mov     (REG_D0,fp),d0
        mov     (REG_A0,fp),a0
        calls   (a0)
+       GET_THREAD_INFO a2              # A2 must be set on return from sys_exit()
        clr     d0
        mov     d0,(REG_D0,fp)
        jmp     syscall_exit