Re: [RFC] x86/mm/KASLR: Remap GDTs at fixed location
From: Ingo Molnar
Date: Sat Jan 07 2017 - 02:45:53 EST
* Andy Lutomirski <luto@xxxxxxxxxx> wrote:
> > I looked back at the fixmap, and I can see a way it could be done (using
> > NR_CPUS) like the other fixmap ranges. It would limit the number of cpus to
> > 512 (there is 2M memory left on fixmap on the default configuration). That's
> > if we never add any other fixmap on x64. I don't know if it is an acceptable
> > number and if the fixmap region could be increased. (128 if we do your kvm
> > trick, of course).
>
> IIRC we need 4096 CPUs.
On 64-bit the limit is 8192 CPUs, and the SGI guys are relying on that up to the
tune of 6144 cores already, and I'd say the 64-bit CPU count is likely to go up
further with 5-level paging.
On 32-bit the reasonable CPU limit is the number that the Intel 32-bit cluster
computing nodes use. The latest public numbers are I think 36 'tiles' with each
tile being a 2-CPU SMT core - i.e. a limit of 72 CPUs has to be maintained.
(They'll obviously go to 64-bit as well so this problem will go away in a hardware
generation or two.)
So I'd say 128 CPUs on 32-bit should be a reasonable practical limit going
forward. Right now our 32-bit limit is 512 CPUs IIRC, but I don't think any real
hardware in production is reaching that.
> P.S. Let's do the move to the fixmap, read/write as a separate patch. That will
> make bisecting much easier.
Absolutely, but this has to be within the same series, as the interim fixmap-only
step is less secure in some circumstances: we are moving the writable GDT from a
previously randomized location to a fixed location.
Thanks,
Ingo