diff mbox series

[v2,2/2] cpu: ensure we don't call start_exclusive from cpu_exec

Message ID 20241025175334.2549425-3-pierrick.bouvier@linaro.org (mailing list archive)
State New
Headers show
Series target/i386: fix hang when using slow path for ptw_setl | expand

Commit Message

Pierrick Bouvier Oct. 25, 2024, 5:53 p.m. UTC
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 cpu-common.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/cpu-common.c b/cpu-common.c
index 6b262233a3b..c979138fce9 100644
--- a/cpu-common.c
+++ b/cpu-common.c
@@ -194,6 +194,9 @@  void start_exclusive(void)
     CPUState *other_cpu;
     int running_cpus;
 
+    /* Ensure we are not running, or start_exclusive will be blocked. */
+    g_assert(!current_cpu || !current_cpu->running);
+
     if (current_cpu->exclusive_context_count) {
         current_cpu->exclusive_context_count++;
         return;