> As Richard said, we just want to have different GDTs on the different
> processors, so that we wan use the fs segment register to implement TLS
> in the kernel and have per-cpu data cost essentially the same as global
> data.
Yes, but how can I store the relation APIC ID - Kernel ID in the GDT?
Is there any way to avoid using an array for that?
> (I don't mean it has to be implemented so for commiting to mainline,
> just saying how we can optimize after it)
I'm still learning yet, so many concepts are difficult for me.
My idea is to get a basic and functional SMP implementation, and then get help from more experienced developers to improve it.