summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-10-01mn10300: get rid of calling do_notify_resume() when returning to kernel modeAl Viro2-5/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01xtensa: can't get to do_notify_resume() when user_mode(regs) is not trueAl Viro1-3/+0
asm glue checks that Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01c6x: switch to generic kernel_thread()Al Viro3-21/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01c6x: switch to generic sys_execveMark Salter4-50/+1
Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01c6x: switch to generic kernel_execveMark Salter2-7/+8
Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01c6x: add ret_from_kernel_thread(), simplify kernel_thread()Mark Salter2-26/+32
Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01mn10300: convert to generic kernel_thread()Al Viro3-36/+19
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01mn10300: switch to generic kernel_execve()Al Viro6-49/+13
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01mn10300: switch to generic sys_execve()Al Viro3-16/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01mn10300: split ret_from_fork, simplify kernel_thread()Al Viro5-71/+27
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01frv: switch to generic kernel_thread()Al Viro3-23/+20
2012-10-01frv: switch to generic kernel_execveAl Viro5-39/+10
Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01frv: switch to generic sys_execve()Al Viro3-19/+2
current_pt_regs() here is simply __frame Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01frv: split ret_from_fork, simplify kernel_thread() a lotAl Viro5-100/+32
Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01m68k: switch to generic sys_execve()/kernel_execve()Al Viro5-37/+9
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>
2012-10-01m68k: split ret_from_fork(), simplify kernel_thread()Al Viro4-62/+36
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01m68k: always set stack frame format for ColdFire on thread startGreg Ungerer1-11/+12
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>
2012-10-01powerpc: switch to generic sys_execve()/kernel_execve()Al Viro8-51/+21
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>
2012-10-01powerpc: split ret_from_forkAl Viro8-84/+43
... and get rid of in-kernel syscalls in kernel_thread() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01s390: convert to generic kernel_execve()Al Viro3-49/+13
same situation as with alpha and arm - only massage needed Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01s390: switch to generic kernel_thread()Al Viro3-40/+34
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01s390: fold kernel_thread_helper() into ret_from_fork()Al Viro3-16/+28
... and don't bother with syscall return path in case of kernel threads. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01s390: fold execve_tail() into start_thread(), convert to generic sys_execve()Al Viro9-61/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01um: switch to generic kernel_thread()Al Viro3-16/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01x86, um/x86: switch to generic sys_execve and kernel_execveAl Viro17-158/+34
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>
2012-10-01x86: split ret_from_forkAl Viro7-85/+67
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01alpha: introduce ret_from_kernel_execve(), switch to generic kernel_execve()Al Viro3-19/+14
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01alpha: switch to generic kernel_thread()Al Viro5-72/+31
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01alpha: switch to generic sys_execve()Al Viro3-30/+1
get rid of sys_execve() wrapper, while we are at it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01arm: get rid of execve wrapper, switch to generic execve() implementationAl Viro4-26/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01arm: optimized current_pt_regs()Al Viro1-0/+5
... 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>
2012-10-01arm: introduce ret_from_kernel_execve(), switch to generic kernel_execve()Al Viro3-42/+13
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01arm: split ret_from_fork, simplify kernel_thread() [based on patch by rmk]Al Viro4-67/+26
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-01generic sys_execve()Al Viro2-6/+40
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>
2012-09-30generic kernel_execve()Al Viro2-0/+27
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>
2012-09-30new helper: current_pt_regs()Al Viro1-0/+4
Normally (and that's the default) it's just task_pt_regs(current). However, if an architecture can optimize that, it can do so by making a macro of its own available from asm/ptrace.h. More importantly, some architectures have task_pt_regs() working only for traced tasks blocked on signal delivery. current_pt_regs() needs to work for *all* processes, so before those architectures start using stuff relying on current_pt_regs() they'll need a properly working variant. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-30preparation for generic kernel_thread()Al Viro3-1/+18
Let architectures select GENERIC_KERNEL_THREAD and have their copy_thread() treat NULL regs as "it came from kernel_thread(), sp argument contains the function new thread will be calling and stack_size - the argument for that function". Switching the architectures begins shortly... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20um: kill thread->forkingAl Viro7-66/+29
we only use that to tell copy_thread() done by syscall from that done by kernel_thread(). However, it's easier to do simply by checking PF_KTHREAD in thread flags. Merge sys_clone() guts for 32bit and 64bit, while we are at it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20um: let signal_delivered() do SIGTRAP on singlestepping into handlerAl Viro2-7/+5
... rather than duplicating that in sigframe setup code (and doing that inconsistently, at that) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20um: don't leak floating point state and segment registers on execve()Al Viro1-0/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20um: take cleaning singlestep to start_thread()Al Viro1-19/+5
... assuming it's needed to be done at all Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20don't bother exporting kernel_execve()Al Viro3-3/+0
most of the architectures don't and there's not a single caller outside of core kernel. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20the only place that needs to include asm/exec.h is linux/binfmts.hAl Viro5-4/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20get rid of generic instances of asm/exec.hAl Viro36-195/+22
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-20x86: get rid of TIF_IRET hackeryAl Viro5-17/+8
TIF_NOTIFY_RESUME will work in precisely the same way; all that is achieved by TIF_IRET is appearing that there's some work to be done, so we end up on the iret exit path. Just use NOTIFY_RESUME. And for execve() do that in 32bit start_thread(), not sys_execve() itself. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-09-19Merge branch 'for-linus' of git://git.kernel.dk/linux-blockLinus Torvalds5-20/+39
Pull block fixes from Jens Axboe: "A small collection of driver fixes/updates and a core fix for 3.6. It contains: - Bug fixes for mtip32xx, and support for new hardware (just addition of IDs). They have been queued up for 3.7 for a few weeks as well. - rate-limit a failing command error message in block core. - A fix for an old cciss bug from Stephen. - Prevent overflow of partition count from Alan." * 'for-linus' of git://git.kernel.dk/linux-block: cciss: fix handling of protocol error blk: add an upper sanity check on partition adding mtip32xx: fix user_buffer check in exec_drive_command mtip32xx: Remove dead code mtip32xx: Change printk to pr_xxxx mtip32xx: Proper reporting of write protect status on big-endian mtip32xx: Increase timeout for standby command mtip32xx: Handle NCQ commands during the security locked state mtip32xx: Add support for new devices block: rate-limit the error message from failing commands
2012-09-19Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-shLinus Torvalds4-4/+5
Pull SuperH fixes from Paul Mundt. * tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: sh: Fix up TIF_NOTIFY_RESUME sans TIF_SIGPENDING handling. sh: pfc: Release spinlock in sh_pfc_gpio_request_enable() error path sh: intc: Fix up multi-evt irq association.
2012-09-19Merge tag 'rpmsg-3.6-fix' of ↵Linus Torvalds1-3/+3
git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg Pull rpmsg fix from Ohad Ben-Cohen: "A quick rpmsg fix from Fernando, fixing two buggy invocations of dma_free_coherent" * tag 'rpmsg-3.6-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg: rpmsg: fix dma_free_coherent dev parameter
2012-09-19Merge tag 'md-3.6-fixes' of git://neil.brown.name/mdLinus Torvalds2-2/+10
Pull md fixes from NeilBrown: "3 fixes for md in 3.6. One reverts a recent patch which turns out to not be such a good idea. Other two fix minor bugs with the new (since 3.3) 'replacement' code and have been tagged for -stable." * tag 'md-3.6-fixes' of git://neil.brown.name/md: md: make sure metadata is updated when spares are activated or removed. md/raid5: fix calculate of 'degraded' when a replacement becomes active. Revert "md/raid5: For odirect-write performance, do not set STRIPE_PREREAD_ACTIVE."
2012-09-19Merge branch 'for-3.6-fixes' of ↵Linus Torvalds2-46/+42
git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue / powernow-k8 fix from Tejun Heo: "This is the fix for the bug where cpufreq/powernow-k8 was tripping BUG_ON() in try_to_wake_up_local() by migrating workqueue worker to a different CPU. https://bugzilla.kernel.org/show_bug.cgi?id=47301 As discussed, the fix is now two parts - one to reimplement work_on_cpu() so that it doesn't create a new kthread each time and the actual fix which makes powernow-k8 use work_on_cpu() instead of performing manual migration. While pretty late in the merge cycle, both changes are on the safer side. Jiri and I verified two existing users of work_on_cpu() and Duncan confirmed that the powernow-k8 fix survived about 18 hours of testing." * 'for-3.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another CPU workqueue: reimplement work_on_cpu() using system_wq