lkml.org 
[lkml]   [2014]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.16 035/127] arm64: debug: dont re-enable debug exceptions on return from el1_dbg
    Date
    3.16-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Will Deacon <will.deacon@arm.com>

    commit 1059c6bf8534acda249e7e65c81e7696fb074dc1 upstream.

    When returning from a debug exception taken from EL1, we unmask debug
    exceptions after handling the exception. This is crucial for debug
    exceptions taken from EL0, so that any kernel work on the ret_to_user
    path can be debugged by kgdb.

    However, when returning back to EL1 the only thing left to do is to
    restore the original register state before the exception return. If
    single-step has been enabled by the debug exception handler, we will
    get stuck in an infinite debug exception loop, since we will take the
    step exception as soon as we unmask debug exceptions.

    This patch avoids unmasking debug exceptions on the debug exception
    return path when the exception was taken from EL1.

    Fixes: 2a2830703a23 (arm64: debug: avoid accessing mdscr_el1 on fault paths where possible)
    Reported-by: David Long <dave.long@linaro.org>
    Reported-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/arm64/kernel/entry.S | 1 -
    1 file changed, 1 deletion(-)

    --- a/arch/arm64/kernel/entry.S
    +++ b/arch/arm64/kernel/entry.S
    @@ -298,7 +298,6 @@ el1_dbg:
    mrs x0, far_el1
    mov x2, sp // struct pt_regs
    bl do_debug_exception
    - enable_dbg
    kernel_exit 1
    el1_inv:
    // TODO: add support for undefined instructions in kernel mode



    \
     
     \ /
      Last update: 2014-10-28 08:41    [W:8.007 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site