Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-11-16 Thread Yinghai Lu
On Fri, Nov 16, 2012 at 9:14 AM, H. Peter Anvin wrote: > On 10/10/2012 10:38 AM, Yinghai Lu wrote: >> attached patch on top of this patch will fix the problem? >> > > .mapping = { > - .pagetable_reserve = native_pagetable_reserve, > + .mark_page_ro

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-11-16 Thread H. Peter Anvin
On 10/10/2012 10:38 AM, Yinghai Lu wrote: On Wed, Oct 10, 2012 at 10:26 AM, Stefano Stabellini wrote: On Wed, 10 Oct 2012, Yinghai Lu wrote: It doesn't matter whether they come from BRK or other memory: Xen assumes that all the pagetable pages come from pgt_buf_start-pgt_buf_top, so if you

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-11-16 Thread H. Peter Anvin
On 10/10/2012 10:38 AM, Yinghai Lu wrote: On Wed, Oct 10, 2012 at 10:26 AM, Stefano Stabellini stefano.stabell...@eu.citrix.com wrote: On Wed, 10 Oct 2012, Yinghai Lu wrote: It doesn't matter whether they come from BRK or other memory: Xen assumes that all the pagetable pages come from

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-11-16 Thread Yinghai Lu
On Fri, Nov 16, 2012 at 9:14 AM, H. Peter Anvin h...@zytor.com wrote: On 10/10/2012 10:38 AM, Yinghai Lu wrote: attached patch on top of this patch will fix the problem? .mapping = { - .pagetable_reserve = native_pagetable_reserve, +

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Yinghai Lu
On Wed, Oct 10, 2012 at 10:26 AM, Stefano Stabellini wrote: > On Wed, 10 Oct 2012, Yinghai Lu wrote: > > It doesn't matter whether they come from BRK or other memory: Xen > assumes that all the pagetable pages come from > pgt_buf_start-pgt_buf_top, so if you are going to use another range you >

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Stefano Stabellini
On Wed, 10 Oct 2012, Yinghai Lu wrote: > On Wed, Oct 10, 2012 at 9:38 AM, Stefano Stabellini > wrote: > >> - if (pfn >= pgt_buf_top) > >> - panic("alloc_low_page: ran out of memory"); > >> + if ((pgt_buf_end + 1) >= pgt_buf_top) { > >> + unsigned long ret; > >> +

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Yinghai Lu
On Wed, Oct 10, 2012 at 9:38 AM, Stefano Stabellini wrote: >> - if (pfn >= pgt_buf_top) >> - panic("alloc_low_page: ran out of memory"); >> + if ((pgt_buf_end + 1) >= pgt_buf_top) { >> + unsigned long ret; >> + if (min_pfn_mapped >= max_pfn_mapped) >> +

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Stefano Stabellini
On Wed, 10 Oct 2012, Yinghai Lu wrote: > Get pgt_buf early from BRK, and use it to map PMD_SIZE to top at first. > then use page from PMD_SIZE to map next blow range. > > alloc_low_page will use page from BRK at first, then will switch to use > to memblock to find and reserve page for page table

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Stefano Stabellini
On Wed, 10 Oct 2012, Yinghai Lu wrote: Get pgt_buf early from BRK, and use it to map PMD_SIZE to top at first. then use page from PMD_SIZE to map next blow range. alloc_low_page will use page from BRK at first, then will switch to use to memblock to find and reserve page for page table

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Yinghai Lu
On Wed, Oct 10, 2012 at 9:38 AM, Stefano Stabellini stefano.stabell...@eu.citrix.com wrote: - if (pfn = pgt_buf_top) - panic(alloc_low_page: ran out of memory); + if ((pgt_buf_end + 1) = pgt_buf_top) { + unsigned long ret; + if (min_pfn_mapped =

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Stefano Stabellini
On Wed, 10 Oct 2012, Yinghai Lu wrote: On Wed, Oct 10, 2012 at 9:38 AM, Stefano Stabellini stefano.stabell...@eu.citrix.com wrote: - if (pfn = pgt_buf_top) - panic(alloc_low_page: ran out of memory); + if ((pgt_buf_end + 1) = pgt_buf_top) { + unsigned long

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-10 Thread Yinghai Lu
On Wed, Oct 10, 2012 at 10:26 AM, Stefano Stabellini stefano.stabell...@eu.citrix.com wrote: On Wed, 10 Oct 2012, Yinghai Lu wrote: It doesn't matter whether they come from BRK or other memory: Xen assumes that all the pagetable pages come from pgt_buf_start-pgt_buf_top, so if you are going

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-09 Thread Yinghai Lu
On Tue, Oct 9, 2012 at 4:58 PM, Yinghai Lu wrote: > Get pgt_buf early from BRK, and use it to map PMD_SIZE to top at first. > then use page from PMD_SIZE to map next blow range. > > alloc_low_page will use page from BRK at first, then will switch to use > to memblock to find and reserve page for

[PATCH 6/7] x86, mm: setup page table from top-down

2012-10-09 Thread Yinghai Lu
Get pgt_buf early from BRK, and use it to map PMD_SIZE to top at first. then use page from PMD_SIZE to map next blow range. alloc_low_page will use page from BRK at first, then will switch to use to memblock to find and reserve page for page table usage. At last we could get rid of calculation

[PATCH 6/7] x86, mm: setup page table from top-down

2012-10-09 Thread Yinghai Lu
Get pgt_buf early from BRK, and use it to map PMD_SIZE to top at first. then use page from PMD_SIZE to map next blow range. alloc_low_page will use page from BRK at first, then will switch to use to memblock to find and reserve page for page table usage. At last we could get rid of calculation

Re: [PATCH 6/7] x86, mm: setup page table from top-down

2012-10-09 Thread Yinghai Lu
On Tue, Oct 9, 2012 at 4:58 PM, Yinghai Lu ying...@kernel.org wrote: Get pgt_buf early from BRK, and use it to map PMD_SIZE to top at first. then use page from PMD_SIZE to map next blow range. alloc_low_page will use page from BRK at first, then will switch to use to memblock to find and