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?
> +#else
> + Error *local_err = NULL;
> +
> + cpu_index = cpu->cpu_index = cpu_get_free_index(&local_err);
> + if (local_err) {
> + error_propagate(errp, local_err);
> + return;
> + }
> +#endif
> cpu->numa_node = 0;
> QTAILQ_INIT(&cpu->breakpoints);
> QTAILQ_INIT(&cpu->watchpoints);
[...]
--
Eduardo