On 5/19/25 16:19, Julian Ganz wrote:
The plugin API allows registration of callbacks for a variety of VCPU
related events, such as VCPU reset, idle and resume. However, traps of
any kind, i.e. interrupts or exceptions, were previously not covered.
These kinds of events are arguably quite significant and usually go hand
in hand with a PC discontinuity. On most platforms, the discontinuity
also includes a transition from some "mode" to another. Thus, plugins
for the analysis of (virtualized) embedded systems may benefit from or
even require the possiblity to perform work on the occurance of an
interrupt or exception.

This change introduces the concept of such a discontinuity event in the
form of an enumeration. Currently only traps are covered. Specifically
we (loosely) define interrupts, exceptions and host calls across all
platforms. In addition, this change introduces a type to use for
callback functions related to such events. Since possible modes and the
enumeration of interupts and exceptions vary greatly between different
architectures, the callback type only receives the VCPU id, the type of
event as well as the old and new PC.

Reviewed-by: Pierrick Bouvier<pierrick.bouv...@linaro.org>
Signed-off-by: Julian Ganz<neither@nut.email>
---
  include/qemu/plugin.h      |  1 +
  include/qemu/qemu-plugin.h | 44 ++++++++++++++++++++++++++++++++++++++
  2 files changed, 45 insertions(+)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to