summaryrefslogtreecommitdiffstats
path: root/arch/score/kernel
Commit message (Collapse)AuthorAgeFilesLines
* new helper: signal_delivered()Al Viro2012-06-011-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 <viro@zeniv.linux.org.uk>
* most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from setAl Viro2012-06-011-3/+0Star
| | | | | | | | 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 <viro@zeniv.linux.org.uk>
* pull clearing RESTORE_SIGMASK into block_sigmask()Al Viro2012-06-011-19/+5Star
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: sigmask_to_save()Al Viro2012-06-011-9/+3Star
| | | | | | | replace boilerplate "should we use ->saved_sigmask or ->blocked?" with calls of obvious inlined helper... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: restore_saved_sigmask()Al Viro2012-06-011-4/+1Star
| | | | | | | | | 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 <viro@zeniv.linux.org.uk>
* move key_repace_session_keyring() into tracehook_notify_resume()Al Viro2012-05-241-2/+0Star
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* score: add handling of NOTIFY_RESUME to do_notify_resume()Al Viro2012-05-221-1/+8
| | | | | | | | | It's already called if TIF_NOTIFY_RESUME is set, so we only need to add the actual work. Note that checking for RESTORE_SIGMASK was not needed - set_restore_sigmask() also sets SIGPENDING, so we never RESTORE_SIGMASK without SIGPENDING. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* score: don't open-code force_sigsegv()Al Viro2012-05-221-3/+1Star
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* score: ->restart_block.fn needs to be reset on rt_sigreturnAl Viro2012-05-221-0/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* score: use set_current_blocked() and block_sigmask()Matt Fleming2012-05-221-12/+3Star
| | | | | | | | | | | | | | | | | | | | | As described in e6fa16ab ("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 <oleg@redhat.com> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Lennox Wu <lennox.wu@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* score: don't mask signals if we fail to setup signal stackMatt Fleming2012-05-221-6/+8
| | | | | | | | | | | | If setup_rt_frame() returns -EFAULT then we must not block any signals in the current process. Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Lennox Wu <lennox.wu@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* score: Use generic init_taskThomas Gleixner2012-05-052-47/+1Star
| | | | | | | | | Same code. Use the generic version. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Chen Liqin <liqin.chen@sunplusct.com> Link: http://lkml.kernel.org/r/20120503085035.332320547@linutronix.de
* sched/rt: Use schedule_preempt_disabled()Thomas Gleixner2012-03-011-3/+1Star
| | | | | | | | | Coccinelle based conversion. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-24swm5zut3h9c4a6s46x8rws@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
* score: fix off-by-one index into syscall tableDan Rosenberg2012-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | If the provided system call number is equal to __NR_syscalls, the current check will pass and a function pointer just after the system call table may be called, since sys_call_table is an array with total size __NR_syscalls. Whether or not this is a security bug depends on what the compiler puts immediately after the system call table. It's likely that this won't do anything bad because there is an additional NULL check on the syscall entry, but if there happens to be a non-NULL value immediately after the system call table, this may result in local privilege escalation. Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com> Cc: <stable@vger.kernel.org> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Lennox Wu <lennox.wu@gmail.com> Cc: Eugene Teo <eugeneteo@kernel.sg> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* score: Use HAVE_MEMBLOCK_NODE_MAPTejun Heo2011-12-081-1/+3
| | | | | | | | | | | | score used early_node_map[] just to prime free_area_init_nodes(). Now memblock can be used for the same purpose and early_node_map[] is scheduled to be dropped. Use memblock instead. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Lennox Wu <lennox.wu@gmail.com>
* modules: make arch's use default loader hooksJonas Bonn2011-07-241-26/+3Star
| | | | | | | | | | | | This patch removes all the module loader hook implementations in the architecture specific code where the functionality is the same as that now provided by the recently added default hooks. Signed-off-by: Jonas Bonn <jonas@southpole.se> Acked-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* score: Use generic show_interrupts()Thomas Gleixner2011-03-281-39/+0Star
| | | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Chen Liqin <liqin.chen@sunplusct.com>
* score: Convert to new irq function namesThomas Gleixner2011-03-281-2/+2
| | | | | | | Scripted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Chen Liqin <liqin.chen@sunplusct.com>
* score: Convert irq_chip to new functionsThomas Gleixner2011-03-281-11/+13
| | | | | | | Use the proper accessor functions in show_interrupts() while at it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Chen Liqin <liqin.chen@sunplusct.com>
* ptrace: cleanup arch_ptrace() on scoreNamhyung Kim2010-10-281-2/+2
| | | | | | | | | | Remove unnecessary castings. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Lennox Wu <lennox.wu@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ptrace: change signature of arch_ptrace()Namhyung Kim2010-10-281-1/+2
| | | | | | | | | | | | | | | Fix up the arguments to arch_ptrace() to take account of the fact that @addr and @data are now unsigned long rather than long as of a preceding patch in this series. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: <linux-arch@vger.kernel.org> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Make do_execve() take a const filename pointerDavid Howells2010-08-181-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Make do_execve() take a const filename pointer so that kernel_execve() compiles correctly on ARM: arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type This also requires the argv and envp arguments to be consted twice, once for the pointer array and once for the strings the array points to. This is because do_execve() passes a pointer to the filename (now const) to copy_strings_kernel(). A simpler alternative would be to cast the filename pointer in do_execve() when it's passed to copy_strings_kernel(). do_execve() may not change any of the strings it is passed as part of the argv or envp lists as they are some of them in .rodata, so marking these strings as const should be fine. Further kernel_execve() and sys_execve() need to be changed to match. This has been test built on x86_64, frv, arm and mips. Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* score: fixed pfn_valid define.Chen Liqin2009-12-171-0/+1
| | | | | | | | | Signed-off-by: Cui Bixiong <bixiong@sunnorth.com.cn> Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com> modified: arch/score/include/asm/page.h modified: arch/score/kernel/setup.c modified: arch/score/mm/init.c
* Add missing alignment check in arch/score sys_mmap()Al Viro2009-12-111-3/+4
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Unify sys_mmap*Al Viro2009-12-111-22/+3Star
| | | | | | | New helper - sys_mmap_pgoff(); switch syscalls to using it. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-nextLinus Torvalds2009-09-241-3/+2Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (30 commits) Use macros for .data.page_aligned section. Use macros for .bss.page_aligned section. Use new __init_task_data macro in arch init_task.c files. kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts. arm, cris, mips, sparc, powerpc, um, xtensa: fix build with bash 4.0 kbuild: add static to prototypes kbuild: fail build if recordmcount.pl fails kbuild: set -fconserve-stack option for gcc 4.5 kbuild: echo the record_mcount command gconfig: disable "typeahead find" search in treeviews kbuild: fix cc1 options check to ensure we do not use -fPIC when compiling checkincludes.pl: add option to remove duplicates in place markup_oops: use modinfo to avoid confusion with underscored module names checkincludes.pl: provide usage helper checkincludes.pl: close file as soon as we're done with it ctags: usability fix kernel hacking: move STRIP_ASM_SYMS from General gitignore usr/initramfs_data.cpio.bz2 and usr/initramfs_data.cpio.lzma kbuild: Check if linker supports the -X option kbuild: introduce ld-option ... Fix trivial conflict in scripts/basic/fixdep.c
| * Use new __init_task_data macro in arch init_task.c files.Joe Perches2009-09-211-3/+2Star
| | | | | | | | | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Tim Abbott <tabbott@ksplice.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
* | score: Cleanup linker script using new macros.Tim Abbott2009-09-231-68/+9Star
|/ | | | | | Signed-off-by: Tim Abbott <tabbott@ksplice.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
* score: make init_thread_union align to THREAD_SIZEChen Liqin2009-08-301-1/+1
|
* score: update files according to review comments.Chen Liqin2009-08-301-115/+97Star
|
* score: add old syscall supportChen Liqin2009-08-302-2/+35
|
* score: add MEMORY_START and MEMORY_SIZE define, to make the code clearChen Liqin2009-08-301-15/+17
|
* score: remove unused code, add include files in .cChen Liqin2009-08-301-2/+2
|
* score: make irq.h definitions localArnd Bergmann2009-06-271-10/+23
| | | | | | | | Some internal definitions of the interrupt controller are only needed in irq.c, so move them out of the global irq.h header. Also add proper __iomem annotations for sparse. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: cleanups: dead code, 0 as pointer, shadowed variablesArnd Bergmann2009-06-273-20/+8Star
| | | | | | | | A few smaller issues found by sparse, some code that was never used, two instances of '0' instead of 'NULL' and local variables shadowing another one. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: fix function prototypesArnd Bergmann2009-06-273-12/+17
| | | | | | | Syscalls should return 'long' and be marked as 'asmlinkage'. Functions that are only used in a single file should be 'static'. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: add address space annotationsArnd Bergmann2009-06-273-12/+14
| | | | | | | | Annotate the address space for pointers that are used correctly with __user and __iomem, so that sparse can better warn about incorrect casts. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: add missing #includesArnd Bergmann2009-06-274-1/+9
| | | | | | | | Files that define a global function should #include the header with its declaration to make sure that the prototypes do not diverge. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: move save arg5 and arg6 instruction in front of enable_irqChen Liqin2009-06-221-2/+2
| | | | | | | | | Because enable_irq clobber r8 before arg5 was saved. modified: arch/score/kernel/entry.S Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: remove init_mmArnd Bergmann2009-06-191-2/+0Star
| | | | | | | init_mm is now part of the common code and not provided by the architecture any more. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: add generic sys_call_tableArnd Bergmann2009-06-194-53/+18Star
| | | | | | | | | | | | | | | | | | | This adds back a sys_call_table to the score architecture, which got lost in the conversion to the generic unistd.h file. It's rather worrying that the code got submitted without a system call table, which evidently means that it got zero testing. Since the system call table has a different layout from the old one (which was modeled after the mips-o32 one), I also try to fix the entry.S path to use it. In the modified calling conventions, all system call arguments are passed as registers r4 through r9, instead of r4 through r7 plus stack for the fifth and sixth argument. This matches what other architectures to when they normally pass arguments on the stack. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: update files according to review commentsChen Liqin2009-06-196-117/+50Star
| | | | | | | | | | | | | | | | | | | | modified: arch/score/include/asm/cacheflush.h modified: arch/score/include/asm/delay.h modified: arch/score/include/asm/errno.h modified: arch/score/include/asm/pgtable-bits.h modified: arch/score/include/asm/pgtable.h modified: arch/score/include/asm/ptrace.h modified: arch/score/include/asm/unistd.h modified: arch/score/kernel/entry.S modified: arch/score/kernel/process.c modified: arch/score/kernel/ptrace.c modified: arch/score/kernel/signal.c modified: arch/score/kernel/sys_score.c modified: arch/score/kernel/traps.c modified: arch/score/mm/cache.c Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* score: Add support for Sunplus S+core architectureChen Liqin2009-06-1915-0/+3071
This is the complete set of new arch Score's files for linux. Score instruction set support 16bits, 32bits and 64bits instruction, Score SOC had been used in game machine and LCD TV. Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>