]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
xen: add explicit memblock_reserve() calls for special pages
authorJuergen Gross <jgross@suse.com>
Fri, 17 Jul 2015 04:51:34 +0000 (06:51 +0200)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 6 Aug 2015 13:32:36 +0000 (14:32 +0100)
Some special pages containing interfaces to xen are being reserved
implicitly only today. The memblock_reserve() call to reserve them is
meant to reserve the p2m list supplied by xen. It is just reserving
not only the p2m list itself, but some more pages up to the start of
the xen built page tables.

To be able to move the p2m list to another pfn range, which is needed
for support of huge RAM, this memblock_reserve() must be split up to
cover all affected reserved pages explicitly.

The affected pages are:
- start_info page
- xenstore ring (might be missing, mfn is 0 in this case)
- console ring (not for initial domain)

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/xen/enlighten.c
arch/x86/xen/mmu.c
arch/x86/xen/xen-ops.h

index 0b95c9b8283fe2afe885d9a8ae98393c14ecc498..14d6d3e1abf113bdae52cea6d7597256c7866489 100644 (file)
@@ -1570,7 +1570,9 @@ asmlinkage __visible void __init xen_start_kernel(void)
        early_boot_irqs_disabled = true;
 
        xen_raw_console_write("mapping kernel into physical memory\n");
-       xen_setup_kernel_pagetable((pgd_t *)xen_start_info->pt_base, xen_start_info->nr_pages);
+       xen_setup_kernel_pagetable((pgd_t *)xen_start_info->pt_base,
+                                  xen_start_info->nr_pages);
+       xen_reserve_special_pages();
 
        /*
         * Modify the cache mode translation tables to match Xen's PAT
index 1982617fa9c71e01c17f35a5d9f3063d7b8f51be..a36e7b462640be29f0d60c96ac831c011f181de7 100644 (file)
@@ -2084,6 +2084,21 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 }
 #endif /* CONFIG_X86_64 */
 
+void __init xen_reserve_special_pages(void)
+{
+       phys_addr_t paddr;
+
+       memblock_reserve(__pa(xen_start_info), PAGE_SIZE);
+       if (xen_start_info->store_mfn) {
+               paddr = PFN_PHYS(mfn_to_pfn(xen_start_info->store_mfn));
+               memblock_reserve(paddr, PAGE_SIZE);
+       }
+       if (!xen_initial_domain()) {
+               paddr = PFN_PHYS(mfn_to_pfn(xen_start_info->console.domU.mfn));
+               memblock_reserve(paddr, PAGE_SIZE);
+       }
+}
+
 void __init xen_pt_check_e820(void)
 {
        if (xen_is_e820_reserved(xen_pt_base, xen_pt_size)) {
index e84aa850a6b5883e172c3193fa5ff26d6a1163dc..30c5058f0cd9c930e46ed0ae87d41ae90b359e2e 100644 (file)
@@ -35,6 +35,7 @@ void xen_build_mfn_list_list(void);
 void xen_setup_machphys_mapping(void);
 void xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn);
 void xen_reserve_top(void);
+void __init xen_reserve_special_pages(void);
 void __init xen_pt_check_e820(void);
 
 void xen_mm_pin_all(void);