powerpc: Handle unaligned ldbrx/stdbrx
[pandora-kernel.git] / arch / powerpc / kernel / align.c
index 8184ee9..3fcbae0 100644 (file)
@@ -764,6 +764,16 @@ int fix_alignment(struct pt_regs *regs)
        nb = aligninfo[instr].len;
        flags = aligninfo[instr].flags;
 
+       /* ldbrx/stdbrx overlap lfs/stfs in the DSISR unfortunately */
+       if (IS_XFORM(instruction) && ((instruction >> 1) & 0x3ff) == 532) {
+               nb = 8;
+               flags = LD+SW;
+       } else if (IS_XFORM(instruction) &&
+                  ((instruction >> 1) & 0x3ff) == 660) {
+               nb = 8;
+               flags = ST+SW;
+       }
+
        /* Byteswap little endian loads and stores */
        swiz = 0;
        if (regs->msr & MSR_LE) {