qemu-arm
[Top][All Lists]
Advanced

[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: Alex Bennée
Subject: Re: [Qemu-arm] [RFC PATCH] target/arm: ensure eret exits the run-loop
Date: Mon, 10 Jul 2017 13:54:58 +0100
User-agent: mu4e 0.9.19; emacs 25.2.50.3

Peter Maydell <address@hidden> writes:

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

OK I see now. I think I have a plan going forward.

>
> thanks
> -- PMM


--
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]