qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Julian Ganz" <neither@nut.email>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>
Subject: [PULL 12/14] plugins/core: allow reading of registers during discon events
Date: Fri,  5 Dec 2025 16:41:23 +0000	[thread overview]
Message-ID: <20251205164125.2122504-13-alex.bennee@linaro.org> (raw)
In-Reply-To: <20251205164125.2122504-1-alex.bennee@linaro.org>

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.

a1688bc86ce (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>

diff --git a/plugins/core.c b/plugins/core.c
index 8f8bc7219c2..b4b783008f7 100644
--- a/plugins/core.c
+++ b/plugins/core.c
@@ -119,6 +119,7 @@ static void plugin_vcpu_cb__discon(CPUState *cpu,
     struct qemu_plugin_cb *cb, *next;
     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) {
         /* iterate safely; plugins might uninstall themselves at any time */
         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);
         }
     }
+    qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS);
 }
 
 /*
-- 
2.47.3



  parent reply	other threads:[~2025-12-05 16:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05 16:41 [PULL 00/14] Final fixes for 10.2 (gitlab, testing, docker, docs, plugins) Alex Bennée
2025-12-05 16:41 ` [PULL 01/14] gitlab: drop --disable-pie from aarch64-all-linux-static build Alex Bennée
2025-12-05 16:41 ` [PULL 02/14] gitlab: drop explicit pxe-test from the build-tci job Alex Bennée
2025-12-05 16:41 ` [PULL 03/14] gitlab-ci.d/cirrus: Update the FreeBSD job to v14.3 Alex Bennée
2025-12-05 16:41 ` [PULL 04/14] tests/tcg: honour the available QEMU binaries when running check-tcg Alex Bennée
2025-12-05 16:41 ` [PULL 05/14] tests/qemu-iotests: Check for a functional "secret" object before using it Alex Bennée
2025-12-05 16:41 ` [PULL 06/14] tests/lcitool: add bzip2 to the minimal dependency list Alex Bennée
2025-12-05 16:41 ` [PULL 07/14] tests/docker: transition debian-all-test-cross to lcitool Alex Bennée
2025-12-05 16:41 ` [PULL 08/14] tests/docker: drop --disable-[tools|system] from all-test-cross Alex Bennée
2025-12-05 16:41 ` [PULL 09/14] docs/devel: update build environment setup documentation Alex Bennée
2025-12-05 16:41 ` [PULL 10/14] docs/devel: Correct typo Alex Bennée
2025-12-05 16:41 ` [PULL 11/14] MAINTAINERS: update the custom runner entries Alex Bennée
2025-12-05 16:41 ` Alex Bennée [this message]
2025-12-05 16:41 ` [PULL 13/14] contrib/plugins/uftrace_symbols.py: unbreak --no-prefix-symbols Alex Bennée
2025-12-05 16:41 ` [PULL 14/14] aspeed: Deprecate the fby35 machine Alex Bennée
2025-12-05 20:54 ` [PULL 00/14] Final fixes for 10.2 (gitlab, testing, docker, docs, plugins) Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251205164125.2122504-13-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --cc=neither@nut.email \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).