]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ARM: 6268/1: ARMv6K and ARMv7 use fault statuses 3 and 6 as Access Flag fault
authorKirill A. Shutemov <kirill@shutemov.name>
Mon, 26 Jul 2010 10:20:41 +0000 (11:20 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 27 Jul 2010 09:48:41 +0000 (10:48 +0100)
Statuses 3 (0b00011) and 6 (0x00110) of DFSR are Access Flags faults on
ARMv6K and ARMv7. Let's patch fsr_info[] at runtime if we are on ARMv7
or later.

Unfortunately, we don't have runtime check for 'K' extension, so we
can't check for it.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/alignment.c
arch/arm/mm/fault.c

index 77cfdbed9501f7e6888a8e836e45a8898645c811..d073b64ae87ec4f6652c67959244292dbb3e69ad 100644 (file)
@@ -926,8 +926,18 @@ static int __init alignment_init(void)
 
        hook_fault_code(1, do_alignment, SIGBUS, BUS_ADRALN,
                        "alignment exception");
-       hook_fault_code(3, 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;
 }
index 5835e63454ff6d21f40aeb4633515cfb9b474ccd..23b0b03af5ea84b8a01e10c59a97091d92f4618b 100644 (file)
@@ -607,6 +607,17 @@ static int __init exceptions_init(void)
                                "I-cache maintenance fault");
        }
 
+       if (cpu_architecture() >= CPU_ARCH_ARMv7) {
+               /*
+                * TODO: Access flag faults introduced in ARMv6K.
+                * Runtime check for 'K' extension is needed
+                */
+               hook_fault_code(3, do_bad, SIGSEGV, SEGV_MAPERR,
+                               "section access flag fault");
+               hook_fault_code(6, do_bad, SIGSEGV, SEGV_MAPERR,
+                               "section access flag fault");
+       }
+
        return 0;
 }