qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH] target/arm: ensure eret exits the run-loop


From: Richard Henderson
Subject: Re: [Qemu-devel] [RFC PATCH] target/arm: ensure eret exits the run-loop
Date: Fri, 7 Jul 2017 08:52:39 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/07/2017 08:29 AM, Alex Bennée wrote:
Naming all of these different exit conditions is certainly
non-trivial.

Given the variation of usage this is something that should probably be
done after Lluís common run loop goes in and we can beef up the
semantics of the various exit conditions.

Definitely.

One thing I have noticed in the ARM translator is DISAS_UPDATE does a:

     gen_a64_set_pc_im(dc->pc);

I think this is to deal with handling exceptions either side of various
instructions. Am I right in thinking this is superfluous now as we can
derive the PC from the translated code address?

Yes and no.

We have typically distinguished between two kinds of exceptions: those that are dynamic (fp state, page permissions) and those that are static (illegal opcodes).

For the dynamic, we used to pessimistically save state, but now use the unwinder to restore it. The unwinding is expensive but is used infrequently (especially compared to the number of load/store insns executed).

For the static, we know the exception must be raised, and we know the state that must be saved. By doing that, we save the expense of the unwinding.

So, for the static case you're talking about, we could get the PC (and other state) back, and remove the explicit stores, but we shouldn't.


r~



reply via email to

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