From 54d496c3915a10b5e46c5dd9de1a6d301ceb32bd Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 14 Oct 2012 15:43:06 -0400 Subject: ia64: switch to generic kernel_thread()/kernel_execve() Acked-by: Tony Luck Tested-by: Tony Luck Signed-off-by: Al Viro --- arch/ia64/include/asm/processor.h | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'arch/ia64/include/asm') diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h index 944152a50912..e0a899a1a8a6 100644 --- a/arch/ia64/include/asm/processor.h +++ b/arch/ia64/include/asm/processor.h @@ -340,22 +340,6 @@ struct task_struct; */ #define release_thread(dead_task) -/* - * This is the mechanism for creating a new kernel thread. - * - * NOTE 1: Only a kernel-only process (ie the swapper or direct - * descendants who haven't done an "execve()") should use this: it - * will work within a system call from a "real" process, but the - * process memory space will not be free'd until both the parent and - * the child have exited. - * - * NOTE 2: This MUST NOT be an inlined function. Otherwise, we get - * into trouble in init/main.c when the child thread returns to - * do_basic_setup() and the timing is such that free_initmem() has - * been called already. - */ -extern pid_t kernel_thread (int (*fn)(void *), void *arg, unsigned long flags); - /* Get wait channel for task P. */ extern unsigned long get_wchan (struct task_struct *p); -- cgit v1.2.3 From 71b4ecc3d8056b2ed5cbc0d77af13fed38bcac49 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 14 Oct 2012 15:53:04 -0400 Subject: ia64: switch to generic sys_execve() Acked-by: Tony Luck Tested-by: Tony Luck Signed-off-by: Al Viro --- arch/ia64/include/asm/unistd.h | 1 + arch/ia64/kernel/entry.S | 4 +--- arch/ia64/kernel/process.c | 19 ------------------- 3 files changed, 2 insertions(+), 22 deletions(-) (limited to 'arch/ia64/include/asm') diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index 8b3ff2f5b861..1574bca86138 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -29,6 +29,7 @@ #define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGSUSPEND +#define __ARCH_WANT_SYS_EXECVE #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 0dea684e1905..940a67263629 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S @@ -61,14 +61,13 @@ ENTRY(ia64_execve) * Allocate 8 input registers since ptrace() may clobber them */ .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) - alloc loc1=ar.pfs,8,2,4,0 + alloc loc1=ar.pfs,8,2,3,0 mov loc0=rp .body mov out0=in0 // filename ;; // stop bit between alloc and call mov out1=in1 // argv mov out2=in2 // envp - add out3=16,sp // regs br.call.sptk.many rp=sys_execve .ret0: cmp4.ge p6,p7=r8,r0 @@ -76,7 +75,6 @@ ENTRY(ia64_execve) sxt4 r8=r8 // return 64-bit result ;; stf.spill [sp]=f0 -(p6) cmp.ne pKStk,pUStk=r0,r0 // a successful execve() lands us in user-mode... mov rp=loc0 (p6) mov ar.pfs=r0 // clear ar.pfs on success (p7) br.ret.sptk.many rp diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 37686dbfd264..25543a295ad9 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c @@ -617,25 +617,6 @@ dump_fpu (struct pt_regs *pt, elf_fpregset_t dst) return 1; /* f0-f31 are always valid so we always return 1 */ } -long -sys_execve (const char __user *filename, - const char __user *const __user *argv, - const char __user *const __user *envp, - struct pt_regs *regs) -{ - struct filename *fname; - int error; - - fname = getname(filename); - error = PTR_ERR(fname); - if (IS_ERR(fname)) - goto out; - error = do_execve(fname->name, argv, envp, regs); - putname(fname); -out: - return error; -} - /* * Flush thread state. This is called when a thread does an execve(). */ -- cgit v1.2.3 From 4f4202fe5ae9a43e59303f20d700571f695d7b1b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 5 Nov 2012 12:59:15 -0500 Subject: unify default ptrace_signal_deliver Signed-off-by: Al Viro --- arch/alpha/include/asm/signal.h | 3 --- arch/arm/include/asm/signal.h | 1 - arch/avr32/include/asm/signal.h | 2 -- arch/cris/include/asm/signal.h | 6 ------ arch/h8300/include/asm/signal.h | 2 -- arch/ia64/include/asm/signal.h | 2 -- arch/m32r/include/asm/signal.h | 4 ---- arch/m68k/include/asm/signal.h | 5 ++--- arch/mips/include/asm/signal.h | 2 -- arch/mn10300/include/asm/signal.h | 4 ---- arch/parisc/include/asm/signal.h | 2 -- arch/powerpc/include/asm/signal.h | 2 -- arch/s390/include/asm/signal.h | 2 -- arch/sparc/include/asm/signal.h | 2 -- arch/x86/include/asm/signal.h | 2 -- arch/xtensa/include/asm/signal.h | 1 - include/asm-generic/signal.h | 2 -- include/linux/ptrace.h | 4 ++++ 18 files changed, 6 insertions(+), 42 deletions(-) (limited to 'arch/ia64/include/asm') diff --git a/arch/alpha/include/asm/signal.h b/arch/alpha/include/asm/signal.h index a9388300abb1..45552862cc10 100644 --- a/arch/alpha/include/asm/signal.h +++ b/arch/alpha/include/asm/signal.h @@ -164,9 +164,6 @@ struct sigstack { #ifdef __KERNEL__ #include - -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif #endif diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h index 5a7963dbd3fb..9a0ea6ab988f 100644 --- a/arch/arm/include/asm/signal.h +++ b/arch/arm/include/asm/signal.h @@ -35,5 +35,4 @@ struct k_sigaction { }; #include -#define ptrace_signal_deliver(regs, cookie) do { } while (0) #endif diff --git a/arch/avr32/include/asm/signal.h b/arch/avr32/include/asm/signal.h index 4d502fd6bad3..9326d182e9e5 100644 --- a/arch/avr32/include/asm/signal.h +++ b/arch/avr32/include/asm/signal.h @@ -37,6 +37,4 @@ struct k_sigaction { #include #undef __HAVE_ARCH_SIG_BITOPS -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif diff --git a/arch/cris/include/asm/signal.h b/arch/cris/include/asm/signal.h index ea6af9aad76c..72dbbf59dfae 100644 --- a/arch/cris/include/asm/signal.h +++ b/arch/cris/include/asm/signal.h @@ -152,12 +152,6 @@ typedef struct sigaltstack { #ifdef __KERNEL__ #include - -/* here we could define asm-optimized sigaddset, sigdelset etc. operations. - * if we don't, generic ones are used from linux/signal.h - */ -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* __KERNEL__ */ #endif diff --git a/arch/h8300/include/asm/signal.h b/arch/h8300/include/asm/signal.h index fd8b66e40dca..c43c0a7d2c2e 100644 --- a/arch/h8300/include/asm/signal.h +++ b/arch/h8300/include/asm/signal.h @@ -154,8 +154,6 @@ typedef struct sigaltstack { #include #undef __HAVE_ARCH_SIG_BITOPS -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* __KERNEL__ */ #endif /* _H8300_SIGNAL_H */ diff --git a/arch/ia64/include/asm/signal.h b/arch/ia64/include/asm/signal.h index aecda5b9eb4e..3a1b20e74c5c 100644 --- a/arch/ia64/include/asm/signal.h +++ b/arch/ia64/include/asm/signal.h @@ -38,7 +38,5 @@ struct k_sigaction { # include -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - # endif /* !__ASSEMBLY__ */ #endif /* _ASM_IA64_SIGNAL_H */ diff --git a/arch/m32r/include/asm/signal.h b/arch/m32r/include/asm/signal.h index ea5f95e4079e..e4d2e2ad5f1e 100644 --- a/arch/m32r/include/asm/signal.h +++ b/arch/m32r/include/asm/signal.h @@ -149,10 +149,6 @@ typedef struct sigaltstack { #undef __HAVE_ARCH_SIG_BITOPS -struct pt_regs; - -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* __KERNEL__ */ #endif /* _ASM_M32R_SIGNAL_H */ diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h index 2df26b57c26a..eb51a5241187 100644 --- a/arch/m68k/include/asm/signal.h +++ b/arch/m68k/include/asm/signal.h @@ -86,11 +86,10 @@ static inline int sigfindinword(unsigned long word) #endif /* !CONFIG_CPU_HAS_NO_BITFIELDS */ -#ifdef __uClinux__ -#define ptrace_signal_deliver(regs, cookie) do { } while (0) -#else +#ifndef __uClinux__ struct pt_regs; extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); +#define ptrace_signal_deliver ptrace_signal_deliver #endif /* __uClinux__ */ #endif /* _M68K_SIGNAL_H */ diff --git a/arch/mips/include/asm/signal.h b/arch/mips/include/asm/signal.h index 880240dff8b7..cf4a08062d1d 100644 --- a/arch/mips/include/asm/signal.h +++ b/arch/mips/include/asm/signal.h @@ -21,6 +21,4 @@ #include #include -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* _ASM_SIGNAL_H */ diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h index f9668ec3040c..d280e9780793 100644 --- a/arch/mn10300/include/asm/signal.h +++ b/arch/mn10300/include/asm/signal.h @@ -45,8 +45,4 @@ struct k_sigaction { }; #include - -struct pt_regs; -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* _ASM_SIGNAL_H */ diff --git a/arch/parisc/include/asm/signal.h b/arch/parisc/include/asm/signal.h index 21abf4fc169a..0fdb3c835952 100644 --- a/arch/parisc/include/asm/signal.h +++ b/arch/parisc/include/asm/signal.h @@ -34,8 +34,6 @@ struct k_sigaction { struct sigaction sa; }; -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #include #endif /* !__ASSEMBLY */ diff --git a/arch/powerpc/include/asm/signal.h b/arch/powerpc/include/asm/signal.h index 189998bb61c4..a101637725a2 100644 --- a/arch/powerpc/include/asm/signal.h +++ b/arch/powerpc/include/asm/signal.h @@ -3,6 +3,4 @@ #include -struct pt_regs; -#define ptrace_signal_deliver(regs, cookie) do { } while (0) #endif /* _ASM_POWERPC_SIGNAL_H */ diff --git a/arch/s390/include/asm/signal.h b/arch/s390/include/asm/signal.h index bffdbdd5b3d7..db7ddfaf5b79 100644 --- a/arch/s390/include/asm/signal.h +++ b/arch/s390/include/asm/signal.h @@ -39,6 +39,4 @@ struct k_sigaction { struct sigaction sa; }; -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif diff --git a/arch/sparc/include/asm/signal.h b/arch/sparc/include/asm/signal.h index d243c2ae02d2..77b85850d543 100644 --- a/arch/sparc/include/asm/signal.h +++ b/arch/sparc/include/asm/signal.h @@ -26,7 +26,5 @@ struct k_sigaction { void __user *ka_restorer; }; -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* !(__ASSEMBLY__) */ #endif /* !(__SPARC_SIGNAL_H) */ diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h index 323973f4abf1..0dba8b7a6ac7 100644 --- a/arch/x86/include/asm/signal.h +++ b/arch/x86/include/asm/signal.h @@ -260,8 +260,6 @@ struct pt_regs; #endif /* !__i386__ */ -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ diff --git a/arch/xtensa/include/asm/signal.h b/arch/xtensa/include/asm/signal.h index 72fd44c85b70..6f586bd90e18 100644 --- a/arch/xtensa/include/asm/signal.h +++ b/arch/xtensa/include/asm/signal.h @@ -27,7 +27,6 @@ struct k_sigaction { }; #include -#define ptrace_signal_deliver(regs, cookie) do { } while (0) #endif /* __ASSEMBLY__ */ #endif /* _XTENSA_SIGNAL_H */ diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h index 98caa306122a..d840c90a157a 100644 --- a/include/asm-generic/signal.h +++ b/include/asm-generic/signal.h @@ -10,7 +10,5 @@ #include #undef __HAVE_ARCH_SIG_BITOPS -#define ptrace_signal_deliver(regs, cookie) do { } while (0) - #endif /* __ASSEMBLY__ */ #endif /* _ASM_GENERIC_SIGNAL_H */ diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index e0ff4689d35a..7aefbae2452e 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -329,6 +329,10 @@ static inline void user_single_step_siginfo(struct task_struct *tsk, #define current_pt_regs() task_pt_regs(current) #endif +#ifndef ptrace_signal_deliver +#define ptrace_signal_deliver(regs, cookie) do { } while (0) +#endif + extern int task_current_syscall(struct task_struct *target, long *callno, unsigned long args[6], unsigned int maxargs, unsigned long *sp, unsigned long *pc); -- cgit v1.2.3