[PATCH v3 2/2] cpu: ensure we don't call start_exclusive from cpu_exec

Pierrick Bouvier posted 2 patches 4 weeks ago
[PATCH v3 2/2] cpu: ensure we don't call start_exclusive from cpu_exec
Posted by Pierrick Bouvier 4 weeks ago
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 cpu-common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cpu-common.c b/cpu-common.c
index 6b262233a3b..0d607bbe493 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->running);
+
     if (current_cpu->exclusive_context_count) {
         current_cpu->exclusive_context_count++;
         return;
-- 
2.39.5
Re: [PATCH v3 2/2] cpu: ensure we don't call start_exclusive from cpu_exec
Posted by Philippe Mathieu-Daudé 4 weeks ago
On 25/10/24 14:58, Pierrick Bouvier wrote:
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   cpu-common.c | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>