aboutsummaryrefslogtreecommitdiffstats
path: root/arch/openrisc
Commit message (Collapse)AuthorAgeFilesLines
* vm: add VM_FAULT_SIGSEGV handling supportLinus Torvalds2015-02-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 33692f27597fcab536d7cbbcc8f52905133e4aa7 upstream. The core VM already knows about VM_FAULT_SIGBUS, but cannot return a "you should SIGSEGV" error, because the SIGSEGV case was generally handled by the caller - usually the architecture fault handler. That results in lots of duplication - all the architecture fault handlers end up doing very similar "look up vma, check permissions, do retries etc" - but it generally works. However, there are cases where the VM actually wants to SIGSEGV, and applications _expect_ SIGSEGV. In particular, when accessing the stack guard page, libsigsegv expects a SIGSEGV. And it usually got one, because the stack growth is handled by that duplicated architecture fault handler. However, when the generic VM layer started propagating the error return from the stack expansion in commit fee7e49d4514 ("mm: propagate error from stack expansion even for guard page"), that now exposed the existing VM_FAULT_SIGBUS result to user space. And user space really expected SIGSEGV, not SIGBUS. To fix that case, we need to add a VM_FAULT_SIGSEGV, and teach all those duplicate architecture fault handlers about it. They all already have the code to handle SIGSEGV, so it's about just tying that new return value to the existing code, but it's all a bit annoying. This is the mindless minimal patch to do this. A more extensive patch would be to try to gather up the mostly shared fault handling logic into one generic helper routine, and long-term we really should do that cleanup. Just from this patch, you can generally see that most architectures just copied (directly or indirectly) the old x86 way of doing things, but in the meantime that original x86 model has been improved to hold the VM semaphore for shorter times etc and to handle VM_FAULT_RETRY and other "newer" things, so it would be a good idea to bring all those improvements to the generic case and teach other architectures about them too. Reported-and-tested-by: Takashi Iwai <tiwai@suse.de> Tested-by: Jan Engelhardt <jengelh@inai.de> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> # "s390 still compiles and boots" Cc: linux-arch@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [bwh: Backported to 3.2: - Adjust filenames, context - Drop arc, metag, nios2 and lustre changes - For sh, patch both 32-bit and 64-bit implementations to use goto bad_area - For s390, pass int_code and trans_exc_code as arguments to do_no_context() and do_sigsegv()] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* openrisc: include export.h for EXPORT_SYMBOLJonas Bonn2014-09-132-0/+2
| | | | | | | | | commit abdf8b5e07884a183938969253770164d60b87cb upstream. Use of EXPORT_SYMBOL requires inclusion of export.h Signed-off-by: Jonas Bonn <jonas@southpole.se> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* openrisc: add missing header inclusionStefan Kristiansson2014-09-131-0/+1
| | | | | | | | | | | | commit 160d83781a32e94a1e337efd6722939001e62398 upstream. Prevents build issue with updated toolchain Reported-by: Jack Thomasson <jkt@moonlitsw.com> Tested-by: Christian Svensson <blue@cmd.nu> Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Signed-off-by: Jonas Bonn <jonas@southpole.se> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Merge branch 'trivial' of ↵Linus Torvalds2011-11-061-12/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild * 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: scsi: drop unused Kconfig symbol pci: drop unused Kconfig symbol stmmac: drop unused Kconfig symbol x86: drop unused Kconfig symbol powerpc: drop unused Kconfig symbols powerpc: 40x: drop unused Kconfig symbol mips: drop unused Kconfig symbols openrisc: drop unused Kconfig symbols arm: at91: drop unused Kconfig symbol samples: drop unused Kconfig symbol m32r: drop unused Kconfig symbol score: drop unused Kconfig symbols sh: drop unused Kconfig symbol um: drop unused Kconfig symbol sparc: drop unused Kconfig symbol alpha: drop unused Kconfig symbol Fix up trivial conflict in drivers/net/ethernet/stmicro/stmmac/Kconfig as per Michal: the STMMAC_DUAL_MAC config variable is still unused and should be deleted.
| * openrisc: drop unused Kconfig symbolsPaul Bolle2011-10-311-12/+0
| | | | | | | | | | Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Michal Marek <mmarek@suse.cz>
* | doc: fix broken referencesPaul Bolle2011-09-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | There are numerous broken references to Documentation files (in other Documentation files, in comments, etc.). These broken references are caused by typo's in the references, and by renames or removals of the Documentation files. Some broken references are simply odd. Fix these broken references, sometimes by dropping the irrelevant text they were part of. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | Add missing DMA opsJonas Bonn2011-09-112-3/+84
| | | | | | | | | | | | | | | | | | | | | | For the initial architecture submission, not all of the DMA ops were implemented. This patch adds the *map_page and *map_sg variants of the DMA mapping ops. This patch is currently of interest mainly to some drivers that haven't been submitted upstream yet. Signed-off-by: Jonas Bonn <jonas@southpole.se>
* | openrisc: don't use pt_regs in struct sigcontextJonas Bonn2011-09-052-24/+12
|/ | | | | | | | | | | | | | | | | As it was decided not to export struct pt_regs to userspace, struct sigcontext shouldn't be using it either. The pt_regs struct for OpenRISC is kernel internal and the layout of the registers may change in the future. The struct user_regs_struct is what is guaranteed to remain stable, so struct sigcontext may use that instead. This patch removes the usage of struct pt_regs in struct sigcontext and makes according changes in signal.c to get the register layout right. The usp field is removed from the sigcontext structure as this information is already contained in the user_regs_struct. Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Emilio Cota <cota@braap.org>
* OpenRISC: MiscellaneousJonas Bonn2011-07-224-0/+231
| | | | | | | | Adds README file, TODO list, and a couple of other pieces that didn't seem to fit into any other patch. Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Library routinesJonas Bonn2011-07-222-0/+264
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: HeadersJonas Bonn2011-07-2222-0/+1404
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: TrapsJonas Bonn2011-07-221-0/+366
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Module supportJonas Bonn2011-07-221-0/+72
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: GPIOJonas Bonn2011-07-221-0/+65
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Scheduling/Process managementJonas Bonn2011-07-222-0/+445
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Idle/Power managementJonas Bonn2011-07-221-0/+77
| | | | | | | Minimal functionality... Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: System callsJonas Bonn2011-07-225-0/+220
| | | | | | | | | | | | | | The OpenRISC Linux kernel conforms to the "generic" syscall interface which contains only the reduced set of syscalls deemed necessary for new architectures. Unfortunately, the uClibc port for OpenRISC does not fully support this reduced set; as such, an additional patch available out-of-tree needs to be applied to the kernel in order to use the current uClibc. This is just a temporary measure until the libc port can be straightened out; it is likely that OpenRISC will make the transition to glibc shortly where the generic syscall interface is better supported. Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: IRQJonas Bonn2011-07-223-0/+228
| | | | | | | | This patch adds support for the OpenRISC PIC. Signed-off-by: Jonas Bonn <jonas@southpole.se> Cc: tglx@linutronix.de Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: TimekeepingJonas Bonn2011-07-222-0/+217
| | | | | | | | | | Implements support for the OpenRISC timer which is a 28 bit cycle counter that can be read out of a special purpose register. This counter is used as a both a clock event and clocksource device. Signed-off-by: Jonas Bonn <jonas@southpole.se> Cc: tglx@linutronix.de Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: DMAJonas Bonn2011-07-222-0/+325
| | | | | | | | Simple DMA implementation. Allows for allocation of coherent memory (simply uncached) for DMA operations. Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: PTraceJonas Bonn2011-07-222-0/+342
| | | | | | | | | | | | | This patch implements minimal PTrace support. The pt_regs structure is not exported to userspace for OpenRISC; rather, the GETREGSET mechanism is intended to be used and the registers, as such, exported in the core dump format which is ABI stable. This is in line with what is intended for new architectures as of 2.6.34 and has the advantage of permitting the layout of the registers on the kernel stack (as per pt_regs) to be freely modified. Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Build infrastructureJonas Bonn2011-07-229-0/+545
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Signal handlingJonas Bonn2011-07-222-0/+434
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Memory managementJonas Bonn2011-07-2215-0/+2279
| | | | | Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Device treeJonas Bonn2011-07-223-0/+235
| | | | | | | | | | | | | | | The OpenRISC architecture uses the device tree infrastructure for the platform description. This is currently limited to having a device tree built into the kernel, but work is underway within the OpenRISC project to define how this device tree blob should be passed into the kernel from an external resource. Patch contains a single example DTS file to go with the defconfig for or1ksim. Signed-off-by: Jonas Bonn <jonas@southpole.se> Cc: devicetree-discuss@lists.ozlabs.org Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* OpenRISC: Boot codeJonas Bonn2011-07-224-0/+3157
Architecture code and early setup routines for booting Linux. Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>