Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: entry: prefetch abort: tail-call the main prefetch abort handler

Tail-call the main C prefetch abort handler code from the per-CPU
helper code. Also note that the helper function becomes ABI
compliant in terms of the registers preserved.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+19 -18
+3 -5
arch/arm/kernel/entry-armv.S
··· 45 45 .endm 46 46 47 47 .macro pabt_helper 48 - @ PABORT handler takes fault address in r4 48 + @ PABORT handler takes pt_regs in r2, fault address in r4 and psr in r5 49 49 #ifdef MULTI_PABORT 50 50 ldr ip, .LCprocfns 51 51 mov lr, pc ··· 306 306 .align 5 307 307 __pabt_svc: 308 308 svc_entry 309 - pabt_helper 310 309 mov r2, sp @ regs 311 - bl do_PrefetchAbort @ call abort handler 310 + pabt_helper 312 311 313 312 @ 314 313 @ IRQs off again before pulling preserved data off the stack ··· 652 653 .align 5 653 654 __pabt_usr: 654 655 usr_entry 655 - pabt_helper 656 656 mov r2, sp @ regs 657 - bl do_PrefetchAbort @ call abort handler 657 + pabt_helper 658 658 UNWIND(.fnend ) 659 659 /* fall through */ 660 660 /*
+5 -4
arch/arm/mm/pabort-legacy.S
··· 4 4 /* 5 5 * Function: legacy_pabort 6 6 * 7 - * Params : r4 = address of aborted instruction 7 + * Params : r2 = pt_regs 8 + * : r4 = address of aborted instruction 9 + * : r5 = psr for parent context 8 10 * 9 - * Returns : r0 = address of abort 10 - * : r1 = Simulated IFSR with section translation fault status 11 + * Returns : r4 - r11, r13 preserved 11 12 * 12 13 * Purpose : obtain information about current prefetch abort. 13 14 */ ··· 17 16 ENTRY(legacy_pabort) 18 17 mov r0, r4 19 18 mov r1, #5 20 - mov pc, lr 19 + b do_PrefetchAbort 21 20 ENDPROC(legacy_pabort)
+5 -4
arch/arm/mm/pabort-v6.S
··· 4 4 /* 5 5 * Function: v6_pabort 6 6 * 7 - * Params : r4 = address of aborted instruction 7 + * Params : r2 = pt_regs 8 + * : r4 = address of aborted instruction 9 + * : r5 = psr for parent context 8 10 * 9 - * Returns : r0 = address of abort 10 - * : r1 = IFSR 11 + * Returns : r4 - r11, r13 preserved 11 12 * 12 13 * Purpose : obtain information about current prefetch abort. 13 14 */ ··· 17 16 ENTRY(v6_pabort) 18 17 mov r0, r4 19 18 mrc p15, 0, r1, c5, c0, 1 @ get IFSR 20 - mov pc, lr 19 + b do_PrefetchAbort 21 20 ENDPROC(v6_pabort)
+6 -5
arch/arm/mm/pabort-v7.S
··· 2 2 #include <asm/assembler.h> 3 3 4 4 /* 5 - * Function: v6_pabort 5 + * Function: v7_pabort 6 6 * 7 - * Params : r4 = address of aborted instruction 7 + * Params : r2 = pt_regs 8 + * : r4 = address of aborted instruction 9 + * : r5 = psr for parent context 8 10 * 9 - * Returns : r0 = address of abort 10 - * : r1 = IFSR 11 + * Returns : r4 - r11, r13 preserved 11 12 * 12 13 * Purpose : obtain information about current prefetch abort. 13 14 */ ··· 17 16 ENTRY(v7_pabort) 18 17 mrc p15, 0, r0, c6, c0, 2 @ get IFAR 19 18 mrc p15, 0, r1, c5, c0, 1 @ get IFSR 20 - mov pc, lr 19 + b do_PrefetchAbort 21 20 ENDPROC(v7_pabort)