1. 12 Oct, 2012 9 commits
    • Al Viro's avatar
      infrastructure for saner ret_from_kernel_thread semantics · a74fb73c
      Al Viro authored
      * 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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      a74fb73c
    • Al Viro's avatar
      make sure that kernel_thread() callbacks call do_exit() themselves · fb45550d
      Al Viro authored
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      fb45550d
    • Al Viro's avatar
      make sure that we always have a return path from kernel_execve() · d6b21238
      Al Viro authored
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d6b21238
    • Al Viro's avatar
      ppc: eeh_event should just use kthread_run() · ecf89e58
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      ecf89e58
    • Al Viro's avatar
      don't bother with kernel_thread/kernel_execve for launching linuxrc · ba4df280
      Al Viro authored
      exec_usermodehelper_fns() will do just fine...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      ba4df280
    • Al Viro's avatar
      alpha: get rid of switch_stack argument of do_work_pending() · cb450766
      Al Viro authored
      ... and now the asm glue side of that.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      cb450766
    • Al Viro's avatar
      alpha: don't bother passing switch_stack separately from regs · d9d0738a
      Al Viro authored
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d9d0738a
    • Al Viro's avatar
      alpha: take SIGPENDING/NOTIFY_RESUME loop into signal.c · 6972d6f2
      Al Viro authored
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      6972d6f2
    • Al Viro's avatar
      alpha: simplify TIF_NEED_RESCHED handling · 7721d3c2
      Al Viro authored
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      7721d3c2
  2. 01 Oct, 2012 31 commits