Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-12-05 Thread Xiaoyao Li
On 12/5/2024 4:48 PM, Zhao Liu wrote: On Thu, Dec 05, 2024 at 04:05:22PM +0800, Xiaoyao Li wrote: Date: Thu, 5 Dec 2024 16:05:22 +0800 From: Xiaoyao Li Subject: Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup On 12/5/2024 3:30 PM, Zhao Liu wrote: I'm

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-12-05 Thread Zhao Liu
On Thu, Dec 05, 2024 at 04:05:22PM +0800, Xiaoyao Li wrote: > Date: Thu, 5 Dec 2024 16:05:22 +0800 > From: Xiaoyao Li > Subject: Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and > related clearup > > On 12/5/2024 3:30 PM, Zhao Liu wrote: > > I'm

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-12-05 Thread Xiaoyao Li
On 12/5/2024 3:30 PM, Zhao Liu wrote: I'm also very sorry, but I have a slightly different opinion... accel/tcg/user-exec-stub.c | 4 +++ hw/core/cpu-common.c | 2 +- include/hw/core/cpu.h | 8 + system/cpus.c | 6 +++- target/alpha/cpu.c | 2 ++

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-12-04 Thread Zhao Liu
I'm also very sorry, but I have a slightly different opinion... > accel/tcg/user-exec-stub.c | 4 +++ > hw/core/cpu-common.c | 2 +- > include/hw/core/cpu.h | 8 + > system/cpus.c | 6 +++- > target/alpha/cpu.c | 2 ++ > target/arm/cpu.c | 2 ++

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-22 Thread Paolo Bonzini
Il ven 22 nov 2024, 10:44 David Hildenbrand ha scritto: > > I think we can check if qdev_get_machine() gets a valid result. If not, > > fall back to assign nr_cores and nr_threads to 1. > > That sounds reasonable to me. > Another possibility is to add a cpu_realize() function that sets two prope

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-22 Thread David Hildenbrand
On 22.11.24 03:40, Xiaoyao Li wrote: On 11/22/2024 2:52 AM, Paolo Bonzini wrote: On 11/21/24 17:24, Xiaoyao Li wrote: Could it go into cpu_common_initfn()? It can, I think. I'll move them into cpu_common_initfn() in v2 to avoid touching all the ARCHes. It does look better than the alternat

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-21 Thread Xiaoyao Li
On 11/22/2024 2:52 AM, Paolo Bonzini wrote: On 11/21/24 17:24, Xiaoyao Li wrote: Could it go into cpu_common_initfn()? It can, I think. I'll move them into cpu_common_initfn() in v2 to avoid touching all the ARCHes. It does look better than the alternative of duplicating code. On the othe

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-21 Thread Philippe Mathieu-Daudé
On 21/11/24 17:24, Xiaoyao Li wrote: On 11/11/2024 6:49 PM, David Hildenbrand wrote: On 08.11.24 08:06, Xiaoyao Li wrote: This series is extracted from TDX QEMU v6[1] series per Paolo's request. It is originally motivated by x86 TDX to track CPUID_HT in env- >features[] which requires nr_cor

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-21 Thread Paolo Bonzini
On 11/21/24 17:24, Xiaoyao Li wrote: Could it go into cpu_common_initfn()? It can, I think. I'll move them into cpu_common_initfn() in v2 to avoid touching all the ARCHes. It does look better than the alternative of duplicating code. On the other hand qemu_init_vcpu is already duplicated a

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-21 Thread Xiaoyao Li
On 11/11/2024 6:49 PM, David Hildenbrand wrote: On 08.11.24 08:06, Xiaoyao Li wrote: This series is extracted from TDX QEMU v6[1] series per Paolo's request. It is originally motivated by x86 TDX to track CPUID_HT in env- >features[] which requires nr_cores and nr_cores being initialized earl

Re: [PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-11 Thread David Hildenbrand
On 08.11.24 08:06, Xiaoyao Li wrote: This series is extracted from TDX QEMU v6[1] series per Paolo's request. It is originally motivated by x86 TDX to track CPUID_HT in env->features[] which requires nr_cores and nr_cores being initialized earlier than in "and nr_threads" qemu_init_vcpu().

[PATCH v1 0/4] Initialize nr_cores and nr_threads early and related clearup

2024-11-07 Thread Xiaoyao Li
This series is extracted from TDX QEMU v6[1] series per Paolo's request. It is originally motivated by x86 TDX to track CPUID_HT in env->features[] which requires nr_cores and nr_cores being initialized earlier than in qemu_init_vcpu(). Initialize of nr_cores and nr_threads earlier in x86's cpu_r