[PATCH 3/5] cpu-target: don't set cpu->thread_id to bogus value

Alex Bennée posted 5 patches 6 months ago
Maintainers: Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, "Alex Bennée" <alex.bennee@linaro.org>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Reinoud Zandijk <reinoud@netbsd.org>, Sunil Muthuswamy <sunilmut@microsoft.com>
[PATCH 3/5] cpu-target: don't set cpu->thread_id to bogus value
Posted by Alex Bennée 6 months ago
The thread_id isn't valid until the threads are created. There is no
point setting it here. The only thing that cares about the thread_id
is qmp_query_cpus_fast.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 cpu-target.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/cpu-target.c b/cpu-target.c
index 5af120e8aa..499facf774 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -241,7 +241,6 @@ void cpu_exec_initfn(CPUState *cpu)
     cpu->num_ases = 0;
 
 #ifndef CONFIG_USER_ONLY
-    cpu->thread_id = qemu_get_thread_id();
     cpu->memory = get_system_memory();
     object_ref(OBJECT(cpu->memory));
 #endif
-- 
2.39.2


Re: [PATCH 3/5] cpu-target: don't set cpu->thread_id to bogus value
Posted by Philippe Mathieu-Daudé 5 months, 4 weeks ago
On 30/5/24 21:42, Alex Bennée wrote:
> The thread_id isn't valid until the threads are created. There is no
> point setting it here. The only thing that cares about the thread_id
> is qmp_query_cpus_fast.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   cpu-target.c | 1 -
>   1 file changed, 1 deletion(-)

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


Re: [PATCH 3/5] cpu-target: don't set cpu->thread_id to bogus value
Posted by Pierrick Bouvier 6 months ago
On 5/30/24 12:42, Alex Bennée wrote:
> The thread_id isn't valid until the threads are created. There is no
> point setting it here. The only thing that cares about the thread_id
> is qmp_query_cpus_fast.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   cpu-target.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/cpu-target.c b/cpu-target.c
> index 5af120e8aa..499facf774 100644
> --- a/cpu-target.c
> +++ b/cpu-target.c
> @@ -241,7 +241,6 @@ void cpu_exec_initfn(CPUState *cpu)
>       cpu->num_ases = 0;
>   
>   #ifndef CONFIG_USER_ONLY
> -    cpu->thread_id = qemu_get_thread_id();
>       cpu->memory = get_system_memory();
>       object_ref(OBJECT(cpu->memory));
>   #endif

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>