[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 3/3] x86: move memblock_x86_reserve_range PGTABLE to find_early_table_space



From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

Now that find_early_table_space knows how to calculate the exact amout
of memory needed by the kernel pagetable, we can reserve the range
directly in find_early_table_space.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 arch/x86/mm/init.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 15590fd..36bacfe 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -104,6 +104,10 @@ static void __init find_early_table_space(unsigned long 
start,
 
        printk(KERN_DEBUG "kernel direct mapping tables up to %lx @ %lx-%lx\n",
                end, pgt_buf_start << PAGE_SHIFT, pgt_buf_top << PAGE_SHIFT);
+
+       if (pgt_buf_top > pgt_buf_start)
+               memblock_x86_reserve_range(pgt_buf_start << PAGE_SHIFT,
+                                pgt_buf_top << PAGE_SHIFT, "PGTABLE");
 }
 
 struct map_range {
@@ -301,10 +305,6 @@ unsigned long __init_refok init_memory_mapping(unsigned 
long start,
                printk(KERN_DEBUG "initial kernel pagetable allocation wasted 
%lx"
                                " pages\n", pgt_buf_top - pgt_buf_end);
 
-       if (!after_bootmem && pgt_buf_end > pgt_buf_start)
-               memblock_x86_reserve_range(pgt_buf_start << PAGE_SHIFT,
-                                pgt_buf_end << PAGE_SHIFT, "PGTABLE");
-
        if (!after_bootmem)
                early_memtest(start, end);
 
-- 
1.7.2.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.