[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v1 PATCH 2/3] cpus: Convert cpu_index into a bitma
From: |
Bharata B Rao |
Subject: |
Re: [Qemu-devel] [RFC v1 PATCH 2/3] cpus: Convert cpu_index into a bitmap |
Date: |
Mon, 11 May 2015 09:07:35 +0530 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, May 08, 2015 at 11:57:40AM -0300, Eduardo Habkost wrote:
> On Fri, May 08, 2015 at 03:21:35PM +0530, Bharata B Rao wrote:
> [...]
> > void cpu_exec_init(CPUArchState *env, Error **errp)
> > {
> > CPUState *cpu = ENV_GET_CPU(env);
> > CPUClass *cc = CPU_GET_CLASS(cpu);
> > - CPUState *some_cpu;
> > int cpu_index;
> > -
> > #if defined(CONFIG_USER_ONLY)
> > + CPUState *some_cpu;
> > +
> > cpu_list_lock();
> > -#endif
> > cpu_index = 0;
> > CPU_FOREACH(some_cpu) {
> > cpu_index++;
> > }
> > cpu->cpu_index = cpu_index;
>
> Why not use the bitmap on CONFIG_USER too?
I was doing like that in v1 and it required me to cook up a max_cpus value
for CONFIG_USER case to define the bitmap.
Andreas pointed out that it is better not to touch the allocation
logic for CONFIG_USER.
https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg03571.html
Regards,
Bharata.
[Qemu-devel] [RFC v1 PATCH 3/3] ppc: Move cpu_exec_init() call to realize function, Bharata B Rao, 2015/05/08