aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-09-15 16:32:49 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-10-22 15:57:30 -0400
commit2f7acb208523a3bf5f1830f01c29f7feda045169 (patch)
treec8327359441d761972e456257a01a1fee452f9e8 /arch/x86
parent698bb8d14a5b577b6841acaccdf5095d3b7c7389 (diff)
xen: make sure xen_max_p2m_pfn is up to date
Keep xen_max_p2m_pfn up to date with the end of the extra memory we're adding. It is possible that it will be too high since memory may be truncated by a "mem=" option on the kernel command line, but that won't matter. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/xen/mmu.c8
-rw-r--r--arch/x86/xen/setup.c2
-rw-r--r--arch/x86/xen/xen-ops.h1
3 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 4c63b7f452dd..b2371671b11c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -195,7 +195,7 @@ DEFINE_PER_CPU(unsigned long, xen_current_cr3); /* actual vcpu cr3 */
195 * 512 and 1024 entries respectively. 195 * 512 and 1024 entries respectively.
196 */ 196 */
197 197
198static unsigned long max_p2m_pfn __read_mostly; 198unsigned long xen_max_p2m_pfn __read_mostly;
199 199
200#define P2M_PER_PAGE (PAGE_SIZE / sizeof(unsigned long)) 200#define P2M_PER_PAGE (PAGE_SIZE / sizeof(unsigned long))
201#define P2M_MID_PER_PAGE (PAGE_SIZE / sizeof(unsigned long *)) 201#define P2M_MID_PER_PAGE (PAGE_SIZE / sizeof(unsigned long *))
@@ -293,7 +293,7 @@ void xen_build_mfn_list_list(void)
293 p2m_top_mfn_init(p2m_top_mfn); 293 p2m_top_mfn_init(p2m_top_mfn);
294 } 294 }
295 295
296 for (pfn = 0; pfn < max_p2m_pfn; pfn += P2M_PER_PAGE) { 296 for (pfn = 0; pfn < xen_max_p2m_pfn; pfn += P2M_PER_PAGE) {
297 unsigned topidx = p2m_top_index(pfn); 297 unsigned topidx = p2m_top_index(pfn);
298 unsigned mididx = p2m_mid_index(pfn); 298 unsigned mididx = p2m_mid_index(pfn);
299 unsigned long **mid; 299 unsigned long **mid;
@@ -335,7 +335,7 @@ void xen_setup_mfn_list_list(void)
335 335
336 HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = 336 HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
337 virt_to_mfn(p2m_top_mfn); 337 virt_to_mfn(p2m_top_mfn);
338 HYPERVISOR_shared_info->arch.max_pfn = max_p2m_pfn; 338 HYPERVISOR_shared_info->arch.max_pfn = xen_max_p2m_pfn;
339} 339}
340 340
341/* Set up p2m_top to point to the domain-builder provided p2m pages */ 341/* Set up p2m_top to point to the domain-builder provided p2m pages */
@@ -345,7 +345,7 @@ void __init xen_build_dynamic_phys_to_machine(void)
345 unsigned long max_pfn = min(MAX_DOMAIN_PAGES, xen_start_info->nr_pages); 345 unsigned long max_pfn = min(MAX_DOMAIN_PAGES, xen_start_info->nr_pages);
346 unsigned pfn; 346 unsigned pfn;
347 347
348 max_p2m_pfn = max_pfn; 348 xen_max_p2m_pfn = max_pfn;
349 349
350 p2m_missing = extend_brk(PAGE_SIZE, PAGE_SIZE); 350 p2m_missing = extend_brk(PAGE_SIZE, PAGE_SIZE);
351 p2m_init(p2m_missing); 351 p2m_init(p2m_missing);
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 6c9039e92f81..cad2fcd130ec 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -64,6 +64,8 @@ static __init void xen_add_extra_mem(unsigned long pages)
64 "XEN EXTRA"); 64 "XEN EXTRA");
65 65
66 xen_extra_mem_size += size; 66 xen_extra_mem_size += size;
67
68 xen_max_p2m_pfn = PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size);
67} 69}
68 70
69static unsigned long __init xen_release_chunk(phys_addr_t start_addr, 71static unsigned long __init xen_release_chunk(phys_addr_t start_addr,
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 7c8ab86163e9..d505e98e03f8 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -30,6 +30,7 @@ void xen_setup_machphys_mapping(void);
30pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn); 30pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn);
31void xen_ident_map_ISA(void); 31void xen_ident_map_ISA(void);
32void xen_reserve_top(void); 32void xen_reserve_top(void);
33extern unsigned long xen_max_p2m_pfn;
33 34
34char * __init xen_memory_setup(void); 35char * __init xen_memory_setup(void);
35void __init xen_arch_setup(void); 36void __init xen_arch_setup(void);