qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] AArch64: Fix single stepping of ERET instruction
       [not found] <CGME20170908110212eucas1p27c5eecf44c5501d23b322d3679a4f12d@eucas1p2.samsung.com>
@ 2017-09-08 11:02 ` Jaroslaw Pelczar
  2017-09-08 16:58   ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Jaroslaw Pelczar @ 2017-09-08 11:02 UTC (permalink / raw)
  To: qemu-devel

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(+)

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) {
                 gen_exception_internal(EXCP_DEBUG);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 1/1] AArch64: Fix single stepping of ERET instruction
       [not found] <CGME20170908112615eucas1p12372f91b57dad31cdcfad2d7b5683c7a@eucas1p1.samsung.com>
@ 2017-09-08 11:26 ` Jaroslaw Pelczar
  0 siblings, 0 replies; 4+ messages in thread
From: Jaroslaw Pelczar @ 2017-09-08 11:26 UTC (permalink / raw)
  To: qemu-devel

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(+)

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) {
                 gen_exception_internal(EXCP_DEBUG);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] AArch64: Fix single stepping of ERET instruction
  2017-09-08 11:02 ` [Qemu-devel] [PATCH 1/1] AArch64: Fix single stepping of ERET instruction Jaroslaw Pelczar
@ 2017-09-08 16:58   ` Richard Henderson
  2017-09-14 12:34     ` [Qemu-devel] [Qemu-arm] " Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2017-09-08 16:58 UTC (permalink / raw)
  To: Jaroslaw Pelczar, qemu-devel, open list:ARM

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~

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [Qemu-arm] [PATCH 1/1] AArch64: Fix single stepping of ERET instruction
  2017-09-08 16:58   ` Richard Henderson
@ 2017-09-14 12:34     ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2017-09-14 12:34 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Jaroslaw Pelczar, QEMU Developers, open list:ARM

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-14 12:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20170908110212eucas1p27c5eecf44c5501d23b322d3679a4f12d@eucas1p2.samsung.com>
2017-09-08 11:02 ` [Qemu-devel] [PATCH 1/1] AArch64: Fix single stepping of ERET instruction Jaroslaw Pelczar
2017-09-08 16:58   ` Richard Henderson
2017-09-14 12:34     ` [Qemu-devel] [Qemu-arm] " Peter Maydell
     [not found] <CGME20170908112615eucas1p12372f91b57dad31cdcfad2d7b5683c7a@eucas1p1.samsung.com>
2017-09-08 11:26 ` [Qemu-devel] " Jaroslaw Pelczar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).