lkml.org 
[lkml]   [2011]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: "x86-64, mm: Put early page table high" causes crash on Xen
On Tue, 8 Mar 2011, Yinghai Lu wrote:
> On Tue, Mar 8, 2011 at 4:14 AM, Stefano Stabellini
> <stefano.stabellini@eu.citrix.com> wrote:
> >> > [    0.000000] DEBUG alloc low page(cf965000, 00001000)
> >>
> >> these are not mapped yet, and need to use early_ioremap.
> >
> > In fact we are mapping them inside alloc_low_page. No need for
> > map_low_page, right?
>
> alloc_low_page return virtual address, but it can not be used to
> access that position right away.
> so in that case map_low_page is used to convert that virtual address
> to phy address and then to early map address.

Are you sure?
I am looking at this piece of code under kernel_physical_mapping_init:


---
pud = alloc_low_page(&pud_phys);
last_map_addr = phys_pud_init(pud, __pa(start), __pa(next),
page_size_mask);
unmap_low_page(pud);
---

and the implementaion of alloc_low_page is:

---
static __ref void *alloc_low_page(unsigned long *phys)
{
unsigned long pfn = pgt_buf_end++;
void *adr;

if (after_bootmem) {
adr = (void *)get_zeroed_page(GFP_ATOMIC | __GFP_NOTRACK);
*phys = __pa(adr);

return adr;
}

if (pfn >= pgt_buf_top)
panic("alloc_low_page: ran out of memory");

adr = early_memremap(pfn * PAGE_SIZE, PAGE_SIZE);
clear_page(adr);
*phys = pfn * PAGE_SIZE;
return adr;
}
---

It looks to me that map_low_page is never called in this code path.
If I read the code correctly map_low_page is only used to map pagetable
pages that are already mapped (see the debug logging I posted in the
previous email) so it is not useful.
\
 
 \ /
  Last update: 2011-03-08 18:43    [W:0.058 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site