Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db6ccbb61c1291c8aaefadcc8304444f27eeb88d
Commit:     db6ccbb61c1291c8aaefadcc8304444f27eeb88d
Parent:     4ac941d2d04ef26a91adf677f3a371818596305d
Author:     Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 6 22:53:48 2007 +0000
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Jan 6 22:53:48 2007 +0000

    [ARM] Fix kernel-mode undefined instruction aborts
    
    If the kernel attempts to execute a CP1 or CP2 instruction and it
    aborts, and a FP emulator is not loaded, we try to return as if to
    a user context, instead of the proper kernel context.  Since the
    fault came from kernel mode, we must use the kernel return paths.
    
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/entry-armv.S |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 2db42b1..8517c3c 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -436,7 +436,7 @@ __und_usr:
        usr_entry
 
        tst     r3, #PSR_T_BIT                  @ Thumb mode?
-       bne     fpundefinstr                    @ ignore FP
+       bne     __und_usr_unknown               @ ignore FP
        sub     r4, r2, #4
 
        @
@@ -448,7 +448,7 @@ __und_usr:
        @
 1:     ldrt    r0, [r4]
        adr     r9, ret_from_exception
-       adr     lr, fpundefinstr
+       adr     lr, __und_usr_unknown
        @
        @ fallthrough to call_fpe
        @
@@ -476,7 +476,9 @@ __und_usr:
  * Emulators may wish to make use of the following registers:
  *  r0  = instruction opcode.
  *  r2  = PC+4
+ *  r9  = normal "successful" return address
  *  r10 = this threads thread_info structure.
+ *  lr  = unrecognised instruction return address
  */
 call_fpe:
        tst     r0, #0x08000000                 @ only CDP/CPRT/LDC/STC have 
bit 27
@@ -545,10 +547,12 @@ do_fpe:
 
        .data
 ENTRY(fp_enter)
-       .word   fpundefinstr
+       .word   no_fp
        .text
 
-fpundefinstr:
+no_fp: mov     pc, lr
+
+__und_usr_unknown:
        mov     r0, sp
        adr     lr, ret_from_exception
        b       do_undefinstr
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to