diff mbox

[RFC,V7,18/19] mttcg: signal the associated cpu anyway.

Message ID 1439220437-23957-19-git-send-email-fred.konrad@greensocs.com
State New
Headers show

Commit Message

fred.konrad@greensocs.com Aug. 10, 2015, 3:27 p.m. UTC
From: KONRAD Frederic <fred.konrad@greensocs.com>

We might have a race here. If current_cpu is about to be set then cpu_exit won't
be called and we don't exit TCG. This was probably an issue with old
implementation as well.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
 cpus.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Paolo Bonzini Aug. 10, 2015, 3:51 p.m. UTC | #1
On 10/08/2015 17:27, fred.konrad@greensocs.com wrote:
> diff --git a/cpus.c b/cpus.c
> index 2c5ca72..f61530c 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -674,8 +674,7 @@ static void cpu_signal(int sig)
>          cpu_exit(current_cpu);
>      }
>  
> -    /* FIXME: We might want to check if the cpu is running? */
> -    tcg_thread_cpu->exit_request = true;
> +    cpu_exit(tcg_thread_cpu);

If you do this, you can remove the first "if" too, because current_cpu
is always either tcg_thread_cpu or NULL.

I think it's okay to do that and squash this patch into patch 11 as well.

Paolo
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index 2c5ca72..f61530c 100644
--- a/cpus.c
+++ b/cpus.c
@@ -674,8 +674,7 @@  static void cpu_signal(int sig)
         cpu_exit(current_cpu);
     }
 
-    /* FIXME: We might want to check if the cpu is running? */
-    tcg_thread_cpu->exit_request = true;
+    cpu_exit(tcg_thread_cpu);
 }
 
 #ifdef CONFIG_LINUX