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: Richard Henderson
Subject: Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc
Date: Fri, 6 Dec 2024 16:56:02 -0600
User-agent: Mozilla Thunderbird

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.

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.


Beyond the scope of interruptions, are we guaranteed this instruction pointer (per arch) is always updated between instructions? Any corner cases?

Not "between instructions" or even "between TB". But you are guaranteed that pc is updated by the time we get to cpu_handle_interrupt, where cpu_exec_interrupt is called.


r~



reply via email to

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