Re: [PATCH 0/4] memblock related fixes for -tip

H. Peter Anvin
2010-10-13T23:19:19Z

On 10/13/2010 04:14 PM, Jeremy Fitzhardinge wrote:
>
> The Xen code is setting the max_pfn_mapped correctly, but it is just
> being overridden by:
>
> max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
>
> in setup_arch() - and KERNEL_IMAGE_SIZE is hard-coded to 512MB...
>
> How is this correct? Does kernel/head_64.S map everything up to 512MB
> or something?
>

Yes:
/*
* 512 MB kernel mapping. We spend a full page on this pagetable
* anyway.
*
* The kernel code+data+bss must not be bigger than that.
*
* (NOTE: at +512MB starts the module area, see MODULES_VADDR.
* If you want to increase this then increase MODULES_VADDR
* too.)
*/
PMDS(0, __PAGE_KERNEL_LARGE_EXEC,
KERNEL_IMAGE_SIZE/PMD_SIZE)

This is, however, wrong in the sense that it obviously shouldn't be
getting executed on the Xen codepath.

-hpa