ia64/xen-unstable

changeset 16926:e23144190f93

x86: Fix 16889:60bb765b25b5 in a couple of respects:
1. Leave bottom-most 1MB permanently mapped.
2. ACPI-table mapping code shoudl be aware that mappings above 1MB of
non-RAM are not permanent.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 29 09:36:37 2008 +0000 (2008-01-29)
parents 01e178f7ec6d
children a4bd1371196e
files xen/arch/x86/acpi/boot.c xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/acpi/boot.c	Mon Jan 28 12:58:57 2008 +0000
     1.2 +++ b/xen/arch/x86/acpi/boot.c	Tue Jan 29 09:36:37 2008 +0000
     1.3 @@ -110,7 +110,8 @@ char *__acpi_map_table(unsigned long phy
     1.4  	unsigned long base, offset, mapped_size;
     1.5  	int idx;
     1.6  
     1.7 -	if (phys + size < 8 * 1024 * 1024)
     1.8 +	/* XEN: RAM holes above 1MB are not permanently mapped. */
     1.9 +	if (phys + size < 1 * 1024 * 1024)
    1.10  		return __va(phys);
    1.11  
    1.12  	offset = phys & (PAGE_SIZE - 1);
     2.1 --- a/xen/arch/x86/mm.c	Mon Jan 28 12:58:57 2008 +0000
     2.2 +++ b/xen/arch/x86/mm.c	Tue Jan 29 09:36:37 2008 +0000
     2.3 @@ -207,7 +207,7 @@ void __init arch_init_memory(void)
     2.4  {
     2.5      extern void subarch_init_memory(void);
     2.6  
     2.7 -    unsigned long i, pfn, rstart_pfn, rend_pfn, ioend_pfn;
     2.8 +    unsigned long i, pfn, rstart_pfn, rend_pfn, iostart_pfn, ioend_pfn;
     2.9  
    2.10      /*
    2.11       * Initialise our DOMID_XEN domain.
    2.12 @@ -252,17 +252,18 @@ void __init arch_init_memory(void)
    2.13          }
    2.14  
    2.15          /*
    2.16 -         * Make sure any Xen mappings are blown away.
    2.17 +         * Make sure any Xen mappings of RAM holes above 1MB are blown away.
    2.18           * In particular this ensures that RAM holes are respected even in
    2.19 -         * the statically-initialised 0-16MB mapping area.
    2.20 +         * the statically-initialised 1-16MB mapping area.
    2.21           */
    2.22 +        iostart_pfn = max_t(unsigned long, pfn, 1UL << (20 - PAGE_SHIFT));
    2.23          ioend_pfn = rstart_pfn;
    2.24  #if defined(CONFIG_X86_32)
    2.25          ioend_pfn = min_t(unsigned long, ioend_pfn,
    2.26                            DIRECTMAP_MBYTES << (20 - PAGE_SHIFT));
    2.27  #endif
    2.28 -        if ( pfn < ioend_pfn )            
    2.29 -            destroy_xen_mappings((unsigned long)mfn_to_virt(pfn),
    2.30 +        if ( iostart_pfn < ioend_pfn )            
    2.31 +            destroy_xen_mappings((unsigned long)mfn_to_virt(iostart_pfn),
    2.32                                   (unsigned long)mfn_to_virt(ioend_pfn));
    2.33  
    2.34          /* Mark as I/O up to next RAM region. */