From 845f2e4781d2182e82a9235b7a744e888716ea80 Mon Sep 17 00:00:00 2001 From: Luke Starrett Date: Fri, 31 Jul 2015 11:53:26 -0400 Subject: [PATCH] arm64: el0_dbg does not set link reg for return to user path, breaks debug When the context tracking feature was backported to 3.14 LSK, setting of the LR was moved out of the main body of el0_sync and into the applicable sub handlers (i.e. el0_da, el0_sp_pc, etc). The el0_dbg handler was overlooked. The implication is that do_debug_exception() will attempt to return directly to userspace without going through the ret_from_exception path. This ultimately results in another sync exception due to a protection fault on the target PC. This was introduced by: commit 333625b7586d2753a77f32e1f898ab7cc6cf7655 Author: Larry Bassel Date: Wed Oct 15 15:15:56 2014 -0700 arm64: adjust el0_sync so that a function can be called Backport of the following patch to 3.14 LSK: commit 6ab6463aeb5fbc75fa3227befb508fc33b34dbf1 Author: Larry Bassel Date: Fri May 30 20:34:14 2014 +0100 Signed-off-by: Luke Starrett Signed-off-by: Kevin Hilman --- arch/arm64/kernel/entry.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index e59b7b3500fc..279cd3956b2a 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -526,6 +526,7 @@ el0_dbg: disable_step x1 mov x1, x25 mov x2, sp + adr lr, ret_from_exception b do_debug_exception el0_inv: ct_user_exit