[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop |
Date: |
Mon, 10 Jul 2017 13:19:57 +0100 |
On 10 July 2017 at 13:15, Alex Bennée <address@hidden> wrote:
> Looking at translate.c (32 bit arm), we have:
>
> gen_srs
> gen_mrs_banked
> gen_msr_banked
>
> These all manually set:
>
> gen_set_pc_im(s, s->pc - 4);
>
> before their respective helpers. I think setting the PC after the helper
> is superfluous given we are will at that point be exiting the block.
No, you need both. We do
gen_set_pc_im(s, s->pc - 4);
before calling the helper because the helper might throw an
exception, in which case the PC needs to point to that insn.
We then call
gen_set_pc_im(dc, dc->pc);
before exiting the block because if we leave execution by
falling off the end of the block then the PC should point to
the insn that comes next (ie just after the last one in the block)
thanks
-- PMM
- [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Alex Bennée, 2017/07/07
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Alex Bennée, 2017/07/07
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Peter Maydell, 2017/07/07
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Richard Henderson, 2017/07/07
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Alex Bennée, 2017/07/07
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Richard Henderson, 2017/07/07
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Philippe Mathieu-Daudé, 2017/07/08
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Alex Bennée, 2017/07/10
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop,
Peter Maydell <=
- Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop, Alex Bennée, 2017/07/10