aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2015-07-07 18:00:49 +0100
committerAmit Pundir <amit.pundir@linaro.org>2016-12-05 12:24:04 +0530
commit1837d2845745677f3a92fedeff14f379c1ddd4b2 (patch)
tree64c0e6879862415f26756c07f9bd21a1703dc5a3 /arch
parentca707594ba2df436519513aa7372be1fbd144487 (diff)
UPSTREAM: arm64: entry: handle debug exceptions in el*_inv
Currently we enable debug exceptions before reading ESR_EL1 in both el0_inv and el1_inv. If a debug exception is taken before we read ESR_EL1, the value will have been corrupted. As el*_inv is typically fatal, an intervening debug exception results in misleading debug information being logged to the console, but is not otherwise harmful. As with the other entry paths, we can use the ESR_EL1 value stashed earlier in the exception entry (in x25 for el0_sync{,_compat}, and x1 for el1_sync), giving us better error reporting in this case. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Bug: 31432001 Change-Id: I24d310b15e803de2a9ae3b25bd66f1466a26121c (cherry picked from commit 1b42804d27b1c2623309950e9b203b11f4c67f4f) Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kernel/entry.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 037ef51a001b..7f20c926f561 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -369,8 +369,8 @@ el1_inv:
// TODO: add support for undefined instructions in kernel mode
enable_dbg
mov x0, sp
+ mov x2, x1
mov x1, #BAD_SYNC
- mrs x2, esr_el1
b bad_mode
ENDPROC(el1_sync)
@@ -570,7 +570,7 @@ el0_inv:
ct_user_exit
mov x0, sp
mov x1, #BAD_SYNC
- mrs x2, esr_el1
+ mov x2, x25
bl bad_mode
b ret_to_user
ENDPROC(el0_sync)