Re: [PATCH v6 00/27] x86, boot, 64bit: Add support for loadingramdisk and bzImage above 4G

From: Konrad Rzeszutek Wilk
Date: Fri Dec 21 2012 - 17:38:33 EST


On Thu, Dec 13, 2012 at 03:47:36PM -0800, H. Peter Anvin wrote:
> There are obviously good bits to this patchset, but I'm really
> starting to think the "pseudo-linear mode" via a trap handler --
> meaning we can access all of memory without any extra effort --
> makes more sense. In fact, that way we could just build the full
> page tables without worrying about incremental bootstrap, depending
> on if that is a complexity win or not.
>
> Either way, this is for native only: the Xen domain builder or other
> similar entry paths should be setting up page tables that cover all
> of memory; I'm hoping Konrad and Stefano can confirm this.

We do setup __ka space for everything everything we need to a fault.

Prior to 3.5 we could have blown over to the MODULES_SPACE if the guest
was booted with more than 128GB. That is now fixed so most of the
space _after_ the ramdisk in the __ka space can be blown away
and we use __va. We do this "cleanup" in xen_pagetable_init stage.


Which works as a long as cleanup_highmap only cleans up to
max_pfn_mapped (which in Xen case covers up to the RAMdisk).

The layout of __ka space is as follow:

kernel
ramdisk
an array called P2M for which we use __ka address until xen_pagetable_init
at which point we blow away any __ka entries for it.
start_info (we swap over to use __va before generic code is run).
the initial page-tables (for which the kernel uses __va address). we blow
away the __ka entries when xen_pagetable_init is called.

This __ka cleanup business was done for 64-bit only as the 32-bit
code scared me.


Hm, why that function is called xen_pagetable_init seems a bit silly.
>
> The only reason to go with another approach I can think of is if it
> makes 32/64-bit unification cleaner.
>
> -hpa
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/