ia64/xen-unstable
changeset 16889:c360bb765b25
x86: Ensure RAM holes really are not mapped in Xen's ongoing 1:1 physmap.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Jan 25 16:26:31 2008 +0000 (2008-01-25) |
parents | 76601c290fa9 |
children | c2216dce87fb |
files | xen/arch/x86/mm.c |
line diff
1.1 --- a/xen/arch/x86/mm.c Fri Jan 25 16:02:20 2008 +0000 1.2 +++ b/xen/arch/x86/mm.c Fri Jan 25 16:26:31 2008 +0000 1.3 @@ -207,7 +207,7 @@ void __init arch_init_memory(void) 1.4 { 1.5 extern void subarch_init_memory(void); 1.6 1.7 - unsigned long i, pfn, rstart_pfn, rend_pfn; 1.8 + unsigned long i, pfn, rstart_pfn, rend_pfn, ioend_pfn; 1.9 1.10 /* 1.11 * Initialise our DOMID_XEN domain. 1.12 @@ -251,6 +251,20 @@ void __init arch_init_memory(void) 1.13 PFN_DOWN(e820.map[i].addr + e820.map[i].size)); 1.14 } 1.15 1.16 + /* 1.17 + * Make sure any Xen mappings are blown away. 1.18 + * In particular this ensures that RAM holes are respected even in 1.19 + * the statically-initialised 0-16MB mapping area. 1.20 + */ 1.21 + ioend_pfn = rstart_pfn; 1.22 +#if defined(CONFIG_X86_32) 1.23 + ioend_pfn = min_t(unsigned long, ioend_pfn, 1.24 + DIRECTMAP_MBYTES << (20 - PAGE_SHIFT)); 1.25 +#endif 1.26 + if ( pfn < ioend_pfn ) 1.27 + destroy_xen_mappings((unsigned long)mfn_to_virt(pfn), 1.28 + (unsigned long)mfn_to_virt(ioend_pfn)); 1.29 + 1.30 /* Mark as I/O up to next RAM region. */ 1.31 for ( ; pfn < rstart_pfn; pfn++ ) 1.32 { 1.33 @@ -3901,13 +3915,13 @@ void destroy_xen_mappings(unsigned long 1.34 { 1.35 /* Empty: zap the L2E and free the L1 page. */ 1.36 l2e_write_atomic(pl2e, l2e_empty()); 1.37 - flush_all(FLUSH_TLB_GLOBAL); /* flush before free */ 1.38 + flush_area(NULL, FLUSH_TLB_GLOBAL); /* flush before free */ 1.39 free_xen_pagetable(pl1e); 1.40 } 1.41 } 1.42 } 1.43 1.44 - flush_all(FLUSH_TLB_GLOBAL); 1.45 + flush_area(NULL, FLUSH_TLB_GLOBAL); 1.46 } 1.47 1.48 void __set_fixmap(