On 31.08.2017 16:04, Igor Mammedov wrote: > On Thu, 31 Aug 2017 15:44:38 +0200 > David Hildenbrand <da...@redhat.com> 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