]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/traps.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[karo-tx-linux.git] / arch / powerpc / kernel / traps.c
index 9763faab67391677fceb0524ac5fdd3233548426..91a6e04d9741fb197f4fb91ec039a1a154b2eabd 100644 (file)
@@ -97,7 +97,6 @@ static DEFINE_SPINLOCK(die_lock);
 int die(const char *str, struct pt_regs *regs, long err)
 {
        static int die_counter, crash_dump_start = 0;
-       int nl = 0;
 
        if (debugger(regs))
                return 1;
@@ -106,7 +105,7 @@ int die(const char *str, struct pt_regs *regs, long err)
        spin_lock_irq(&die_lock);
        bust_spinlocks(1);
 #ifdef CONFIG_PMAC_BACKLIGHT
-       if (_machine == _MACH_Pmac) {
+       if (machine_is(powermac)) {
                set_backlight_enable(1);
                set_backlight_level(BACKLIGHT_MAX);
        }
@@ -114,46 +113,18 @@ int die(const char *str, struct pt_regs *regs, long err)
        printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
 #ifdef CONFIG_PREEMPT
        printk("PREEMPT ");
-       nl = 1;
 #endif
 #ifdef CONFIG_SMP
        printk("SMP NR_CPUS=%d ", NR_CPUS);
-       nl = 1;
 #endif
 #ifdef CONFIG_DEBUG_PAGEALLOC
        printk("DEBUG_PAGEALLOC ");
-       nl = 1;
 #endif
 #ifdef CONFIG_NUMA
        printk("NUMA ");
-       nl = 1;
 #endif
-#ifdef CONFIG_PPC64
-       switch (_machine) {
-       case PLATFORM_PSERIES:
-               printk("PSERIES ");
-               nl = 1;
-               break;
-       case PLATFORM_PSERIES_LPAR:
-               printk("PSERIES LPAR ");
-               nl = 1;
-               break;
-       case PLATFORM_ISERIES_LPAR:
-               printk("ISERIES LPAR ");
-               nl = 1;
-               break;
-       case PLATFORM_POWERMAC:
-               printk("POWERMAC ");
-               nl = 1;
-               break;
-       case PLATFORM_CELL:
-               printk("CELL ");
-               nl = 1;
-               break;
-       }
-#endif
-       if (nl)
-               printk("\n");
+       printk("%s\n", ppc_md.name ? "" : ppc_md.name);
+
        print_modules();
        show_regs(regs);
        bust_spinlocks(0);
@@ -257,7 +228,7 @@ void system_reset_exception(struct pt_regs *regs)
  */
 static inline int check_io_access(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC_PMAC
+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
        unsigned long msr = regs->msr;
        const struct exception_table_entry *entry;
        unsigned int *nip = (unsigned int *)regs->nip;
@@ -290,7 +261,7 @@ static inline int check_io_access(struct pt_regs *regs)
                        return 1;
                }
        }
-#endif /* CONFIG_PPC_PMAC */
+#endif /* CONFIG_PPC_PMAC && CONFIG_PPC32 */
        return 0;
 }
 
@@ -337,8 +308,8 @@ platform_machine_check(struct pt_regs *regs)
 
 void machine_check_exception(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC64
        int recover = 0;
+       unsigned long reason = get_mc_reason(regs);
 
        /* See if any machine dependent calls */
        if (ppc_md.machine_check_exception)
@@ -346,8 +317,6 @@ void machine_check_exception(struct pt_regs *regs)
 
        if (recover)
                return;
-#else
-       unsigned long reason = get_mc_reason(regs);
 
        if (user_mode(regs)) {
                regs->msr |= MSR_RI;
@@ -491,7 +460,6 @@ void machine_check_exception(struct pt_regs *regs)
         * additional info, e.g. bus error registers.
         */
        platform_machine_check(regs);
-#endif /* CONFIG_PPC64 */
 
        if (debugger_fault_handler(regs))
                return;
@@ -690,7 +658,7 @@ static int emulate_instruction(struct pt_regs *regs)
        u32 instword;
        u32 rd;
 
-       if (!user_mode(regs))
+       if (!user_mode(regs) || (regs->msr & MSR_LE))
                return -EINVAL;
        CHECK_FULL_REGS(regs);
 
@@ -837,9 +805,11 @@ void __kprobes program_check_exception(struct pt_regs *regs)
 
 void alignment_exception(struct pt_regs *regs)
 {
-       int fixed;
+       int fixed = 0;
 
-       fixed = fix_alignment(regs);
+       /* we don't implement logging of alignment exceptions */
+       if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
+               fixed = fix_alignment(regs);
 
        if (fixed == 1) {
                regs->nip += 4; /* skip over emulated instruction */