Hi Richard, December 6, 2024 at 11:56 PM, "Richard Henderson" wrote: > On 12/6/24 14:40, Pierrick Bouvier wrote: > > > > > Do we have an architecture agnostic pc representation, or do we have to add > > this for every > target in {arch}_cpu_exec_interrupt? > > > We have CPUClass.get_pc, which is almost certainly what you want.
I was wondering about this but honestly failed to do so until the current series was done. I'll definitely use this for to_pc in the next iteration. I'll still need to gather from_pc "manually", but that's ok. > The call to TCGCPUOps.cpu_exec_interrupt is only a hint that an interrupt > might be ready: interrupts can still be masked, etc. > > From the current bool return value you can tell if a discontinuity actually > occurred. But if you want to categorize that event in any way you need to > update each architecture. > > You could simplify such updates by changing the return type from bool to an > enum. While you would have to simultaneously update all targets for the > change in function signature, if you select enumerators such that 0 -> no-op > and 1 -> uncategorized, then you can also tell if a target has been updated. > Because this is still C, the current return true/false statements will Just > Work. :-) > > On the other hand, the previous patches to add plugin calls to each > cpu_exec_interrupt are in the end approximately the same level of difficulty, > and is more straightforward, so YMMV. Good to hear. I think I'll stick to the current setup. It likely also probably makes things easier or less awkward if the API is extended to cover things like branches and jumps in the future. Regards, Julian