diff mbox series

[1/1] AArch64: Fix single stepping of ERET instruction

Message ID 001801d32891$ec40b930$c4c22b90$@samsung.com
State New
Headers show
Series [1/1] AArch64: Fix single stepping of ERET instruction | expand

Commit Message

Jaroslaw Pelczar Sept. 8, 2017, 11:02 a.m. UTC
Previously when single stepping through ERET instruction via GDB
would result in debugger entering the "next" PC after ERET instruction.
When debugging in kernel mode, this will also cause unintended behavior,
because debugger will try to access memory from EL0 point of view.

Signed-off-by: Jaroslaw Pelczar <j.pelczar@samsung.com>
---
 target/arm/translate-a64.c | 1 +
 1 file changed, 1 insertion(+)

                 gen_exception_internal(EXCP_DEBUG);

Comments

Richard Henderson Sept. 8, 2017, 4:58 p.m. UTC | #1
On 09/08/2017 04:02 AM, Jaroslaw Pelczar wrote:
> Previously when single stepping through ERET instruction via GDB
> would result in debugger entering the "next" PC after ERET instruction.
> When debugging in kernel mode, this will also cause unintended behavior,
> because debugger will try to access memory from EL0 point of view.
> 
> Signed-off-by: Jaroslaw Pelczar <j.pelczar@samsung.com>
> ---
>  target/arm/translate-a64.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Peter Maydell Sept. 14, 2017, 12:34 p.m. UTC | #2
On 8 September 2017 at 17:58, Richard Henderson
<richard.henderson@linaro.org> wrote:
> On 09/08/2017 04:02 AM, Jaroslaw Pelczar wrote:
>> Previously when single stepping through ERET instruction via GDB
>> would result in debugger entering the "next" PC after ERET instruction.
>> When debugging in kernel mode, this will also cause unintended behavior,
>> because debugger will try to access memory from EL0 point of view.
>>
>> Signed-off-by: Jaroslaw Pelczar <j.pelczar@samsung.com>
>> ---
>>  target/arm/translate-a64.c | 1 +
>>  1 file changed, 1 insertion(+)
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Applied, thanks.

-- PMM
diff mbox series

Patch

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 9017e30510..1bc12d93ca 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -11348,6 +11348,7 @@  static void aarch64_tr_tb_stop(DisasContextBase
*dcbase, CPUState *cpu)
         default:
             gen_a64_set_pc_im(dc->pc);
             /* fall through */
+        case DISAS_EXIT:
         case DISAS_JUMP:
             if (dc->base.singlestep_enabled) {