aboutsummaryrefslogtreecommitdiff
path: root/arch/um/kernel
AgeCommit message (Collapse)AuthorFilesLines
2012-09-27um: take cleaning singlestep to start_thread()Al Viro1-19/+5
... assuming it's needed to be done at all Signed-off-by: Al Viro <[email protected]>
2012-09-20um: kill thread->forkingAl Viro2-16/+16
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 <[email protected]>
2012-09-20um: let signal_delivered() do SIGTRAP on singlestepping into handlerAl Viro1-1/+5
... rather than duplicating that in sigframe setup code (and doing that inconsistently, at that) Signed-off-by: Al Viro <[email protected]>
2012-09-20um: don't leak floating point state and segment registers on execve()Al Viro1-0/+1
Signed-off-by: Al Viro <[email protected]>
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 <[email protected]>
2012-08-01Merge branch 'for-linus-3.6-rc1' of ↵Linus Torvalds6-62/+71
git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML fixes from Richard Weinberger: "This patch set contains mostly fixes and cleanups. The UML tty driver uses now tty_port and is no longer broken like hell :-)" * 'for-linus-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: Add arch/x86/um to MAINTAINERS um: pass siginfo to guest process um: fix ubd_file_size for read-only files um: pull interrupt_end() into userspace() um: split syscall_trace(), pass pt_regs to it um: switch UPT_SET_RETURN_VALUE and regs_return_value to pt_regs um: set BLK_CGROUP=y in defconfig um: remove count_lock um: fully use tty_port um: Remove dead code um: remove line_ioctl() TTY: um/line, use tty from tty_port TTY: um/line, add tty_port
2012-08-02um: pass siginfo to guest processMartin Pärtel3-9/+34
UML guest processes now get correct siginfo_t for SIGTRAP, SIGFPE, SIGILL and SIGBUS. Specifically, si_addr and si_code are now correct where previously they were si_addr = NULL and si_code = 128. Signed-off-by: Martin Pärtel <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-08-02um: pull interrupt_end() into userspace()Al Viro1-8/+3
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-08-02um: split syscall_trace(), pass pt_regs to itAl Viro2-43/+32
Signed-off-by: Al Viro <[email protected]> [[email protected]: Fixed some minor build issues] Signed-off-by: Richard Weinberger <[email protected]>
2012-08-01um: switch UPT_SET_RETURN_VALUE and regs_return_value to pt_regsAl Viro2-2/+2
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-07-19um: remove IRQF_SAMPLE_RANDOM which is now a no-opTheodore Ts'o1-2/+1
With the changes in the random tree, IRQF_SAMPLE_RANDOM is now a no-op; interrupt randomness is now collected unconditionally in a very low-overhead fashion; see commit 775f4b297b. The IRQF_SAMPLE_RANDOM flag was scheduled to be removed in 2009 on the feature-removal-schedule, so this patch is preparation for the final removal of this flag. Signed-off-by: "Theodore Ts'o" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]>
2012-06-01new helper: signal_delivered()Al Viro1-1/+1
Does block_sigmask() + tracehook_signal_handler(); called when sigframe has been successfully built. All architectures converted to it; block_sigmask() itself is gone now (merged into this one). I'm still not too happy with the signature, but that's a separate story (IMO we need a structure that would contain signal number + siginfo + k_sigaction, so that get_signal_to_deliver() would fill one, signal_delivered(), handle_signal() and probably setup...frame() - take one). Signed-off-by: Al Viro <[email protected]>
2012-06-01most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from setAl Viro1-4/+0
Only 3 out of 63 do not. Renamed the current variant to __set_current_blocked(), added set_current_blocked() that will exclude unblockable signals, switched open-coded instances to it. Signed-off-by: Al Viro <[email protected]>
2012-06-01pull clearing RESTORE_SIGMASK into block_sigmask()Al Viro1-14/+2
Signed-off-by: Al Viro <[email protected]>
2012-06-01new helper: sigmask_to_save()Al Viro1-8/+3
replace boilerplate "should we use ->saved_sigmask or ->blocked?" with calls of obvious inlined helper... Signed-off-by: Al Viro <[email protected]>
2012-06-01new helper: restore_saved_sigmask()Al Viro1-4/+2
first fruits of ..._restore_sigmask() helpers: now we can take boilerplate "signal didn't have a handler, clear RESTORE_SIGMASK and restore the blocked mask from ->saved_mask" into a common helper. Open-coded instances switched... Signed-off-by: Al Viro <[email protected]>
2012-05-31Merge branch 'for-linus' of ↵Linus Torvalds1-4/+1
git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal Pull second pile of signal handling patches from Al Viro: "This one is just task_work_add() series + remaining prereqs for it. There probably will be another pull request from that tree this cycle - at least for helpers, to get them out of the way for per-arch fixes remaining in the tree." Fix trivial conflict in kernel/irq/manage.c: the merge of Andrew's pile had brought in commit 97fd75b7b8e0 ("kernel/irq/manage.c: use the pr_foo() infrastructure to prefix printks") which changed one of the pr_err() calls that this merge moves around. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: keys: kill task_struct->replacement_session_keyring keys: kill the dummy key_replace_session_keyring() keys: change keyctl_session_to_parent() to use task_work_add() genirq: reimplement exit_irq_thread() hook via task_work_add() task_work_add: generic process-context callbacks avr32: missed _TIF_NOTIFY_RESUME on one of do_notify_resume callers parisc: need to check NOTIFY_RESUME when exiting from syscall move key_repace_session_keyring() into tracehook_notify_resume() TIF_NOTIFY_RESUME is defined on all targets now
2012-05-31um: properly check all process' threads for a live mmAnton Vorontsov1-6/+7
kill_off_processes() might miss a valid process, this is because checking for process->mm is not enough. Process' main thread may exit or detach its mm via use_mm(), but other threads may still have a valid mm. To catch this we use find_lock_task_mm(), which walks up all threads and returns an appropriate task (with task lock held). Suggested-by: Oleg Nesterov <[email protected]> Signed-off-by: Anton Vorontsov <[email protected]> Cc: Richard Weinberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31um: fix possible race on task->mmAnton Vorontsov1-2/+5
Checking for task->mm is dangerous as ->mm might disappear (exit_mm() assigns NULL under task_lock(), so tasklist lock is not enough). We can't use get_task_mm()/mmput() pair as mmput() might sleep, so let's take the task lock while we care about its mm. Note that we should also use find_lock_task_mm() to check all process' threads for a valid mm, but for uml we'll do it in a separate patch. Signed-off-by: Anton Vorontsov <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31um: should hold tasklist_lock while traversing processesAnton Vorontsov1-0/+3
Traversing the tasks requires holding tasklist_lock, otherwise it is unsafe. p.s. However, I'm not sure that calling os_kill_ptraced_process() in the atomic context is correct. It seem to work, but please take a closer look. Signed-off-by: Anton Vorontsov <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31um/kernel/trap.c: port OOM changes to handle_page_fault()Kautuk Consul1-5/+19
Commit d065bd810b6d ("mm: retry page fault when blocking on disk transfer") and commit 37b23e0525d3 ("x86,mm: make pagefault killable") introduced changes into the x86 pagefault handler for making the page fault handler retryable as well as killable. These changes reduce the mmap_sem hold time, which is crucial during OOM killer invocation. Port these changes to um. Signed-off-by: Kautuk Consul <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-23move key_repace_session_keyring() into tracehook_notify_resume()Al Viro1-4/+1
Signed-off-by: Al Viro <[email protected]>
2012-05-23Merge branch 'for-linus' of ↵Linus Torvalds1-8/+1
git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal Pull first series of signal handling cleanups from Al Viro: "This is just the first part of the queue (about a half of it); assorted fixes all over the place in signal handling. This one ends with all sigsuspend() implementations switched to generic one (->saved_sigmask-based). With this, a bunch of assorted old buglets are fixed and most of the missing bits of NOTIFY_RESUME hookup are in place. Two more fixes sit in arm and um trees respectively, and there's a couple of broken ones that need obvious fixes - parisc and avr32 check TIF_NOTIFY_RESUME only on one of two codepaths; fixes for that will happen in the next series" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (55 commits) unicore32: if there's no handler we need to restore sigmask, syscall or no syscall xtensa: add handling of TIF_NOTIFY_RESUME microblaze: drop 'oldset' argument of do_notify_resume() microblaze: handle TIF_NOTIFY_RESUME score: add handling of NOTIFY_RESUME to do_notify_resume() m68k: add TIF_NOTIFY_RESUME and handle it. sparc: kill ancient comment in sparc_sigaction() h8300: missing checks of __get_user()/__put_user() return values frv: missing checks of __get_user()/__put_user() return values cris: missing checks of __get_user()/__put_user() return values powerpc: missing checks of __get_user()/__put_user() return values sh: missing checks of __get_user()/__put_user() return values sparc: missing checks of __get_user()/__put_user() return values avr32: struct old_sigaction is never used m32r: struct old_sigaction is never used xtensa: xtensa_sigaction doesn't exist alpha: tidy signal delivery up score: don't open-code force_sigsegv() cris: don't open-code force_sigsegv() blackfin: don't open-code force_sigsegv() ...
2012-05-23Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/umlLinus Torvalds5-14/+22
Pull UML updates from Richard Weinberger: "Most changes are bug fixes and cleanups" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: missing checks of __put_user()/__get_user() return values um: stub_rt_sigsuspend isn't needed these days anymore um/x86: merge (and trim) 32- and 64-bit variants of ptrace.h irq: Remove irq_chip->release() um: Remove CONFIG_IRQ_RELEASE_METHOD um: Remove usage of irq_chip->release() um: Implement um_free_irq() um: Fix __swp_type() um: Implement a custom pte_same() function um: Add BUG() to do_ops()'s error path um: Remove unused variables um: bury unused _TIF_RESTORE_SIGMASK um: wrong sigmask saved in case of multiple sigframes um: add TIF_NOTIFY_RESUME um: ->restart_block.fn needs to be reset on sigreturn
2012-05-21new helper: sigsuspend()Al Viro1-8/+1
guts of saved_sigmask-based sigsuspend/rt_sigsuspend. Takes kernel sigset_t *. Open-coded instances replaced with calling it. Signed-off-by: Al Viro <[email protected]>
2012-05-21Merge branch 'for-um' of ↵Richard Weinberger3-12/+14
git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal into for-3.5
2012-05-21um/x86: merge (and trim) 32- and 64-bit variants of ptrace.hAl Viro2-2/+2
Signed-off-by: Al Viro <[email protected]>
2012-05-21um: Remove usage of irq_chip->release()Richard Weinberger1-2/+0
UML does no longer need irq_chip->release(). Signed-off-by: Richard Weinberger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]>
2012-05-21um: Implement um_free_irq()Richard Weinberger1-0/+7
Instead of using chip->release() we can achieve the same using a simple wrapper for free_irq(). We have already um_request_irq(), so um_free_irq() is the perfect counterpart. Signed-off-by: Richard Weinberger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]>
2012-05-21um: Add BUG() to do_ops()'s error pathRichard Weinberger1-0/+1
In case we encounter a bad operation in do_ops() something is really broken and it's better to BUG(). Signed-off-by: Richard Weinberger <[email protected]>
2012-05-21um: wrong sigmask saved in case of multiple sigframesAl Viro1-6/+5
we can't just find oldmask once; if there are multiple signals and we loop building sigframes for those, ->saved_mask will be definitely wrong for all but the first one. Signed-off-by: Al Viro <[email protected]>
2012-05-21um: add TIF_NOTIFY_RESUMEAl Viro1-1/+7
Signed-off-by: Al Viro <[email protected]>
2012-05-21um: ->restart_block.fn needs to be reset on sigreturnAl Viro1-3/+0
Signed-off-by: Al Viro <[email protected]>
2012-05-05um: Use generic init_taskThomas Gleixner3-39/+6
Same code. Use the generic version. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Richard Weinberger <[email protected]> Link: http://lkml.kernel.org/r/[email protected]
2012-04-26smp: Add task_struct argument to __cpu_up()Thomas Gleixner1-1/+1
Preparatory patch to make the idle thread allocation for secondary cpus generic. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Srivatsa S. Bhat <[email protected]> Cc: Matt Turner <[email protected]> Cc: Russell King <[email protected]> Cc: Mike Frysinger <[email protected]> Cc: Jesper Nilsson <[email protected]> Cc: Richard Kuo <[email protected]> Cc: Tony Luck <[email protected]> Cc: Hirokazu Takata <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: David Howells <[email protected]> Cc: James E.J. Bottomley <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected]
2012-04-10um: uml_setup_stubs': warning: unused variable 'pages'Boaz Harrosh1-1/+0
Fix the following gcc complain arch/um/kernel/skas/mmu.c: In function 'uml_setup_stubs': arch/um/kernel/skas/mmu.c:106:16: warning: unused variable 'pages' [-Wunused-variable] Signed-Signed-off-by: Boaz Harrosh <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-04-10um: Use asm-generic/switch_to.hRichard Weinberger1-5/+1
Signed-off-by: Richard Weinberger <[email protected]>
2012-04-09um: fix linker script generationAl Viro1-3/+4
while we can't just use -U$(SUBARCH), we still need to kill idiotic define (implicit -Di386=1), both for SUBARCH=i386 and SUBARCH=x86/CONFIG_64BIT=n builds. Signed-off-by: Al Viro <[email protected]>
2012-03-29remove references to cpu_*_map in arch/Rusty Russell2-6/+5
This has been obsolescent for a while; time for the final push. In adjacent context, replaced old cpus_* with cpumask_*. Signed-off-by: Rusty Russell <[email protected]> Acked-by: David S. Miller <[email protected]> (arch/sparc) Acked-by: Chris Metcalf <[email protected]> (arch/tile) Cc: [email protected] Cc: Russell King <[email protected]> Cc: [email protected] Cc: Richard Kuo <[email protected]> Cc: [email protected] Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: Kyle McMartin <[email protected]> Cc: Helge Deller <[email protected]> Cc: [email protected]
2012-03-27Merge branch 'for-linus-3.4-rc1' of ↵Linus Torvalds4-5/+5
git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML changes from Richard Weinberger: "Mostly bug fixes and cleanups" * 'for-linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (35 commits) um: Update defconfig um: Switch to large mcmodel on x86_64 MTD: Relax dependencies um: Wire CONFIG_GENERIC_IO up um: Serve io_remap_pfn_range() Introduce CONFIG_GENERIC_IO um: allow SUBARCH=x86 um: most of the SUBARCH uses can be killed um: deadlock in line_write_interrupt() um: don't bother trying to rebuild CHECKFLAGS for USER_OBJS um: use the right ifdef around exports in user_syms.c um: a bunch of headers can be killed by using generic-y um: ptrace-generic.h doesn't need user.h um: kill HOST_TASK_PID um: remove pointless include of asm/fixmap.h from asm/pgtable.h um: asm-offsets.h might as well come from underlying arch... um: merge processor_{32,64}.h a bit... um: switch close_chan() to struct line um: race fix: initialize delayed_work *before* registering IRQ um: line->have_irq is never checked... ...
2012-03-25um: most of the SUBARCH uses can be killedAl Viro1-1/+1
Signed-off-by: Al Viro <[email protected]> [[email protected]: Re-export SUBARCH in arch/um/Makefile] Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: kill HOST_TASK_PIDAl Viro1-2/+2
just provide get_current_pid() to the userland side of things instead of get_current() + manual poking in its results Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-25um: irq: Remove IRQF_DISABLEDYong Zhang2-2/+2
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2012-03-23um: use set_current_blocked() and block_sigmask()Matt Fleming1-14/+6
As described in commit e6fa16ab9c1e ("signal: sigprocmask() should do retarget_shared_pending()") the modification of current->blocked is incorrect as we need to check whether the signal we're about to block is pending in the shared queue. Also, use the new helper function introduced in commit 5e6292c0f28f ("signal: add block_sigmask() for adding sigmask to current->blocked") which centralises the code for updating current->blocked after successfully delivering a signal and reduces the amount of duplicate code across architectures. In the past some architectures got this code wrong, so using this helper function should stop that from happening again. Acked-by: Oleg Nesterov <[email protected]> Cc: Richard Weinberger <[email protected]> Signed-off-by: Matt Fleming <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-23um: don't restore current->blocked on errorMatt Fleming1-6/+2
If we fail to setup the signal stack frame then we don't need to restore current->blocked because it is not modified by setup_signal_stack_*. Acked-by: Oleg Nesterov <[email protected]> Acked-by: Richard Weinberger <[email protected]> Tested-by: Richard Weinberger <[email protected]> Signed-off-by: Matt Fleming <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-21Merge branch 'for-linus' of ↵Linus Torvalds1-19/+6
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile 1 from Al Viro: "This is _not_ all; in particular, Miklos' and Jan's stuff is not there yet." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits) ext4: initialization of ext4_li_mtx needs to be done earlier debugfs-related mode_t whack-a-mole hfsplus: add an ioctl to bless files hfsplus: change finder_info to u32 hfsplus: initialise userflags qnx4: new helper - try_extent() qnx4: get rid of qnx4_bread/qnx4_getblk take removal of PF_FORKNOEXEC to flush_old_exec() trim includes in inode.c um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it um: embed ->stub_pages[] into mmu_context gadgetfs: list_for_each_safe() misuse ocfs2: fix leaks on failure exits in module_init ecryptfs: make register_filesystem() the last potential failure exit ntfs: forgets to unregister sysctls on register_filesystem() failure logfs: missing cleanup on register_filesystem() failure jfs: mising cleanup on register_filesystem() failure make configfs_pin_fs() return root dentry on success configfs: configfs_create_dir() has parent dentry in dentry->d_parent configfs: sanitize configfs_create() ...
2012-03-20um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() ↵Al Viro1-1/+1
doesn't hold it ... while calling uml_dup_mmap() Signed-off-by: Al Viro <[email protected]>
2012-03-20um: embed ->stub_pages[] into mmu_contextAl Viro1-18/+5
seriously, kmalloc() for two-element array of pointers? Signed-off-by: Al Viro <[email protected]>
2012-03-20um: remove the second argument of k[un]map_atomic()Cong Wang1-2/+2
Signed-off-by: Cong Wang <[email protected]>
2012-01-17audit: inline audit_syscall_entry to reduce burden on archsEric Paris1-11/+9
Every arch calls: if (unlikely(current->audit_context)) audit_syscall_entry() which requires knowledge about audit (the existance of audit_context) in the arch code. Just do it all in static inline in audit.h so that arch's can remain blissfully ignorant. Signed-off-by: Eric Paris <[email protected]>