aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* x86, um: convert to saner kernel_execve() semanticsAl Viro2012-10-12
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* infrastructure for saner ret_from_kernel_thread semanticsAl Viro2012-10-12
| | | | | | | | | | | | | | | | | | | | | * allow kernel_execve() leave the actual return to userland to caller (selected by CONFIG_GENERIC_KERNEL_EXECVE). Callers updated accordingly. * architecture that does select GENERIC_KERNEL_EXECVE in its Kconfig should have its ret_from_kernel_thread() do this: call schedule_tail call the callback left for it by copy_thread(); if it ever returns, that's because it has just done successful kernel_execve() jump to return from syscall IOW, its only difference from ret_from_fork() is that it does call the callback. * such an architecture should also get rid of ret_from_kernel_execve() and __ARCH_WANT_KERNEL_EXECVE This is the last part of infrastructure patches in that area - from that point on work on different architectures can live independently. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* make sure that kernel_thread() callbacks call do_exit() themselvesAl Viro2012-10-11
| | | | | | | | | | | | | | Most of them never returned anyway - only two functions had to be changed. That allows to simplify their callers a whole lot. Note that this does *not* apply to kthread_run() callbacks - all of those had been called from the same kernel_thread() callback, which did do_exit() already. This is strictly about very few low-level kernel_thread() callbacks (there are only 6 of those, mostly as part of kthread.h and kmod.h exported mechanisms, plus kernel_init() itself). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* make sure that we always have a return path from kernel_execve()Al Viro2012-10-11
| | | | | | | | | | | The only place where kernel_execve() is called without a way to return to the caller of kernel_thread() callback is kernel_post(). Reorganize kernel_init()/kernel_post() - instead of the former calling the latter in the end (and getting freed by it), have the latter *begin* with calling the former (and turn the latter into kernel_thread() callback, of course). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ppc: eeh_event should just use kthread_run()Al Viro2012-10-11
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* don't bother with kernel_thread/kernel_execve for launching linuxrcAl Viro2012-10-11
| | | | | | exec_usermodehelper_fns() will do just fine... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: get rid of switch_stack argument of do_work_pending()Al Viro2012-10-11
| | | | | | ... and now the asm glue side of that. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: don't bother passing switch_stack separately from regsAl Viro2012-10-11
| | | | | | | | It's needed only in setup_sigcontext() and it's always reg - <constant>; no point passing it all way down through the call chain. This is just the signal.c side of that stuff; next will come the asm glue one... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: take SIGPENDING/NOTIFY_RESUME loop into signal.cAl Viro2012-10-11
| | | | | | | | | | | | | Turn the slow side of work_pending into C function, including all the looping. What we get out of that: * we do _not_ call get_signal_to_deliver() with IRQs disabled anymore * no need to save/restore volatiles on each pass if there turns to be more than one (unlikely, but still) * all double-restart prevention is in C now. * glue gets simpler. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: simplify TIF_NEED_RESCHED handlingAl Viro2012-10-11
| | | | | | | | | | | | | | | | In case we have both NEED_RESCHED and SIGPENDING/NOTIFY_RESUME, handle the latter first. We'll get to original priorities in the next commit, but now that allows to simplify the treatment of NEED_RESCHED-only case nicely. Namely, now there no need to preserve the data for restarts across the call of schedule() in $work_resched; we can get there only if we had either returned from syscall without SIGPENDING (in which case we should've had no restart-worthy return value and want no restarts) or already got through do_notify_resume() call (in which case we want no restarts anymore). So we can just slap 0 into $19 instead of preserving it (and $20). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* alpha: don't open-code trace_report_syscall_{enter,exit}Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Uninclude linux/freezer.hRichard Weinberger2012-10-01
| | | | | | | | This include is no longer needed. (seems to be a leftover from try_to_freeze()) Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* m32r: trim masksAl Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* avr32: trim masksAl Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* tile: don't bother with SIGTRAP in setup_frameAl Viro2012-10-01
| | | | | | Tell signal_delivered() to do it instead. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* microblaze: don't bother with SIGTRAP in setup_rt_frame()Al Viro2012-10-01
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mn10300: don't bother with SIGTRAP in setup_frame()Al Viro2012-10-01
| | | | | | ... just tell signal_delivered() to do it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* frv: no need to raise SIGTRAP in setup_frame()Al Viro2012-10-01
| | | | | | signal_delivered() will do it in the same case... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* x86: get rid of duplicate code in case of CONFIG_VM86Al Viro2012-10-01
| | | | | | | | no need to have the call of do_notify_resume() + checks around it duplicated for vm86 case - a bit of rearranging of ifdefs and we'll have a perfectly fine copy to jump back to. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 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>