aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/traps.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/kernel/traps.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/kernel/traps.c')
-rw-r--r--arch/arm/kernel/traps.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index cda78d59aa31..6807cb1e76dd 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -23,6 +23,7 @@
23#include <linux/kexec.h> 23#include <linux/kexec.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/sched.h>
26 27
27#include <asm/atomic.h> 28#include <asm/atomic.h>
28#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
@@ -32,11 +33,12 @@
32#include <asm/unwind.h> 33#include <asm/unwind.h>
33#include <asm/tls.h> 34#include <asm/tls.h>
34 35
35#include "ptrace.h"
36#include "signal.h" 36#include "signal.h"
37 37
38static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; 38static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
39 39
40void *vectors_page;
41
40#ifdef CONFIG_DEBUG_USER 42#ifdef CONFIG_DEBUG_USER
41unsigned int user_debug; 43unsigned int user_debug;
42 44
@@ -53,10 +55,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long);
53void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) 55void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame)
54{ 56{
55#ifdef CONFIG_KALLSYMS 57#ifdef CONFIG_KALLSYMS
56 char sym1[KSYM_SYMBOL_LEN], sym2[KSYM_SYMBOL_LEN]; 58 printk("[<%08lx>] (%pS) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from);
57 sprint_symbol(sym1, where);
58 sprint_symbol(sym2, from);
59 printk("[<%08lx>] (%s) from [<%08lx>] (%s)\n", where, sym1, from, sym2);
60#else 59#else
61 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); 60 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
62#endif 61#endif
@@ -140,7 +139,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
140 fs = get_fs(); 139 fs = get_fs();
141 set_fs(KERNEL_DS); 140 set_fs(KERNEL_DS);
142 141
143 for (i = -4; i < 1; i++) { 142 for (i = -4; i < 1 + !!thumb; i++) {
144 unsigned int val, bad; 143 unsigned int val, bad;
145 144
146 if (thumb) 145 if (thumb)
@@ -235,7 +234,6 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
235 234
236 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n", 235 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
237 str, err, ++die_counter); 236 str, err, ++die_counter);
238 sysfs_printk_last_file();
239 237
240 /* trap and error numbers are mostly meaningless on ARM */ 238 /* trap and error numbers are mostly meaningless on ARM */
241 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV); 239 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV);
@@ -257,7 +255,7 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
257 return ret; 255 return ret;
258} 256}
259 257
260DEFINE_SPINLOCK(die_lock); 258static DEFINE_SPINLOCK(die_lock);
261 259
262/* 260/*
263 * This function is protected against re-entrancy. 261 * This function is protected against re-entrancy.
@@ -411,8 +409,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
411 struct thread_info *thread = current_thread_info(); 409 struct thread_info *thread = current_thread_info();
412 siginfo_t info; 410 siginfo_t info;
413 411
414 if (current->personality != PER_LINUX && 412 if ((current->personality & PER_MASK) != PER_LINUX &&
415 current->personality != PER_LINUX_32BIT &&
416 thread->exec_domain->handler) { 413 thread->exec_domain->handler) {
417 thread->exec_domain->handler(n, regs); 414 thread->exec_domain->handler(n, regs);
418 return regs->ARM_r0; 415 return regs->ARM_r0;
@@ -566,7 +563,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
566 if (!pmd_present(*pmd)) 563 if (!pmd_present(*pmd))
567 goto bad_access; 564 goto bad_access;
568 pte = pte_offset_map_lock(mm, pmd, addr, &ptl); 565 pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
569 if (!pte_present(*pte) || !pte_dirty(*pte)) { 566 if (!pte_present(*pte) || !pte_write(*pte) || !pte_dirty(*pte)) {
570 pte_unmap_unlock(pte, ptl); 567 pte_unmap_unlock(pte, ptl);
571 goto bad_access; 568 goto bad_access;
572 } 569 }
@@ -711,19 +708,19 @@ void __readwrite_bug(const char *fn)
711} 708}
712EXPORT_SYMBOL(__readwrite_bug); 709EXPORT_SYMBOL(__readwrite_bug);
713 710
714void __pte_error(const char *file, int line, unsigned long val) 711void __pte_error(const char *file, int line, pte_t pte)
715{ 712{
716 printk("%s:%d: bad pte %08lx.\n", file, line, val); 713 printk("%s:%d: bad pte %08llx.\n", file, line, (long long)pte_val(pte));
717} 714}
718 715
719void __pmd_error(const char *file, int line, unsigned long val) 716void __pmd_error(const char *file, int line, pmd_t pmd)
720{ 717{
721 printk("%s:%d: bad pmd %08lx.\n", file, line, val); 718 printk("%s:%d: bad pmd %08llx.\n", file, line, (long long)pmd_val(pmd));
722} 719}
723 720
724void __pgd_error(const char *file, int line, unsigned long val) 721void __pgd_error(const char *file, int line, pgd_t pgd)
725{ 722{
726 printk("%s:%d: bad pgd %08lx.\n", file, line, val); 723 printk("%s:%d: bad pgd %08llx.\n", file, line, (long long)pgd_val(pgd));
727} 724}
728 725
729asmlinkage void __div0(void) 726asmlinkage void __div0(void)
@@ -759,7 +756,11 @@ static void __init kuser_get_tls_init(unsigned long vectors)
759 756
760void __init early_trap_init(void) 757void __init early_trap_init(void)
761{ 758{
759#if defined(CONFIG_CPU_USE_DOMAINS)
762 unsigned long vectors = CONFIG_VECTORS_BASE; 760 unsigned long vectors = CONFIG_VECTORS_BASE;
761#else
762 unsigned long vectors = (unsigned long)vectors_page;
763#endif
763 extern char __stubs_start[], __stubs_end[]; 764 extern char __stubs_start[], __stubs_end[];
764 extern char __vectors_start[], __vectors_end[]; 765 extern char __vectors_start[], __vectors_end[];
765 extern char __kuser_helper_start[], __kuser_helper_end[]; 766 extern char __kuser_helper_start[], __kuser_helper_end[];
@@ -783,10 +784,10 @@ void __init early_trap_init(void)
783 * Copy signal return handlers into the vector page, and 784 * Copy signal return handlers into the vector page, and
784 * set sigreturn to be a pointer to these. 785 * set sigreturn to be a pointer to these.
785 */ 786 */
786 memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, 787 memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE),
787 sizeof(sigreturn_codes)); 788 sigreturn_codes, sizeof(sigreturn_codes));
788 memcpy((void *)KERN_RESTART_CODE, syscall_restart_code, 789 memcpy((void *)(vectors + KERN_RESTART_CODE - CONFIG_VECTORS_BASE),
789 sizeof(syscall_restart_code)); 790 syscall_restart_code, sizeof(syscall_restart_code));
790 791
791 flush_icache_range(vectors, vectors + PAGE_SIZE); 792 flush_icache_range(vectors, vectors + PAGE_SIZE);
792 modify_domain(DOMAIN_USER, DOMAIN_CLIENT); 793 modify_domain(DOMAIN_USER, DOMAIN_CLIENT);