From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PULL 09/31] tcg: Clear plugin_mem_cbs on TB exit
Date: Sat, 18 Mar 2023 11:46:22 +0000 [thread overview]
Message-ID: <20230318114644.1340899-10-alex.bennee@linaro.org> (raw)
In-Reply-To: <20230318114644.1340899-1-alex.bennee@linaro.org>
From: Richard Henderson <richard.henderson@linaro.org>
Do this in cpu_tb_exec (normal exit) and cpu_loop_exit (exception),
adjacent to where we reset can_do_io.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1381
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230310195252.210956-2-richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230315174331.2959-12-alex.bennee@linaro.org>
diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
index c7bc8c6efa..176ea57281 100644
--- a/accel/tcg/cpu-exec-common.c
+++ b/accel/tcg/cpu-exec-common.c
@@ -65,6 +65,8 @@ void cpu_loop_exit(CPUState *cpu)
{
/* Undo the setting in cpu_tb_exec. */
cpu->can_do_io = 1;
+ /* Undo any setting in generated code. */
+ qemu_plugin_disable_mem_helpers(cpu);
siglongjmp(cpu->jmp_env, 1);
}
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 56aaf58b9d..c815f2dbfd 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -459,6 +459,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit)
qemu_thread_jit_execute();
ret = tcg_qemu_tb_exec(env, tb_ptr);
cpu->can_do_io = 1;
+ qemu_plugin_disable_mem_helpers(cpu);
/*
* TODO: Delay swapping back to the read-write region of the TB
* until we actually need to modify the TB. The read-only copy,
@@ -526,7 +527,6 @@ static void cpu_exec_exit(CPUState *cpu)
if (cc->tcg_ops->cpu_exec_exit) {
cc->tcg_ops->cpu_exec_exit(cpu);
}
- QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
}
void cpu_exec_step_atomic(CPUState *cpu)
@@ -580,7 +580,6 @@ void cpu_exec_step_atomic(CPUState *cpu)
qemu_mutex_unlock_iothread();
}
assert_no_pages_locked();
- qemu_plugin_disable_mem_helpers(cpu);
}
/*
@@ -1004,7 +1003,6 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc)
cpu_loop_exec_tb(cpu, tb, pc, &last_tb, &tb_exit);
- QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
/* Try to align the host and virtual clocks
if the guest is in advance */
align_clocks(sc, cpu);
@@ -1029,7 +1027,6 @@ static int cpu_exec_setjmp(CPUState *cpu, SyncClocks *sc)
if (qemu_mutex_iothread_locked()) {
qemu_mutex_unlock_iothread();
}
- qemu_plugin_disable_mem_helpers(cpu);
assert_no_pages_locked();
}
--
2.39.2
next prev parent reply other threads:[~2023-03-18 11:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-18 11:46 [PULL 00/31] various fixes (testing, plugins, gitdm) Alex Bennée
2023-03-18 11:46 ` [PULL 01/31] tests/avocado: update AArch64 tests to Alpine 3.17.2 Alex Bennée
2023-03-18 11:46 ` [PULL 02/31] tests/docker: all add DOCKER_BUILDKIT to RUNC environment Alex Bennée
2023-03-18 11:46 ` [PULL 03/31] scripts/ci: add libslirp-devel to build-environment Alex Bennée
2023-03-18 11:46 ` [PULL 04/31] scripts/ci: update gitlab-runner playbook to handle CentOS Alex Bennée
2023-03-18 11:46 ` [PULL 05/31] gitlab: update centos-8-stream job Alex Bennée
2023-03-20 14:44 ` Philippe Mathieu-Daudé
2023-03-20 17:11 ` Alex Bennée
2023-03-18 11:46 ` [PULL 06/31] include/qemu: add documentation for memory callbacks Alex Bennée
2023-03-18 11:46 ` [PULL 07/31] tests/tcg: add some help output for running individual tests Alex Bennée
2023-03-18 11:46 ` [PULL 08/31] tests/avocado: don't use tags to define drive Alex Bennée
2023-03-18 11:46 ` Alex Bennée [this message]
2023-03-18 11:46 ` [PULL 10/31] tcg: Drop plugin_gen_disable_mem_helpers from tcg_gen_exit_tb Alex Bennée
2023-03-18 11:46 ` [PULL 11/31] include/qemu/plugin: Remove QEMU_PLUGIN_ASSERT Alex Bennée
2023-03-20 13:42 ` [PULL 00/31] various fixes (testing, plugins, gitdm) Peter Maydell
2023-03-20 14:15 ` Daniel P. Berrangé
2023-03-20 14:43 ` Philippe Mathieu-Daudé
2023-03-20 14:56 ` Daniel P. Berrangé
2023-03-20 15:00 ` Philippe Mathieu-Daudé
2023-03-22 12:47 ` Daniel P. Berrangé
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=20230318114644.1340899-10-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).