[PATCH 5/8] cpus: remove TCG-ism from cpu_exit()

Paolo Bonzini posted 8 patches 4 weeks ago
There is a newer version of this series
[PATCH 5/8] cpus: remove TCG-ism from cpu_exit()
Posted by Paolo Bonzini 4 weeks ago
Now that TCG has its own kick function, make cpu_exit() do the right kick
for all accelerators.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/core/cpu-common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index f189ce861c9..045b1778236 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -86,9 +86,7 @@ void cpu_exit(CPUState *cpu)
 {
     /* Ensure cpu_exec will see the reason why the exit request was set.  */
     qatomic_store_release(&cpu->exit_request, 1);
-    /* Ensure cpu_exec will see the exit request after TCG has exited.  */
-    smp_wmb();
-    qatomic_set(&cpu->neg.icount_decr.u16.high, -1);
+    qemu_cpu_kick(cpu);
 }
 
 static int cpu_common_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg)
-- 
2.50.1
Re: [PATCH 5/8] cpus: remove TCG-ism from cpu_exit()
Posted by Richard Henderson 3 weeks, 6 days ago
On 8/9/25 04:59, Paolo Bonzini wrote:
> Now that TCG has its own kick function, make cpu_exit() do the right kick
> for all accelerators.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   hw/core/cpu-common.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
> index f189ce861c9..045b1778236 100644
> --- a/hw/core/cpu-common.c
> +++ b/hw/core/cpu-common.c
> @@ -86,9 +86,7 @@ void cpu_exit(CPUState *cpu)
>   {
>       /* Ensure cpu_exec will see the reason why the exit request was set.  */
>       qatomic_store_release(&cpu->exit_request, 1);
> -    /* Ensure cpu_exec will see the exit request after TCG has exited.  */
> -    smp_wmb();
> -    qatomic_set(&cpu->neg.icount_decr.u16.high, -1);
> +    qemu_cpu_kick(cpu);
>   }
>   
>   static int cpu_common_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Re: [PATCH 5/8] cpus: remove TCG-ism from cpu_exit()
Posted by Philippe Mathieu-Daudé 4 weeks ago
On 8/8/25 20:59, Paolo Bonzini wrote:
> Now that TCG has its own kick function, make cpu_exit() do the right kick
> for all accelerators.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   hw/core/cpu-common.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)

Thanks!

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