Florian Hofhammer <florian.hofham...@epfl.ch> writes: > Hi Alex, hi Pierrick, > > I'm taking the freedom to reply to both of you at the same time, I > hope you don't mind :) > > On 04/08/2025 18:05, Alex Bennée wrote: >>> I was wondering whether the QEMU community would be open to extending >>> the plugin API so that a plugin can fully emulate a syscall without >>> the original syscall being executed by QEMU. >> <snip> >> Another option would be to have a set_pc function that would restart >> the execution at new PC. Then the vcpu_syscall_cb callback could set >> the PC to post the syscall with whatever state it wants to set up. > > Such a set_pc functionality is already covered with the register write > API, as long as I have a handle to the PC register, right? Please do > correct me if I'm misunderstanding something here!
Ahh we should make that clear. It requires special handling as the PC isn't automatically updated every instruction. For analysis this isn't a problem as the TB itself knows the vaddr of each instruction so can save it if it wants. Currently if you write to the PC it won't change flow - and it will likely be reset as we exit the syscall. c.f. https://gitlab.com/qemu-project/qemu/-/issues/2208 > > Thanks for your input, > Florian -- Alex Bennée Virtualisation Tech Lead @ Linaro