aboutsummaryrefslogtreecommitdiff
path: root/arch/arc/kernel
AgeCommit message (Collapse)AuthorFilesLines
2015-06-19ARC: entry.S: FAKE_RET_FROM_EXCPN can always use r9Vineet Gupta1-13/+11
Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: entry.S: confine EXCEPTION_* macros to one fileVineet Gupta1-0/+16
Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: entry.S: canonical'ize EXCEPTION_{PROLOGUE,EPILOGUE}Vineet Gupta1-2/+2
-EXCEPTION_EPILOGUE introduced -EXCEPTION_PROLOGUE now also includes reg file saving Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: entry.S: Introduce INTERRUPT_{PROLOGUE,EPILOGUE}Vineet Gupta1-18/+4
-common'ize macros for level 1 and level 2 interrupts Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: entry.S: common'ize scrtach reg freeup in intr + exceptionsVineet Gupta1-8/+2
Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: [axs101] support early 8250 uartVineet Gupta1-0/+2
Earlycon calculates UART clock as "BASE_BAUD * 16". In case of ARC "BASE_BAUD" is calculated dynamically in runtime, basically it is an alias to arc_early_base_baud(), which in turn just does "arc_base_baud/16". 8250 UART on AXS/SDP board uses 33.3MHz clock source which is set in "arc_base_baud" with this change. Additional compatibility string "snps,arc-sdp" is introduced as well because there're different flavours of AXS boards but they all share the same motherboard and so it's possible to re-use the same code for motherbord even if CPU daughterboard changes. Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: stack unwinder to bail if PC is not kernel modeVineet Gupta1-10/+8
Currently, it doesn't invoke the callback but continues to unwind Also while at it - simplify the code a bit Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: perf: Remove unnecessary local variableTobias Klauser1-4/+2
Directly return the result of perf_pmu_register() in arc_pmu_device_probe() instead of assigning and returning variable ret. Signed-off-by: Tobias Klauser <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19arc: fix use of uninitialized arc_pmuMax Filippov1-1/+0
static arc_pmu in the arch/arc/kernel/perf_event.c is not initialized as it's shadowed by a local variable of the same name in the arc_pmu_device_probe. Signed-off-by: Max Filippov <[email protected]> Fixes: 03c94fcf954d "ARC: perf: make @arc_pmu static global" CC: <[email protected]> # 4.1 Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: fix section mismatch with allyesconfigVineet Gupta1-1/+1
Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: explicit'ify uboot supportVineet Gupta2-1/+6
Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: clocksource cleanupsVineet Gupta1-10/+2
Signed-off-by: Vineet Gupta <[email protected]>
2015-06-19ARC: RIP broken 64bit RTSCVineet Gupta2-54/+3
Signed-off-by: Vineet Gupta <[email protected]>
2015-04-24Merge tag 'arc-4.1-rc1' of ↵Linus Torvalds4-22/+69
git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC updates from Vineet Gupta: - perf fixes/improvements - misc cleanups * tag 'arc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: perf: don't add code for impossible case ARC: perf: Rename DT binding to not confuse with power mgmt ARC: perf: add user space attribution in callchains ARC: perf: Add kernel callchain support ARC: perf: support cache hit/miss ratio ARC: perf: Add some comments/debug stuff ARC: perf: make @arc_pmu static global ARC: mem init spring cleaning - No functional changes ARC: Fix RTT boot printing ARC: fold __builtin_constant_p() into test_bit() ARC: rename unhandled exception handler ARC: cosmetic: Remove unused ECR bitfield masks ARC: Fix WRITE_BCR ARC: [nsimosci] Update defconfig arc: copy_thread(): rename 'arg' argument to 'kthread_arg'
2015-04-20ARC: perf: don't add code for impossible caseVineet Gupta1-4/+1
Signed-off-by: Vineet Gupta <[email protected]>
2015-04-20ARC: perf: Rename DT binding to not confuse with power mgmtVineet Gupta1-2/+2
Signed-off-by: Vineet Gupta <[email protected]>
2015-04-20ARC: perf: add user space attribution in callchainsVineet Gupta1-0/+10
The actual user space unwinding is more involved, so simply capture the user space PC Signed-off-by: Vineet Gupta <[email protected]>
2015-04-20ARC: perf: Add kernel callchain supportVineet Gupta1-0/+29
Signed-off-by: Mischa Jonker <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-04-20ARC: perf: Add some comments/debug stuffVineet Gupta1-5/+13
Signed-off-by: Vineet Gupta <[email protected]>
2015-04-20ARC: perf: make @arc_pmu static globalVineet Gupta1-5/+2
Signed-off-by: Vineet Gupta <[email protected]>
2015-04-17arc: do not export symbols in troubleshoot.cDavidlohr Bueso1-2/+1
print_task_path_n_nm() is local to this file, its only user being show_regs(). Mark the function static and avoid the EXPORT_SYMBOL. Signed-off-by: Davidlohr Bueso <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2015-04-15Merge branch 'exec_domain_rip_v2' of ↵Linus Torvalds1-13/+1
git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc Pull exec domain removal from Richard Weinberger: "This series removes execution domain support from Linux. The idea behind exec domains was to support different ABIs. The feature was never complete nor stable. Let's rip it out and make the kernel signal handling code less complicated" * 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc: (27 commits) arm64: Removed unused variable sparc: Fix execution domain removal Remove rest of exec domains. arch: Remove exec_domain from remaining archs arc: Remove signal translation and exec_domain xtensa: Remove signal translation and exec_domain xtensa: Autogenerate offsets in struct thread_info x86: Remove signal translation and exec_domain unicore32: Remove signal translation and exec_domain um: Remove signal translation and exec_domain tile: Remove signal translation and exec_domain sparc: Remove signal translation and exec_domain sh: Remove signal translation and exec_domain s390: Remove signal translation and exec_domain mn10300: Remove signal translation and exec_domain microblaze: Remove signal translation and exec_domain m68k: Remove signal translation and exec_domain m32r: Remove signal translation and exec_domain m32r: Autogenerate offsets in struct thread_info frv: Remove signal translation and exec_domain ...
2015-04-14Merge branch 'for-linus-1' of ↵Linus Torvalds1-2/+0
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs update from Al Viro: "Part one: - struct filename-related cleanups - saner iov_iter_init() replacements (and switching the syscalls to use of those) - ntfs switch to ->write_iter() (Anton) - aio cleanups and splitting iocb into common and async parts (Christoph) - assorted fixes (me, bfields, Andrew Elble) There's a lot more, including the completion of switchover to ->{read,write}_iter(), d_inode/d_backing_inode annotations, f_flags race fixes, etc, but that goes after #for-davem merge. David has pulled it, and once it's in I'll send the next vfs pull request" * 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (35 commits) sg_start_req(): use import_iovec() sg_start_req(): make sure that there's not too many elements in iovec blk_rq_map_user(): use import_single_range() sg_io(): use import_iovec() process_vm_access: switch to {compat_,}import_iovec() switch keyctl_instantiate_key_common() to iov_iter switch {compat_,}do_readv_writev() to {compat_,}import_iovec() aio_setup_vectored_rw(): switch to {compat_,}import_iovec() vmsplice_to_user(): switch to import_iovec() kill aio_setup_single_vector() aio: simplify arguments of aio_setup_..._rw() aio: lift iov_iter_init() into aio_setup_..._rw() lift iov_iter into {compat_,}do_readv_writev() NFS: fix BUG() crash in notify_change() with patch to chown_common() dcache: return -ESTALE not -EBUSY on distributed fs race NTFS: Version 2.1.32 - Update file write from aio_write to write_iter. VFS: Add iov_iter_fault_in_multipages_readable() drop bogus check in file_open_root() switch security_inode_getattr() to struct path * constify tomoyo_realpath_from_path() ...
2015-04-14Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree from Jiri Kosina: "Usual trivial tree updates. Nothing outstanding -- mostly printk() and comment fixes and unused identifier removals" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: goldfish: goldfish_tty_probe() is not using 'i' any more powerpc: Fix comment in smu.h qla2xxx: Fix printks in ql_log message lib: correct link to the original source for div64_u64 si2168, tda10071, m88ds3103: Fix firmware wording usb: storage: Fix printk in isd200_log_config() qla2xxx: Fix printk in qla25xx_setup_mode init/main: fix reset_device comment ipwireless: missing assignment goldfish: remove unreachable line of code coredump: Fix do_coredump() comment stacktrace.h: remove duplicate declaration task_struct smpboot.h: Remove unused function prototype treewide: Fix typo in printk messages treewide: Fix typo in printk messages mod_devicetable: fix comment for match_flags
2015-04-13ARC: Fix RTT boot printingVineet Gupta1-1/+4
Signed-off-by: Vineet Gupta <[email protected]>
2015-04-13ARC: rename unhandled exception handlerVineet Gupta1-2/+2
Signed-off-by: Vineet Gupta <[email protected]>
2015-04-12arc: Remove signal translation and exec_domainRichard Weinberger1-13/+1
As execution domain support is gone we can remove signal translation from the signal code and remove exec_domain from thread_info. Signed-off-by: Richard Weinberger <[email protected]>
2015-04-11whack-a-mole: no need to set_fs(USER_DS) in {start,flush}_thread()Al Viro1-2/+0
flush_old_exec() has already done that. Back on 2011 a bunch of instances like that had been kicked out, but that hadn't taken care of then-out-of-tree architectures, obviously, and they served as reinfection vector... Signed-off-by: Al Viro <[email protected]>
2015-03-31arc: copy_thread(): rename 'arg' argument to 'kthread_arg'Alex Dowad1-3/+6
The 'arg' argument to copy_thread() is only ever used when forking a new kernel thread. Hence, rename it to 'kthread_arg' for clarity. Signed-off-by: Alex Dowad <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-03-26ARC: signal handling robustifyVineet Gupta1-4/+16
A malicious signal handler / restorer can DOS the system by fudging the user regs saved on stack, causing weird things such as sigreturn returning to user mode PC but cpu state still being kernel mode.... Ensure that in sigreturn path status32 always has U bit; any other bogosity (gargbage PC etc) will be taken care of by normal user mode exceptions mechanisms. Reproducer signal handler: void handle_sig(int signo, siginfo_t *info, void *context) { ucontext_t *uc = context; struct user_regs_struct *regs = &(uc->uc_mcontext.regs); regs->scratch.status32 = 0; } Before the fix, kernel would go off to weeds like below: --------->8----------- [ARCLinux]$ ./signal-test Path: /signal-test CPU: 0 PID: 61 Comm: signal-test Not tainted 4.0.0-rc5+ #65 task: 8f177880 ti: 5ffe6000 task.ti: 8f15c000 [ECR ]: 0x00220200 => Invalid Write @ 0x00000010 by insn @ 0x00010698 [EFA ]: 0x00000010 [BLINK ]: 0x2007c1ee [ERET ]: 0x10698 [STAT32]: 0x00000000 : <-------- BTA: 0x00010680 SP: 0x5ffe7e48 FP: 0x00000000 LPS: 0x20003c6c LPE: 0x20003c70 LPC: 0x00000000 ... --------->8----------- Reported-by: Alexey Brodkin <[email protected]> Cc: <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-03-26ARC: SA_SIGINFO ucontext regs off-by-oneVineet Gupta1-2/+2
The regfile provided to SA_SIGINFO signal handler as ucontext was off by one due to pt_regs gutter cleanups in 2013. Before handling signal, user pt_regs are copied onto user_regs_struct and copied back later. Both structs are binary compatible. This was all fine until commit 2fa919045b72 (ARC: pt_regs update #2) which removed the empty stack slot at top of pt_regs (corresponding to first pad) and made the corresponding fixup in struct user_regs_struct (the pad in there was moved out of @scratch - not removed altogether as it is part of ptrace ABI) struct user_regs_struct { + long pad; struct { - long pad; long bta, lp_start, lp_end,.... } scratch; ... } This meant that now user_regs_struct was off by 1 reg w.r.t pt_regs and signal code needs to user_regs_struct.scratch to reflect it as pt_regs, which is what this commit does. This problem was hidden for 2 years, because both save/restore, despite using wrong location, were using the same location. Only an interim inspection (reproducer below) exposed the issue. void handle_segv(int signo, siginfo_t *info, void *context) { ucontext_t *uc = context; struct user_regs_struct *regs = &(uc->uc_mcontext.regs); printf("regs %x %x\n", <=== prints 7 8 (vs. 8 9) regs->scratch.r8, regs->scratch.r9); } int main() { struct sigaction sa; sa.sa_sigaction = handle_segv; sa.sa_flags = SA_SIGINFO; sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, NULL); asm volatile( "mov r7, 7 \n" "mov r8, 8 \n" "mov r9, 9 \n" "mov r10, 10 \n" :::"r7","r8","r9","r10"); *((unsigned int*)0x10) = 0; } Fixes: 2fa919045b72ec892e "ARC: pt_regs update #2: Remove unused gutter at start of pt_regs" CC: <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-03-06treewide: Fix typo in printk messagesMasanari Iida1-1/+1
This patch fix spelling typo in printk messages. Signed-off-by: Masanari Iida <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2015-02-27ARC: Fix thread_saved_pc()Vineet Gupta1-23/+0
The old implementation assumed that SP at the time of __switch_to() is right above pt_regs which is almost certainly not the case as there will be some stack build up between entry into kernel and leading up to __switch_to Signed-off-by: Vineet Gupta <[email protected]>
2015-02-27ARC: Fix KSTK_ESP()Vineet Gupta1-3/+3
/proc/<pid>/maps currently don't annotate stack vma with "[stack]" This is because KSTK_ESP ie expected to return usermode SP of tsk while currently it returns the kernel mode SP of a sleeping tsk. While the fix is trivial, we also need to adjust the ARC kernel stack unwinder to not use KSTK_SP and friends any more. Cc: <[email protected]> Reported-and-suggested-by: Alexey Brodkin <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-02-27ARC: perf: Enable generic software eventsVineet Gupta1-0/+2
Signed-off-by: Vineet Gupta <[email protected]>
2015-02-27ARC: Make arc_unwind_core accessible externallyVineet Gupta1-1/+14
The arc unwinder can also be used for perf callchains. Signed-off-by: Mischa Jonker <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-02-16Merge tag 'arc-3.20-rc1' of ↵Linus Torvalds4-7/+40
git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC updates from Vineet Gupta: "Some fixes, nothing too exciting this time as well..." * tag 'arc-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: fix page address calculation if PAGE_OFFSET != LINUX_LINK_BASE ARC: Fix earlycon build breakage ARC: Dynamically determine BASE_BAUD from DeviceTree arc: Remove unused prepare_to_copy() ARC: use ACCESS_ONCE in cmpxchg loop ARC: add some more comments to ret_from_fork ARC: fix /proc/cpuinfo for offline cpus
2015-02-12all arches, signal: move restart_block to struct task_structAndy Lutomirski1-1/+1
If an attacker can cause a controlled kernel stack overflow, overwriting the restart block is a very juicy exploit target. This is because the restart_block is held in the same memory allocation as the kernel stack. Moving the restart block to struct task_struct prevents this exploit by making the restart_block harder to locate. Note that there are other fields in thread_info that are also easy targets, at least on some architectures. It's also a decent simplification, since the restart code is more or less identical on all architectures. [[email protected]: metag: align thread_info::supervisor_stack] Signed-off-by: Andy Lutomirski <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Al Viro <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Kees Cook <[email protected]> Cc: David Miller <[email protected]> Acked-by: Richard Weinberger <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Russell King <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Haavard Skinnemoen <[email protected]> Cc: Hans-Christian Egtvedt <[email protected]> Cc: Steven Miao <[email protected]> Cc: Mark Salter <[email protected]> Cc: Aurelien Jacquiot <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: Jesper Nilsson <[email protected]> Cc: David Howells <[email protected]> Cc: Richard Kuo <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Michal Simek <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Acked-by: Michael Ellerman <[email protected]> (powerpc) Tested-by: Michael Ellerman <[email protected]> (powerpc) Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Chen Liqin <[email protected]> Cc: Lennox Wu <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Guan Xuetao <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Max Filippov <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: James Hogan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2015-02-04ARC: Fix earlycon build breakagePeter Hurley1-1/+1
Commit ffb7fcd66f14 ("ARC: Dynamically determine BASE_BAUD from DeviceTree") breaks arc:defconfig build: drivers/built-in.o: In function `of_setup_earlycon': (.init.text+0xb3e): undefined reference to `arc_early_base_baud' drivers/built-in.o: In function `setup_earlycon': (.init.text+0xcd0): undefined reference to `arc_early_base_baud' make: *** [vmlinux] Error 1 BASE_BAUD is only required for earlycon, which should depend on CONFIG_SERIAL_EARLYCON. Reported-by: Guenter Roeck <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-02-02ARC: Dynamically determine BASE_BAUD from DeviceTreeVineet Gupta1-0/+24
8250 earlycon is broken on multi-platform ARC because the UART clk value (BASE_BAUD) is fixed at build time. Instead, determine the appropriate UART clk at runtime; parse the devicetree early for platforms requiring alternate UART clk values (currently only the TB10X platform). Cc: Jiri Slaby <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Rob Herring <[email protected]> Cc: Arnd Bergmann <[email protected]> Reviewed-by: Peter Hurley <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2015-02-02ARC: use ACCESS_ONCE in cmpxchg loopVineet Gupta1-1/+1
Signed-off-by: Vineet Gupta <[email protected]>
2015-02-02ARC: add some more comments to ret_from_forkVineet Gupta1-5/+9
Signed-off-by: Vineet Gupta <[email protected]>
2015-02-02ARC: fix /proc/cpuinfo for offline cpusVineet Gupta1-1/+6
Signed-off-by: Vineet Gupta <[email protected]>
2014-12-12ARC: R-M-W assist locks only needed for !LLSCVineet Gupta1-0/+2
Signed-off-by: Vineet Gupta <[email protected]>
2014-10-23Merge tag 'remove-weak-declarations' of ↵Linus Torvalds1-5/+0
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull weak function declaration removal from Bjorn Helgaas: "The "weak" attribute is commonly used for the default version of a function, where an architecture can override it by providing a strong version. Some header file declarations included the "weak" attribute. That's error-prone because it causes every implementation to be weak, with no strong version at all, and the linker chooses one based on link order. What we want is the "weak" attribute only on the *definition* of the default implementation. These changes remove "weak" from the declarations, leaving it on the default definitions" * tag 'remove-weak-declarations' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: uprobes: Remove "weak" from function declarations memory-hotplug: Remove "weak" from memory_block_size_bytes() declaration kgdb: Remove "weak" from kgdb_arch_pc() declaration ARC: kgdb: generic kgdb_arch_pc() suffices vmcore: Remove "weak" from function declarations clocksource: Remove "weak" from clocksource_default_clock() declaration x86, intel-mid: Remove "weak" from function declarations audit: Remove "weak" from audit_classify_compat_syscall() declaration
2014-10-22ARC: kgdb: generic kgdb_arch_pc() sufficesVineet Gupta1-5/+0
The ARC version of kgdb_arch_pc() is identical to the generic version in kernel/debug/debug_core.c. Drop the ARC version so we use the generic one. Signed-off-by: Vineet Gupta <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-10-13ARC: boot: cpu feature print enhancementsVineet Gupta2-109/+120
Signed-off-by: Vineet Gupta <[email protected]>
2014-10-13ARC: boot: consolidate cross-checking of h/w and s/wVineet Gupta1-29/+15
Signed-off-by: Vineet Gupta <[email protected]>
2014-10-13ARC: RIP @running_on_hwVineet Gupta2-12/+0
* No active users of this flag anymore * flag itself was no longer usable with new simualtor which acts just like hardware, not providing the special chip-id = 0xffff which good old ISS used to do. Signed-off-by: Vineet Gupta <[email protected]>
2014-10-13ARC: rename kconfig option for unaligned emulationVineet Gupta2-3/+3
Signed-off-by: Vineet Gupta <[email protected]>