提交 1b42804d 编写于 作者: M Mark Rutland 提交者: Catalin Marinas

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: NMark Rutland <mark.rutland@arm.com>
Acked-by: NWill Deacon <will.deacon@arm.com>
Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
上级 ef37566c
...@@ -352,8 +352,8 @@ el1_inv: ...@@ -352,8 +352,8 @@ el1_inv:
// TODO: add support for undefined instructions in kernel mode // TODO: add support for undefined instructions in kernel mode
enable_dbg enable_dbg
mov x0, sp mov x0, sp
mov x2, x1
mov x1, #BAD_SYNC mov x1, #BAD_SYNC
mrs x2, esr_el1
b bad_mode b bad_mode
ENDPROC(el1_sync) ENDPROC(el1_sync)
...@@ -553,7 +553,7 @@ el0_inv: ...@@ -553,7 +553,7 @@ el0_inv:
ct_user_exit ct_user_exit
mov x0, sp mov x0, sp
mov x1, #BAD_SYNC mov x1, #BAD_SYNC
mrs x2, esr_el1 mov x2, x25
bl bad_mode bl bad_mode
b ret_to_user b ret_to_user
ENDPROC(el0_sync) ENDPROC(el0_sync)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册