2009-11-27 09:33:56

by Nikita V. Youshchenko

[permalink] [raw]
Subject: Boot cpu != cpu 0 ?

Hi

How hard it could be to build a system on multi-core arm hardware, that has
linux SMP running in cores other than 0th ?

Say, if bootloader starts kernel on hardware core 1, will kernel be able to
work (and use cores 1,2,3 on 4-core hardware) after some tweaking?
Or "boot cpu" concept is uncouplable from "hardware core 0" by
architecture?

I'm asking because there is a project with a strict requerement to have
core 0 reserved and not touched by linux, and I need to understand how
realistic it is.

Thanks for any hints.

Nikita


2009-11-27 10:33:49

by Andi Kleen

[permalink] [raw]
Subject: Re: Boot cpu != cpu 0 ?

"Nikita V. Youshchenko" <[email protected]> writes:

> How hard it could be to build a system on multi-core arm hardware, that has
> linux SMP running in cores other than 0th ?
>
> Say, if bootloader starts kernel on hardware core 1, will kernel be able to
> work (and use cores 1,2,3 on 4-core hardware) after some tweaking?
> Or "boot cpu" concept is uncouplable from "hardware core 0" by
> architecture?
>
> I'm asking because there is a project with a strict requerement to have
> core 0 reserved and not touched by linux, and I need to understand how
> realistic it is.

You need to be clear what CPU 0 means. It could be "Linux CPU
number 0" That will be always there (it's hard coded), but that's
really only a numbering convention inside a kernel that essentially
says "nth booted CPU"

Then there's the APIC ID, which is the number the CPU hardware
knows about. There's a APIC ID == 0. Linux does not rely
on CPU #0 having APIC ID 0, at least not in principle
(this has regressed occasionally in the past)

The larger problem with sharing cores like this is the memory map --
e.g. you would need to coordinate which kernels owns which hardware
and which memory, which is not trivial without help. The usual way to
do this is to use a VM.

-Andi
--
[email protected] -- Speaking for myself only.