qemu/cpu-ensure-we-don-t-call-start_exclusive-from-cpu_ex.patch

38 lines
1.2 KiB
Diff
Raw Permalink Normal View History

From c5b349f9ff0792cce72cdd1ade2521c568058a25 Mon Sep 17 00:00:00 2001
From: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
Date: Mon, 18 Nov 2024 14:20:56 -0500
Subject: [PATCH] cpu: ensure we don't call start_exclusive from cpu_exec
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
cheery-pick from 779f30a01af8566780cefc8639505b758950afb3
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20241025175857.2554252-3-pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
---
cpu-common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cpu-common.c b/cpu-common.c
index 54e63b3f77..a949ad7ca3 100644
--- a/cpu-common.c
+++ b/cpu-common.c
@@ -234,6 +234,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->running);
+
if (current_cpu->exclusive_context_count) {
current_cpu->exclusive_context_count++;
return;
--
2.41.0.windows.1