Florian Hofhammer <florian.hofham...@epfl.ch> writes: > Hi Alex, > > Sorry for the late reply, I've been out of office and did not check my > mail. > > On 05/08/2025 17:30, Alex Bennée wrote: >> I think to read the PC we would just need to make sure we properly >> resolve it - internally QEMU does this for faults with: >> tb = tcg_tb_lookup(retaddr); >> cpu_restore_state_from_tb(cpu, tb, retaddr); >> where retaddr is the address of the translated code. We just need to >> special case PC handling in the read path. >> *snip* No need - we just need to exit the loop via >> cpu_loop_exit_restore() and >> the code will do the right thing. However we probably don't want to >> trigger that via register write as we would surprise the plugin - >> especially if there are other hooks still to run. So we would want an >> explicit helper to do it. > > Is this something the QEMU maintainers would be interested in? If yes, > I'm happy to dig into the codebase and submit some patches for review. > But this of course depends on whether such a feature is even desirable > in QEMU (cf. the parallel discussion thread).
I think writing the patches would be a useful exercise anyway. The way the plugin code is structured should mean you can keep the changes fairly localised which would reduce the burden of maintaining an out-of-tree patch if it isn't accepted. This wasn't really possible pre-plugins as instrumentation was often deep in the frontends which is actively maintained code with constant changes making re-basing a nightmare. > > Best regards, > Florian -- Alex Bennée Virtualisation Tech Lead @ Linaro