qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.11 v4 08/25] s390x: replace cpu_s390x_init


From: David Hildenbrand
Subject: Re: [Qemu-devel] [PATCH for-2.11 v4 08/25] s390x: replace cpu_s390x_init() with cpu_generic_init()
Date: Thu, 31 Aug 2017 18:20:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 31.08.2017 16:04, Igor Mammedov wrote:
> On Thu, 31 Aug 2017 15:44:38 +0200
> David Hildenbrand <address@hidden> wrote:
> 
>> On 31.08.2017 15:19, Igor Mammedov wrote:
>>> cpu_s390x_init() is used only *-user targets indirectly
>>> via cpu_init() macro and has a hack to assign ids to created
>>> cpus (I'm not sure if 'id' really matters to *-user emulation).  
>>
>> It only has one cpu, right? With the below mentioned patch, the default
>> "id"/ (the cpu_addr) will be 0. So you can create one CPU without any
>> hacks. Or can it create more than 1?
> As I understand it creates only one cpu,
> but then there is fork related cpu_copy() which creates a cpu
> and the rewrites new CPUArchState with old cpu data
> 
>     CPUState *new_cpu = cpu_init(cpu_model);                                  
>    
>     CPUArchState *new_env = new_cpu->env_ptr;                                 
>    
>     ...                                                    
>     memcpy(new_env, env, sizeof(CPUArchState));
> 
> so I couldn't decide if id is of importance for *-user target
> (well, I'm not really interested in *-user), and opted for
> keeping current behavior (i.e. not breaking) in this patch
> just without cpu_s390x_init().
> 
> So if 'id' isn't really needed for  *-user target, hunk 2 could be
> dropped but it ought to be another patch on top as this change isn't
> related to the topic of this patch/series.
>  

Indeed, it seems to create a new cpu for every fork. So this is necessary.

-- 

Thanks,

David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]