Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad...
[pandora-kernel.git] / arch / arm / mm / alignment.c
index 6f98c35..d073b64 100644 (file)
@@ -924,8 +924,20 @@ static int __init alignment_init(void)
                ai_usermode = UM_FIXUP;
        }
 
-       hook_fault_code(1, do_alignment, SIGILL, "alignment exception");
-       hook_fault_code(3, do_alignment, SIGILL, "alignment exception");
+       hook_fault_code(1, do_alignment, SIGBUS, BUS_ADRALN,
+                       "alignment exception");
+
+       /*
+        * ARMv6K and ARMv7 use fault status 3 (0b00011) as Access Flag section
+        * fault, not as alignment error.
+        *
+        * TODO: handle ARMv6K properly. Runtime check for 'K' extension is
+        * needed.
+        */
+       if (cpu_architecture() <= CPU_ARCH_ARMv6) {
+               hook_fault_code(3, do_alignment, SIGBUS, BUS_ADRALN,
+                               "alignment exception");
+       }
 
        return 0;
 }