ia64/xen-unstable
changeset 7548:ab0addb6dcbb
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@xensource.com>
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@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Fri Oct 28 17:11:59 2005 +0100 (2005-10-28) |
parents | f5de9429118c |
children | d25ac5cbd8d3 |
files | linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c |
line diff
1.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c Fri Oct 28 16:41:11 2005 +0100 1.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c Fri Oct 28 17:11:59 2005 +0100 1.3 @@ -733,6 +733,7 @@ void __init setup_arch(char **cmdline_p) 1.4 #ifdef CONFIG_XEN 1.5 { 1.6 int i, j, k, fpp; 1.7 + unsigned long va; 1.8 1.9 /* Make sure we have a large enough P->M table. */ 1.10 phys_to_machine_mapping = alloc_bootmem( 1.11 @@ -746,9 +747,21 @@ void __init setup_arch(char **cmdline_p) 1.12 __pa(xen_start_info->mfn_list), 1.13 PFN_PHYS(PFN_UP(xen_start_info->nr_pages * 1.14 sizeof(unsigned long)))); 1.15 - make_pages_readonly((void *)xen_start_info->mfn_list, 1.16 - PFN_UP(xen_start_info->nr_pages * 1.17 - sizeof(unsigned long))); 1.18 + 1.19 + /* 'Initial mapping' of old p2m table must be destroyed. */ 1.20 + for (va = xen_start_info->mfn_list; 1.21 + va < (xen_start_info->mfn_list + 1.22 + (xen_start_info->nr_pages*sizeof(unsigned long))); 1.23 + va += PAGE_SIZE) { 1.24 + HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0); 1.25 + } 1.26 + 1.27 + /* 'Initial mapping' of initrd must be destroyed. */ 1.28 + for (va = xen_start_info->mod_start; 1.29 + va < (xen_start_info->mod_start+xen_start_info->mod_len); 1.30 + va += PAGE_SIZE) { 1.31 + HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0); 1.32 + } 1.33 1.34 /* 1.35 * Initialise the list of the frames that specify the list of