[lkml]   [2011]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: "x86-64, mm: Put early page table high" causes crash on Xen
On Wed, 2 Mar 2011, Konrad Rzeszutek Wilk wrote:
> On Wed, Mar 02, 2011 at 03:23:48PM +0000, Stefano Stabellini wrote:
> > On Tue, 1 Mar 2011, Yinghai Lu wrote:
> > > We do need map_low_page ( BTW, that name is totally misleading...)
> > >
> > > the reason is we put page_table high and at that time is not under max_pfn_mapped. (aka not mapped).
> > >
> > > So have to use
> > > adr = early_memremap(phys & PAGE_MASK, PAGE_SIZE);
> > > to early map it and Read/Write to it.
> >
> > I think I have figured out a way to update the logic of mask_rw_pte to
> > account for the new way of allocating kernel pagetables.
> > The appended patch fix the boot crash for me.
> >
> > ---
> >
> > xen: update mask_rw_pte after kernel page tables init changes
> >
> > Already existing kernel page table pages can now be mapped using
> > early_ioremap too so we need to update mask_rw_pte to make sure these
> > pages are still mapped RO.
> > We do that by mapping RO all the pages mapped using early_ioremap apart
> > from the last one that has been allocated because it is not a page table
> > page yet (it has been hooked into the page tables yet).
> ^- has not?
> ..this is b/c the initial_kernel_mapping and its family of calls update
> the pgt_buf_end (used to be called e820_table_end), _before__
> it calls the Xen MMU to set the PTE entries and then after it is done
> update the PMD?. Hence the simple check to see if the PFN is the _old_
> value of the pgt_buf_end and if so skip altering the mapping from RW to RO
> and leave them be?

yes and yes

> On subsequent passes we fall within the first conditional
> and update the PTE to RO?
> When is that pass done?

kernel_physical_mapping_init doesn't go through the same pagetable
pages twice so that is not the issue.
The problem is that kernel_physical_mapping_init is now re-mapping all
the initial pagetable pages using early_ioremap, so the usage of
early_ioremap is not enough anymore to distinguish between freshly
allocated page table pages and already hooked pagetable pages.
I am investigating the possibility that the introduction of map_low_page
is actually overkill for this reason.

> You also might want to mention the git commits that inspired this patch
> and include the nice description you provided in the first email of this
> thread.


 \ /
  Last update: 2011-03-07 17:11    [W:0.048 / U:0.428 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site