aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* unicore32: remove pointless testAl Viro2012-10-01
| | | | | | | | we can get into work_pending only if at least one of NEED_RESCHED, SIGPENDING or NOTIFY_RESUME is set. So once we'd found no NEED_RESCHED, there's no need to check that one of the other two is set. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* h8300: trim _TIF_WORK_MASKAl Viro2012-10-01
| | | | | | | Only the three usual flags (NEED_RESCHED/SIGPENDING/NOTIFY_RESUME) are looked at in the code checking _TIF_WORK_MASK on that one. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* parisc: decide whether to go to slow path (tracesys) based on thread flagsAl Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* parisc: don't bother looping in do_signal()Al Viro2012-10-01
| | | | | | | | | | entry.S code had been looping until no pending signals are left since 2005 anyway; no need to bother with that in do_signal() itself. If the failure to set a sigframe up raises SIGSEGV, we'll just pick it up the next time around the loop(s) in entry.S anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* parisc: fix double restartsAl Viro2012-10-01
| | | | | | | | Don't bother restoring r28 on syscall restarts; it's clobbered by syscall anyway. Reuse (now unused) ->orig_r28 as "no restarts allowed" flag. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* bury the rest of TIF_IRETAl Viro2012-10-01
| | | | | | Some architectures had blindly copied it for no reason whatsoever. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* sanitize tsk_is_polling()Al Viro2012-10-01
| | | | | | | | | | | | Make default just return 0. The current default (checking TIF_POLLING_NRFLAG) is taken to architectures that need it; ones that don't do polling in their idle threads don't need to defined TIF_POLLING_NRFLAG at all. ia64 defined both TS_POLLING (used by its tsk_is_polling()) and TIF_POLLING_NRFLAG (not used at all). Killed the latter... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* bury _TIF_RESTORE_SIGMASKAl Viro2012-10-01
| | | | | | never used... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* unicore32: unobfuscate _TIF_WORK_MASKAl Viro2012-10-01
| | | | | | bits 3..7 in flags are never set there, so this 0xff is pointless Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mips: NOTIFY_RESUME is not needed in TIF masksAl Viro2012-10-01
| | | | | | | If it's set, SIGPENDING is also set. And SIGPENDING is present in the masks... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mips: merge the identical "return from syscall" per-ABI codeAl Viro2012-10-01
| | | | | | | No need to keep 4 copies of that stuff; merged and taken to entry.S, unused public symbols there killed off. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mips: unobfuscate _TIF..._MASKAl Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mips: prevent hitting do_notify_resume() with !user_mode(regs)Al Viro2012-10-01
| | | | | | too late to do anything there... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ia64: can't reach do_signal() when returning to kernel modeAl Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* score: fix bogus restarts on sigreturn()Al Viro2012-10-01
| | | | | | | | | we *really* don't want to have restart logics hit when we are returning from sigreturn() - random replacement of %r4 with -4 just because a signal had been noticed from timer interrupt that came when %r4 happened to contain -514 is not nice at all. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mn10300: get rid of calling do_notify_resume() when returning to kernel modeAl Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* xtensa: can't get to do_notify_resume() when user_mode(regs) is not trueAl Viro2012-10-01
| | | | | | asm glue checks that Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* c6x: switch to generic kernel_thread()Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* c6x: switch to generic sys_execveMark Salter2012-10-01
| | | | | Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* c6x: switch to generic kernel_execveMark Salter2012-10-01
| | | | | Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* c6x: add ret_from_kernel_thread(), simplify kernel_thread()Mark Salter2012-10-01
| | | | | Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mn10300: convert to generic kernel_thread()Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mn10300: switch to generic kernel_execve()Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mn10300: switch to generic sys_execve()Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mn10300: split ret_from_fork, simplify kernel_thread()Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* frv: switch to generic kernel_thread()Al Viro2012-10-01
|
* frv: switch to generic kernel_execveAl Viro2012-10-01
| | | | | Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* frv: switch to generic sys_execve()Al Viro2012-10-01
| | | | | | | current_pt_regs() here is simply __frame Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* frv: split ret_from_fork, simplify kernel_thread() a lotAl Viro2012-10-01
| | | | | Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* m68k: switch to generic sys_execve()/kernel_execve()Al Viro2012-10-01
| | | | | | | | | | | | | | The tricky part here is that task_pt_regs() on m68k works *only* for process inside do_signal(). However, we need something much simpler - pt_regs of a process inside do_signal() may be at different offsets from the stack bottom, depending on the way we'd entered the kernel, but for a task inside sys_execve() it *is* at constant offset. Moreover, for a kernel thread about to become a userland process the same location is also fine - setting sp to that will leave the kernel stack pointer at the very bottom of the kernel stack when we finally switch to userland. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* m68k: split ret_from_fork(), simplify kernel_thread()Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* m68k: always set stack frame format for ColdFire on thread startGreg Ungerer2012-10-01
| | | | | | | | | | | | | | | | The stack frame "format" field needs to be explicitly set on thread creation on ColdFire. For a normal long word aligned user stack pointer the frame format is 0x4. We were doing this for non-MMU ColdFire, but not for the case with MMU enabled. So fix it so we always do it if targeting ColdFire. The old code happend to rely on the stack frame format being inhereted from the process calling exec. Furture changes means that may not always work, so we really do want to set it explicitly. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* powerpc: switch to generic sys_execve()/kernel_execve()Al Viro2012-09-30
| | | | | | | | the only non-obvious part is that current_pt_regs() is really needed here - task_pt_regs() is NULL for kernel threads; it's OK for ptrace uses (the thing task_pt_regs() is intended for), but not for us. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* powerpc: split ret_from_forkAl Viro2012-09-30
| | | | | | ... and get rid of in-kernel syscalls in kernel_thread() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* s390: convert to generic kernel_execve()Al Viro2012-09-30
| | | | | | same situation as with alpha and arm - only massage needed Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* s390: switch to generic kernel_thread()Al Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* s390: fold kernel_thread_helper() into ret_from_fork()Al Viro2012-09-30
| | | | | | | ... and don't bother with syscall return path in case of kernel threads. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* s390: fold execve_tail() into start_thread(), convert to generic sys_execve()Al Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* um: switch to generic kernel_thread()Al Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* x86, um/x86: switch to generic sys_execve and kernel_execveAl Viro2012-09-30
| | | | | | | | | 32bit wrapper is lost on that; 64bit one is *not*, since we need to arrange for full pt_regs on stack when we call sys_execve() and we need to load callee-saved ones from there afterwards. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* x86: split ret_from_forkAl Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: introduce ret_from_kernel_execve(), switch to generic kernel_execve()Al Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: switch to generic kernel_thread()Al Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: switch to generic sys_execve()Al Viro2012-09-30
| | | | | | get rid of sys_execve() wrapper, while we are at it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* arm: get rid of execve wrapper, switch to generic execve() implementationAl Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* arm: optimized current_pt_regs()Al Viro2012-09-30
| | | | | | | | | | | | | | | | ... no need to read current_thread_info()->task only to feed it to task_thread_page() immediately afterwards. Moreover, not using current_thread_info() at all ends up with better assembler - we need a location very close to the top of kernel stack page and it's actually better to do or with 0x1fff, followed be subtracting a small constant than and with ~0x1fff, followed by adding a large one. Both & and | would be a couple of insns (mvn lsr/mvn lsl for |, a pair of bic for &), but the following addition would cost a pair of add while the subtraction ends up as a single sub. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* arm: introduce ret_from_kernel_execve(), switch to generic kernel_execve()Al Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* arm: split ret_from_fork, simplify kernel_thread() [based on patch by rmk]Al Viro2012-09-30
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* generic sys_execve()Al Viro2012-09-30
| | | | | | | | | Selected by __ARCH_WANT_SYS_EXECVE in unistd.h. Requires * working current_pt_regs() * *NOT* doing a syscall-in-kernel kind of kernel_execve() implementation. Using generic kernel_execve() is fine. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* generic kernel_execve()Al Viro2012-09-30
| | | | | | | | | | | | | | | | | | | | | | based mostly on arm and alpha versions. Architectures can define __ARCH_WANT_KERNEL_EXECVE and use it, provided that * they have working current_pt_regs(), even for kernel threads. * kernel_thread-spawned threads do have space for pt_regs in the normal location. Normally that's as simple as switching to generic kernel_thread() and making sure that kernel threads do *not* go through return from syscall path; call the payload from equivalent of ret_from_fork if we are in a kernel thread (or just have separate ret_from_kernel_thread and make copy_thread() use it instead of ret_from_fork in kernel thread case). * they have ret_from_kernel_execve(); it is called after successful do_execve() done by kernel_execve() and gets normal pt_regs location passed to it as argument. It's essentially a longjmp() analog - it should set sp, etc. to the situation expected at the return for syscall and go there. Eventually the need for that sucker will disappear, but that'll take some surgery on kernel_thread() payloads. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>