]> git.karo-electronics.de Git - linux-beck.git/commitdiff
powerpc: switch to saner kernel_execve() semantics
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 11 Oct 2012 12:41:43 +0000 (08:41 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 14 Oct 2012 23:35:44 +0000 (19:35 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/powerpc/Kconfig
arch/powerpc/include/asm/unistd.h
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/process.c

index a902a5c1c76a337280fb8b6d42500e0e6f2caffb..5af5aa707176ff460b5185b080749ecb32392401 100644 (file)
@@ -144,6 +144,7 @@ config PPC
        select GENERIC_KERNEL_THREAD
        select HAVE_MOD_ARCH_SPECIFIC
        select MODULES_USE_ELF_RELA
+       select GENERIC_KERNEL_EXECVE
 
 config EARLY_PRINTK
        bool
index 921dce6d84458d3ef02b7b8ea1a6590809c226ef..280068cfff2e8721e39e4582277de4670bd09793 100644 (file)
@@ -56,7 +56,6 @@
 #define __ARCH_WANT_COMPAT_SYS_SENDFILE
 #endif
 #define __ARCH_WANT_SYS_EXECVE
-#define __ARCH_WANT_KERNEL_EXECVE
 
 /*
  * "Conditional" syscalls
index 9499385676e784362c20eade975ae396aaff144d..d22e73e4618b7924879517f1f59cb99dcd63b43e 100644 (file)
@@ -444,11 +444,6 @@ ret_from_kernel_thread:
        PPC440EP_ERR42
        blrl
        li      r3,0
-       b       do_exit         # no return
-
-       .globl  __ret_from_kernel_execve
-__ret_from_kernel_execve:
-       addi    r1,r3,-STACK_FRAME_OVERHEAD
        b       ret_from_syscall
 
 /* Traced system call support */
index 56e0ff0878b5534c76b8c93818f7536498ce52df..2eb766ad1c5cf609711b107314fc59e3a614dcb3 100644 (file)
@@ -378,12 +378,6 @@ _GLOBAL(ret_from_kernel_thread)
        mr      r3,r15
        blrl
        li      r3,0
-       b       .do_exit        # no return
-
-_GLOBAL(__ret_from_kernel_execve)
-       addi    r1,r3,-STACK_FRAME_OVERHEAD
-       li      r10,1
-       std     r10,SOFTE(r1)
        b       syscall_exit
 
        .section        ".toc","aw"
index ba48233500f6d47d7f2a554f5023f23060b5cff2..9e685e26c2d17ae89bd8ddfcf8f9bfcc22c43033 100644 (file)
@@ -746,19 +746,21 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        sp -= sizeof(struct pt_regs);
        childregs = (struct pt_regs *) sp;
        if (!regs) {
-               /* for kernel thread, set `current' and stackptr in new task */
+               struct thread_info *ti = (void *)task_stack_page(p);
                memset(childregs, 0, sizeof(struct pt_regs));
                childregs->gpr[1] = sp + sizeof(struct pt_regs);
 #ifdef CONFIG_PPC64
                childregs->gpr[14] = *(unsigned long *)usp;
                childregs->gpr[2] = ((unsigned long *)usp)[1],
                clear_tsk_thread_flag(p, TIF_32BIT);
+               childregs->softe = 1;
 #else
                childregs->gpr[14] = usp;       /* function */
                childregs->gpr[2] = (unsigned long) p;
 #endif
                childregs->gpr[15] = arg;
                p->thread.regs = NULL;  /* no user register state */
+               ti->flags |= _TIF_RESTOREALL;
                f = ret_from_kernel_thread;
        } else {
                CHECK_FULL_REGS(regs);
@@ -1063,15 +1065,6 @@ int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
                        regs, 0, NULL, NULL);
 }
 
-void __ret_from_kernel_execve(struct pt_regs *normal)
-__noreturn;
-
-void ret_from_kernel_execve(struct pt_regs *normal)
-{
-       set_thread_flag(TIF_RESTOREALL);
-       __ret_from_kernel_execve(normal);
-}
-
 static inline int valid_irq_stack(unsigned long sp, struct task_struct *p,
                                  unsigned long nbytes)
 {