Re: the creation of boot_cpu_init() is wrong and accessinguninitialised data

From: James Bottomley
Date: Mon Jun 26 2006 - 23:35:11 EST


On Mon, 2006-06-26 at 20:04 -0700, Andrew Morton wrote:
> I think arch code should do it before calling start_kernel(), really.
> It's
> just such a basic part of the kernel framework.

Hmm ... well, getting at current_thread_info()->cpu is possible, but
nasty to audit, I would have thought (given that we're in assembler
before start_kernel is called).

> A less wholesome but perhaps simpler solution would be to call the new
> setup_smp_processor_id() on entry to start_kernel().

I was wondering about simply replacing boot_cpu_init() with
smp_prepare_boot_cpu(). By and large they do the same thing on most
archs, and mostly they don't seem to depend on setup_arch() having been
called.

However, introducing setup_smp_processor_id() will also work ... I'll
see if I can do it in an easy way.

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/