plugins/core: allow reading of registers during discon events

We have protections that prevent callbacks that didn't declare
themselves as wanting to access registers. However for discontinuities
the system state is fully rectified so they should always be able to
read the register values.

a1688bc86c (plugins: add hooks for new discontinuity related callbacks)

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: Julian Ganz <neither@nut.email>
Reviewed-by: Julian Ganz <neither@nut.email>
Message-ID: <20251204194902.1340008-12-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2025-12-04 19:49:02 +00:00
parent ee6a482e9c
commit 81c5a3f867

View file

@ -119,6 +119,7 @@ static void plugin_vcpu_cb__discon(CPUState *cpu,
struct qemu_plugin_cb *cb, *next; struct qemu_plugin_cb *cb, *next;
uint64_t to = cpu->cc->get_pc(cpu); uint64_t to = cpu->cc->get_pc(cpu);
qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS);
if (cpu->cpu_index < plugin.num_vcpus) { if (cpu->cpu_index < plugin.num_vcpus) {
/* iterate safely; plugins might uninstall themselves at any time */ /* iterate safely; plugins might uninstall themselves at any time */
QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) {
@ -127,6 +128,7 @@ static void plugin_vcpu_cb__discon(CPUState *cpu,
func(cb->ctx->id, cpu->cpu_index, type, from, to); func(cb->ctx->id, cpu->cpu_index, type, from, to);
} }
} }
qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS);
} }
/* /*