From 27b2dbb0f4c226a01795ecd79ece59b3618a88a6 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Mon, 26 Jul 2010 11:20:41 +0100 Subject: [PATCH] --- yaml --- r: 201487 b: refs/heads/master c: b8ab5397bcbd92e3fd4a9770e0bf59315fa38dab h: refs/heads/master i: 201485: 5a107e5db1590615a68741da8b1c5aa193af864d 201483: 6b257e6d168b137438e476b315ad4aa1a85d2fc5 201479: 4b34b576d9ac3ccf15380b16d01347bf8c183639 201471: a90e29614ea0e44241216af0bec0ba31fe52054f v: v3 --- [refs] | 2 +- trunk/arch/arm/mm/alignment.c | 14 ++++++++++++-- trunk/arch/arm/mm/fault.c | 11 +++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index e9088d77c97b..9f6003523312 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 993bf4ec8c2a2b7979389ab196bf2fe217117158 +refs/heads/master: b8ab5397bcbd92e3fd4a9770e0bf59315fa38dab diff --git a/trunk/arch/arm/mm/alignment.c b/trunk/arch/arm/mm/alignment.c index 77cfdbed9501..d073b64ae87e 100644 --- a/trunk/arch/arm/mm/alignment.c +++ b/trunk/arch/arm/mm/alignment.c @@ -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; } diff --git a/trunk/arch/arm/mm/fault.c b/trunk/arch/arm/mm/fault.c index 5835e63454ff..23b0b03af5ea 100644 --- a/trunk/arch/arm/mm/fault.c +++ b/trunk/arch/arm/mm/fault.c @@ -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; }