On 2 June 2014 11:15, Jack Biggs <john.bi...@epfl.ch> wrote: >> When you say arbitrary code what do you mean? Are you wanting to put >> backend specific code there or a common post-amble of tcg ops? Can you give >> a bit more detail about your use case? > > > I'm trying to add a clock-synchronization library so that I can have two (or > more) instances of QEMU run in a synchronized (deterministic) fashion. The > "arbitrary code" is more or less a function call (i.e., callq) instruction > to a function that uses shared semaphores to block execution.
Bear in mind that we can also exit a TB via taking an unexpected exception [usually a load/store which faults], in which case we'll effectively longjump out of the middle of it. If you can rearrange your design to only require your hooks to be called at the *start* of a TB, not the end, that is much easier -- the existing icount machinery does that already. thanks -- PMM