Skip to content

Commit

Permalink
ARM: 6268/1: ARMv6K and ARMv7 use fault statuses 3 and 6 as Access Fl…
Browse files Browse the repository at this point in the history
…ag fault

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>
  • Loading branch information
Kirill A. Shutemov authored and Russell King committed Jul 27, 2010
1 parent 993bf4e commit b8ab539
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
14 changes: 12 additions & 2 deletions arch/arm/mm/alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b8ab539

Please sign in to comment.