aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc/kernel
AgeCommit message (Collapse)AuthorFilesLines
2013-02-20sparc64: Fix tsb_grow() in atomic context.David S. Miller1-4/+35
If our first THP installation for an MM is via the set_pmd_at() done during khugepaged's collapsing we'll end up in tsb_grow() trying to do a GFP_KERNEL allocation with several locks held. Simply using GFP_ATOMIC in this situation is not the best option because we really can't have this fail, so we'd really like to keep this an order 0 GFP_KERNEL allocation if possible. Also, doing the TSB allocation from khugepaged is a really bad idea because we'll allocate it potentially from the wrong NUMA node in that context. So what we do is defer the hugepage TSB allocation until the first TLB miss we take on a hugepage. This is slightly tricky because we have to handle two unusual cases: 1) Taking the first hugepage TLB miss in the window trap handler. We'll call the winfix_trampoline when that is detected. 2) An initial TSB allocation via TLB miss races with a hugetlb fault on another cpu running the same MM. We handle this by unconditionally loading the TSB we see into the current cpu even if it's non-NULL at hugetlb_setup time. Reported-by: Meelis Roos <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-02-17sparc idle: rename pm_idle to sparc_idleLen Brown4-8/+10
(pm_idle)() is being removed from linux/pm.h because Linux does not have such a cross-architecture concept. sparc uses an idle function pointer in its architecture specific code. So we re-name sparc use of pm_idle to sparc_idle. Signed-off-by: Len Brown <[email protected]> Acked-by: David S. Miller <[email protected]> Acked-by: Sam Ravnborg <[email protected]>
2013-02-14sparc: convert to ksignalAl Viro3-254/+164
Signed-off-by: Al Viro <[email protected]>
2013-02-08OF: convert devtree lock from rw_lock to raw spinlockThomas Gleixner1-2/+2
With the locking cleanup in place (from "OF: Fixup resursive locking code paths"), we can now do the conversion from the rw_lock to a raw spinlock as required for preempt-rt. The previous cleanup and this conversion were originally separate since they predated when mainline got raw spinlock (in commit c2f21ce2e31286a "locking: Implement new raw_spinlock"). So, at that point in time, the cleanup was considered plausible for mainline, but not this conversion. In any case, we've kept them separate as it makes for easier review and better bisection. Signed-off-by: Thomas Gleixner <[email protected]> [PG: taken from preempt-rt, update subject & add a commit log] Signed-off-by: Paul Gortmaker <[email protected]> Signed-off-by: Rob Herring <[email protected]>
2013-02-06sparc: explicitly include sched.h to get task_thread_info declarationStephen Rothwell1-0/+1
This was caused by commit 16559ae48c76 ("kgdb: remove #include <linux/serial_8250.h> from kgdb.h") from the tty tree. Signed-off-by: Stephen Rothwell <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-03sparc: switch to generic old sigsuspendAl Viro3-15/+0
Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: COMPAT_SYSCALL_DEFINE does all sign-extension as well as SYSCALL_DEFINEAl Viro2-18/+8
Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: kill sign-extending wrappers for native syscallsAl Viro3-150/+40
SYSCALL_DEFINE-added wrapper will take care of those just fine; no extra compat wrappers needed. Signed-off-by: Al Viro <[email protected]>
2013-02-03kill sparc32_open()Al Viro2-11/+1
it's a copy of compat_sys_open() Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: switch to use of generic old sigactionAl Viro4-68/+10
note that due to historical accident we do *not* directly take generic versions - need to check and invert the sign of signal number first. Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: switch sys_compat_rt_sigaction() to COMPAT_SYSCALL_DEFINEAl Viro1-17/+7
note that while struct compat_sigaction is the generic one, syscall itself *isn't* - different arguments. IOW, CONFIG_ODD_RT_SIGACTION stays. Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: switch to generic compat rt_sigqueueinfo()Al Viro1-16/+0
Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: switch to generic compat rt_sigpending()Al Viro2-25/+1
Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: switch to generic compat rt_sigprocmask(2)Al Viro1-40/+0
Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: bury the sys_sigpause() remainsAl Viro3-18/+2
Signed-off-by: Al Viro <[email protected]>
2013-02-03sparc: switch to generic sigaltstackAl Viro6-78/+10
Signed-off-by: Al Viro <[email protected]>
2013-02-03consolidate kernel-side struct sigaction declarationsAl Viro1-1/+1
Signed-off-by: Al Viro <[email protected]>
2013-02-03sanitize rt_sigaction() situation a bitAl Viro1-6/+5
Switch from __ARCH_WANT_SYS_RT_SIGACTION to opposite (!CONFIG_ODD_RT_SIGACTION); the only two architectures that need it are alpha and sparc. The reason for use of CONFIG_... instead of __ARCH_... is that it's needed only kernel-side and doing it that way avoids a mess with include order on many architectures. Signed-off-by: Al Viro <[email protected]>
2013-01-21sparc: kernel/sbus.c: fix memory leakageCong Ding1-3/+3
The variable iommu and strbuf are not freed properly if it goes to error. Signed-off-by: Cong Ding <[email protected]> Reviewed-by: Richard Mortimer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-01-21taint: add explicit flag to show whether lock dep is still OK.Rusty Russell3-3/+3
Fix up all callers as they were before, with make one change: an unsigned module taints the kernel, but doesn't turn off lockdep. Signed-off-by: Rusty Russell <[email protected]>
2013-01-12sparc: remove __devinit, __devexit annotationsSam Ravnborg20-93/+86
__devinit, __devexit annotations are nops - so drop them. Likewise for __devexit_p. Adjusted alignment of arguments when needed. Signed-off-by: Sam Ravnborg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-12-28sparc: Hook up finit_module syscall.David S. Miller2-3/+3
Signed-off-by: David S. Miller <[email protected]>
2012-12-19Merge tag 'modules-next-for-linus' of ↵Linus Torvalds1-4/+0
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux Pull module update from Rusty Russell: "Nothing all that exciting; a new module-from-fd syscall for those who want to verify the source of the module (ChromeOS) and/or use standard IMA on it or other security hooks." * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: MODSIGN: Fix kbuild output when using default extra_certificates MODSIGN: Avoid using .incbin in C source modules: don't hand 0 to vmalloc. module: Remove a extra null character at the top of module->strtab. ASN.1: Use the ASN1_LONG_TAG and ASN1_INDEFINITE_LENGTH constants ASN.1: Define indefinite length marker constant moduleparam: use __UNIQUE_ID() __UNIQUE_ID() MODSIGN: Add modules_sign make target powerpc: add finit_module syscall. ima: support new kernel module syscall add finit_module syscall to asm-generic ARM: add finit_module syscall to ARM security: introduce kernel_module_from_file hook module: add flags arg to sys_finit_module() module: add syscall to load module from fd
2012-12-17compat: generic compat_sys_sched_rr_get_interval() implementationCatalin Marinas1-14/+0
This function is used by sparc, powerpc tile and arm64 for compat support. The patch adds a generic implementation with a wrapper for PowerPC to do the u32->int sign extension. The reason for a single patch covering powerpc, tile, sparc and arm64 is to keep it bisectable, otherwise kernel building may fail with mismatched function declarations. Signed-off-by: Catalin Marinas <[email protected]> Acked-by: Chris Metcalf <[email protected]> [for tile] Acked-by: David S. Miller <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Alexander Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-12-14modules: don't hand 0 to vmalloc.Rusty Russell1-4/+0
In commit d0a21265dfb5fa8a David Rientjes unified various archs' module_alloc implementation (including x86) and removed the graduitous shortcut for size == 0. Then, in commit de7d2b567d040e3b, Joe Perches added a warning for zero-length vmallocs, which can happen without kallsyms on modules with no init sections (eg. zlib_deflate). Fix this once and for all; the module code has to handle zero length anyway, so get it right at the caller and remove the now-gratuitous checks within the arch-specific module_alloc implementations. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42608 Reported-by: Conrad Kostecki <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2012-12-12Merge branch 'for-linus' of ↵Linus Torvalds10-358/+125
git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal Pull big execve/kernel_thread/fork unification series from Al Viro: "All architectures are converted to new model. Quite a bit of that stuff is actually shared with architecture trees; in such cases it's literally shared branch pulled by both, not a cherry-pick. A lot of ugliness and black magic is gone (-3KLoC total in this one): - kernel_thread()/kernel_execve()/sys_execve() redesign. We don't do syscalls from kernel anymore for either kernel_thread() or kernel_execve(): kernel_thread() is essentially clone(2) with callback run before we return to userland, the callbacks either never return or do successful do_execve() before returning. kernel_execve() is a wrapper for do_execve() - it doesn't need to do transition to user mode anymore. As a result kernel_thread() and kernel_execve() are arch-independent now - they live in kernel/fork.c and fs/exec.c resp. sys_execve() is also in fs/exec.c and it's completely architecture-independent. - daemonize() is gone, along with its parts in fs/*.c - struct pt_regs * is no longer passed to do_fork/copy_process/ copy_thread/do_execve/search_binary_handler/->load_binary/do_coredump. - sys_fork()/sys_vfork()/sys_clone() unified; some architectures still need wrappers (ones with callee-saved registers not saved in pt_regs on syscall entry), but the main part of those suckers is in kernel/fork.c now." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (113 commits) do_coredump(): get rid of pt_regs argument print_fatal_signal(): get rid of pt_regs argument ptrace_signal(): get rid of unused arguments get rid of ptrace_signal_deliver() arguments new helper: signal_pt_regs() unify default ptrace_signal_deliver flagday: kill pt_regs argument of do_fork() death to idle_regs() don't pass regs to copy_process() flagday: don't pass regs to copy_thread() bfin: switch to generic vfork, get rid of pointless wrappers xtensa: switch to generic clone() openrisc: switch to use of generic fork and clone unicore32: switch to generic clone(2) score: switch to generic fork/vfork/clone c6x: sanitize copy_thread(), get rid of clone(2) wrapper, switch to generic clone() take sys_fork/sys_vfork/sys_clone prototypes to linux/syscalls.h mn10300: switch to generic fork/vfork/clone h8300: switch to generic fork/vfork/clone tile: switch to generic clone() ... Conflicts: arch/microblaze/include/asm/Kbuild
2012-12-11arch/sparc/kernel/sys_sparc_64.c: s/COLOUR/COLOR/Andrew Morton1-3/+3
Consistently spell this word across arch/sparc/mm and arch/sparc/kernel. Acked-by: David Miller <[email protected]> Cc: Michel Lespinasse <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-12-11mm: use vm_unmapped_area() on sparc64 architectureMichel Lespinasse1-114/+30
Update the sparc64 arch_get_unmapped_area[_topdown] functions to make use of vm_unmapped_area() instead of implementing a brute force search. [[email protected]: remove now-unused COLOUR_ALIGN_DOWN()] Signed-off-by: Michel Lespinasse <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Russell King <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Paul Mundt <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-12-11mm: use vm_unmapped_area() on sparc32 architectureMichel Lespinasse1-18/+9
Update the sparc32 arch_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. [[email protected]: fix build] [[email protected]: remove now-unused COLOUR_ALIGN()] Signed-off-by: Michel Lespinasse <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Russell King <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Paul Mundt <[email protected]> Acked-by: "David S. Miller" <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-12-11Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds1-1/+1
Pull device tree changes from Grant Likely: "Here are the DT changes I've got queued up for v3.8. As described below, there are a lot of bug fixes here and documentation updates but nothing major: Bug fixes, little cleanups, and documentation changes. The most invasive thing here touches a bunch of the arch directories to use a common build rule for .dtb files. There are no major changes to functionality here other than a few new helper functions." * tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6: (34 commits) arm64: Fix the dtbs target building mtd: nand: davinci: fix the binding documentation rtc: rtc-mv: Add the device tree binding documentation devicetree/bindings: Move gpio-leds binding into leds directory of/vendor-prefixes: add Imagination Technologies microblaze: use new common dtc rule c6x: use new common dtc rule openrisc: use new common dtc rule arm64: Add dtbs target for building all the enabled dtb files arm64: use new common dtc rule ARM: dt: change .dtb build rules to build in dts directory kbuild: centralize .dts->.dtb rule Fix build when CONFIG_W1_MASTER_GPIO=m b exporting "allnodes" of/spi: Honour "status=disabled" property of device of_mdio: Honour "status=disabled" property of device of_i2c: Honour "status=disabled" property of device powerpc: Fix fallout from device_node->name constification of: add 'const' for of_parse_phandle parameter *np Documentation: correct of_platform_populate() argument list script: dtc: clean generated files ...
2012-12-03sparc64: exit_group should kill register windows just like plain exit.David S. Miller3-4/+14
Reported-by: Al Viro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-29flagday: kill pt_regs argument of do_fork()Al Viro2-4/+2
Signed-off-by: Al Viro <[email protected]>
2012-11-28flagday: don't pass regs to copy_thread()Al Viro2-5/+4
Signed-off-by: Al Viro <[email protected]>
2012-11-28Merge branches 'no-rebases', 'arch-avr32', 'arch-blackfin', 'arch-cris', ↵Al Viro10-351/+121
'arch-h8300', 'arch-m32r', 'arch-mn10300', 'arch-score', 'arch-sh' and 'arch-powerpc' into for-next
2012-11-18sparc64: not any error from do_sigaltstack() should fail rt_sigreturn()Al Viro1-3/+1
If a signal handler is executed on altstack and another signal comes, we will end up with rt_sigreturn() on return from the second handler getting -EPERM from do_sigaltstack(). It's perfectly OK, since we are not asking to change the settings; in fact, they couldn't have been changed during the second handler execution exactly because we'd been on altstack all along. 64bit sigreturn on sparc treats any error from do_sigaltstack() as "SIGSEGV now"; we need to switch to the same semantics we are using on other architectures. Cc: [email protected] Signed-off-by: Al Viro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-17drivers/of: Constify device_node->name and ->path_component_nameGrant Likely1-1/+1
Neither of these should ever be changed once set. Make them const and fix up the users that try to modify it in-place. In one case kmalloc+memcpy is replaced with kstrdup() to avoid modifying the string. Build tested with defconfigs on ARM, PowerPC, Sparc, MIPS, x86 among others. Signed-off-by: Grant Likely <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Julian Calaby <[email protected]>
2012-11-16Merge branch 'arch-microblaze' into no-rebasesAl Viro6-4/+40
2012-11-16Merge commit '517ffce4e1a03aea979fe3a18a3dd1761a24fafb' into arch-sparcAl Viro9-75/+207
Backmerge from the point in mainline where a trivial conflict had been introduced (arch/sparc/kernel/sys_sparc_64.c had grown sys_kern_features() right after where kernel_execve() used to be) Signed-off-by: Al Viro <[email protected]>
2012-11-09sparc32, leon: Check for existent irq_map entry in leon_handle_ext_irqAndreas Larsson1-2/+4
If an irq is being unlinked concurrently with leon_handle_ext_irq, irq_map[eirq] might be null in leon_handle_ext_irq. Make sure that this is not dereferenced. Signed-off-by: Andreas Larsson <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-10-28sparc: Wire up sys_kcmp.David S. Miller2-2/+3
Signed-off-by: David S. Miller <[email protected]>
2012-10-28sparc64: Improvde documentation and readability of atomic backoff code.David S. Miller3-8/+8
Document what's going on in asm/backoff.h with a large and descriptive comment. Refer to it above the cpu_relax() definition in asm/processor_64.h Rename the pause patching section to have "3insn" in it's name like the other patching sections do. Based upon feedback from Sam Ravnborg. Signed-off-by: David S. Miller <[email protected]>
2012-10-27sparc64: Use pause instruction when available.David S. Miller3-0/+33
In atomic backoff and cpu_relax(), use the pause instruction found on SPARC-T4 and later. It makes the cpu strand unselectable for the given number of cycles, unless an intervening disrupting trap occurs. Signed-off-by: David S. Miller <[email protected]>
2012-10-26sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads.David S. Miller8-49/+87
The Montgomery Multiply, Montgomery Square, and Multiple-Precision Multiply instructions work by loading a combination of the floating point and multiple register windows worth of integer registers with the inputs. These values are 64-bit. But for 32-bit userland processes we only save the low 32-bits of each integer register during a register spill. This is because the register window save area is in the user stack and has a fixed layout. Therefore, the only way to use these instruction in 32-bit mode is to perform the following sequence: 1) Load the top-32bits of a choosen integer register with a sentinel, say "-1". This will be in the outer-most register window. The idea is that we're trying to see if the outer-most register window gets spilled, and thus the 64-bit values were truncated. 2) Load all the inputs for the montmul/montsqr/mpmul instruction, down to the inner-most register window. 3) Execute the opcode. 4) Traverse back up to the outer-most register window. 5) Check the sentinel, if it's still "-1" store the results. Otherwise retry the entire sequence. This retry is extremely troublesome. If you're just unlucky and an interrupt or other trap happens, it'll push that outer-most window to the stack and clear the sentinel when we restore it. We could retry forever and never make forward progress if interrupts arrive at a fast enough rate (consider perf events as one example). So we have do limited retries and fallback to software which is extremely non-deterministic. Luckily it's very straightforward to provide a mechanism to let 32-bit applications use a 64-bit stack. Stacks in 64-bit mode are biased by 2047 bytes, which means that the lowest bit is set in the actual %sp register value. So if we see bit zero set in a 32-bit application's stack we treat it like a 64-bit stack. Runtime detection of such a facility is tricky, and cumbersome at best. For example, just trying to use a biased stack and seeing if it works is hard to recover from (the signal handler will need to use an alt stack, plus something along the lines of longjmp). Therefore, we add a system call to report a bitmask of arch specific features like this in a cheap and less hairy way. With help from Andy Polyakov. Signed-off-by: David S. Miller <[email protected]>
2012-10-16sparc32: switch to generic sys_execve()Al Viro2-44/+3
Signed-off-by: Al Viro <[email protected]>
2012-10-16sparc32: switch to generic kernel_execve()Al Viro2-26/+9
Signed-off-by: Al Viro <[email protected]>
2012-10-16sparc32: switch to generic kernel_thread()Al Viro2-79/+55
Signed-off-by: Al Viro <[email protected]>
2012-10-16sparc32: bury the remnants of LOWSYS tricksAl Viro1-13/+2
Time to end that depravity, let's bury the body. It's been 15 years, for crying out loud... Signed-off-by: Al Viro <[email protected]>
2012-10-16sparc64: convert to generic execveAl Viro4-71/+9
We still have wrappers, but nowhere near as scary as they used to be. I'm not sure how necessary that flushw is now, TBH... Signed-off-by: Al Viro <[email protected]>
2012-10-16sparc64: Fix bit twiddling in sparc_pmu_enable_event().David S. Miller1-2/+4
There was a serious disconnect in the logic happening in sparc_pmu_disable_event() vs. sparc_pmu_enable_event(). Event disable is implemented by programming a NOP event into the PCR. However, event enable was not reversing this operation. Instead, it was setting the User/Priv/Hypervisor trace enable bits. That's not sparc_pmu_enable_event()'s job, that's what sparc_pmu_enable() and sparc_pmu_disable() do . The intent of sparc_pmu_enable_event() is clear, since it first clear out the event type encoding field. So fix this by OR'ing in the event encoding rather than the trace enable bits. Signed-off-by: David S. Miller <[email protected]>
2012-10-16sparc64: Add global PMU register dumping via sysrq.David S. Miller2-20/+111
Signed-off-by: David S. Miller <[email protected]>