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

[Xen-changelog] Clean up the 'initial mapping' area properly on x86/64.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID ab0addb6dcbb4f35010951b6ade59791eb3d9129
# Parent  f5de9429118c661a7f6707d397758d81f1786f22
Clean up the 'initial mapping' area properly on x86/64.
We must completely blow away mappings of the original
p2m table and the initrd. Those areas eventually get freed
to the memory allocator and other uses of that memory will
get really confused by spurious redundant mappings in the 
init mapping area.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r f5de9429118c -r ab0addb6dcbb 
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c       Fri Oct 28 
15:41:11 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c       Fri Oct 28 
16:11:59 2005
@@ -733,6 +733,7 @@
 #ifdef CONFIG_XEN
        {
                int i, j, k, fpp;
+               unsigned long va;
 
                /* Make sure we have a large enough P->M table. */
                phys_to_machine_mapping = alloc_bootmem(
@@ -746,9 +747,21 @@
                        __pa(xen_start_info->mfn_list), 
                        PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
                                        sizeof(unsigned long))));
-               make_pages_readonly((void *)xen_start_info->mfn_list,
-                                   PFN_UP(xen_start_info->nr_pages *
-                                          sizeof(unsigned long)));
+
+               /* 'Initial mapping' of old p2m table must be destroyed. */
+               for (va = xen_start_info->mfn_list;
+                    va < (xen_start_info->mfn_list +
+                          (xen_start_info->nr_pages*sizeof(unsigned long)));
+                    va += PAGE_SIZE) {
+                       HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
+               }
+
+               /* 'Initial mapping' of initrd must be destroyed. */
+               for (va = xen_start_info->mod_start;
+                    va < (xen_start_info->mod_start+xen_start_info->mod_len);
+                    va += PAGE_SIZE) {
+                       HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
+               }
 
                /* 
                 * Initialise the list of the frames that specify the list of 

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


 


Rackspace

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