x86_32: Calculate additional memory needed by the fixmap
When NR_CPUS increases the fixmap might need more than the page
allocated by head_32.S.
This patch introduces the logic to calculate the additional memory that
is going to be required by early_ioremap_page_table_range_init:
- enough memory to allocate the pte pages needed to cover the fixmap
virtual memory range, minus the single page allocated by head_32.S;
- account for the page already allocated by early_ioremap_init;
- account for the two additional pages that might be needed to make sure
that the kmap's ptes are contiguous.
Changes to v1:
- refactor the fixmap space calculation in a new function to make it
easier to read and avoid compilation warnings on x86_64.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Link: http://lkml.kernel.org/r/1311178074-16833-1-git-send-email-stefano.stabellini@eu.citrix.com
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reported-and-Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>