Re: [rfc 08/45] cpu alloc: x86 support

H. Peter Anvin
2007-11-20T20:43:46Z

Andi Kleen wrote:
> On Tuesday 20 November 2007 04:50, Christoph Lameter wrote:
>> On Tue, 20 Nov 2007, Andi Kleen wrote:
>>> I might be pointing out the obvious, but on x86-64 there is definitely
>>> not 256TB of VM available for this.
>> Well maybe in the future.
>
> That would either require more than 4 levels or larger pages
> in page tables.
>
>> One of the issues that I ran into is that I had to place the cpu area
>> in between to make the offsets link right.
>
> Above -2GB, otherwise you cannot address them
>

This limitation shouldn't apply to the percpu area, since gs_base can be
pointed anywhere in the address space -- in effect we're always indirect.

Obviously the offsets *within* the percpu area has to be in range (±2 GB
per cpu for absolute offsets, slightly smaller for %rip-based addressing
-- obviously judicious use of an offset for gs_base is essential in the
latter case).

Thus you want the percpu areas below -2 GB where they don't interfere
with modules or any other precious address space.

-hpa