Re: [PATCH -v3 0/7] x86: Use BRK to pre mapping page table to makexen happy

From: Yinghai Lu
Date: Thu Oct 18 2012 - 16:43:34 EST

On Thu, Oct 18, 2012 at 9:17 AM, Stefano Stabellini
<stefano.stabellini@xxxxxxxxxxxxx> wrote:
> I find that patch series are easier to review than having to checkout
> your code and read the commit messages. Please post your patch series to
> the LKML next time.

ok, will post -v5 to the list.

> In any case, regarding "x86, xen: Add xen_mapping_mark_page_ro": please
> take Peter's feedback into account; mark_page_ro is not a good name for
> a pvops.
> Also I don't believe that this call is actually needed, see below.
> Regarding "x86, mm: setup page table in top-down": if you mark the
> pagetable page RO in alloc_low_page, won't the entire thing crash as
> soon as you try to write to it? You are supposed to mark it RO after
> filling up the pagetable page and before hooking it into the live
> pagetable.
> However contrary to my expectations, I did a quick test and it seems to
> be working, that is probably due to a bug: maybe __pa or lookup_address
> don't work correctly when called so early?
> In any case we don't care about that because if we assume that
> alloc_low_pages will always return a page from a range that is already
> mapped, then we do not need this pvop anymore. That's because
> xen_alloc_pte_init, xen_alloc_pmd_init, etc, will mark the page RO
> before hooking it into the pagetable automatically.
> Sorry for I misled you last time.

yeah, I was confused how xen could RO page for page table.

> Let me repeat it again:
> Can we assume that the page returned by alloc_low_pages is already mapped?
> Yes? In that case let's get rid of mark_page_ro and everything should
> work.

yes, removed.

> It is worth stating it in clear letters in a comment on top of
> alloc_low_pages:
> "This function always returns a page from a memory range already
> mapped."

actually alloc_... should be always return mapped.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at