powerpc: Don't try to fix up misaligned load-with-reservation instructions
[pandora-kernel.git] / arch / powerpc / kernel / align.c
index 8184ee9..adc1d4f 100644 (file)
@@ -764,6 +764,27 @@ int fix_alignment(struct pt_regs *regs)
        nb = aligninfo[instr].len;
        flags = aligninfo[instr].flags;
 
+       /*
+        * Handle some cases which give overlaps in the DSISR values.
+        */
+       if (IS_XFORM(instruction)) {
+               switch ((instruction >> 1) & 0x3ff) {
+               case 532:       /* ldbrx */
+                       nb = 8;
+                       flags = LD+SW;
+                       break;
+               case 660:       /* stdbrx */
+                       nb = 8;
+                       flags = ST+SW;
+                       break;
+               case 20:        /* lwarx */
+               case 84:        /* ldarx */
+               case 116:       /* lharx */
+               case 276:       /* lqarx */
+                       return 0;       /* not emulated ever */
+               }
+       }
+
        /* Byteswap little endian loads and stores */
        swiz = 0;
        if (regs->msr & MSR_LE) {