qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of disc


From: Julian Ganz
Subject: Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc
Date: Sat, 07 Dec 2024 13:47:47 +0000

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



reply via email to

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