x86: Fix 16889:60bb765b25b5 in a couple of respects:
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jan 2008 09:36:37 +0000 (09:36 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jan 2008 09:36:37 +0000 (09:36 +0000)
 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>
xen/arch/x86/acpi/boot.c
xen/arch/x86/mm.c

index 7db32263c115fc39c0b39ba8a04643dc6844d996..24939059fbe578e55e641f141fdda270d4695315 100644 (file)
@@ -110,7 +110,8 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
        unsigned long base, offset, mapped_size;
        int idx;
 
-       if (phys + size < 8 * 1024 * 1024)
+       /* XEN: RAM holes above 1MB are not permanently mapped. */
+       if (phys + size < 1 * 1024 * 1024)
                return __va(phys);
 
        offset = phys & (PAGE_SIZE - 1);
index 0b59d7a3c21bf39c04a91ba24bb0c3e5ddb78c07..0b0e8c1d9430adbdb3fcfbc5379431822c6f03a9 100644 (file)
@@ -207,7 +207,7 @@ void __init arch_init_memory(void)
 {
     extern void subarch_init_memory(void);
 
-    unsigned long i, pfn, rstart_pfn, rend_pfn, ioend_pfn;
+    unsigned long i, pfn, rstart_pfn, rend_pfn, iostart_pfn, ioend_pfn;
 
     /*
      * Initialise our DOMID_XEN domain.
@@ -252,17 +252,18 @@ void __init arch_init_memory(void)
         }
 
         /*
-         * Make sure any Xen mappings are blown away.
+         * Make sure any Xen mappings of RAM holes above 1MB are blown away.
          * In particular this ensures that RAM holes are respected even in
-         * the statically-initialised 0-16MB mapping area.
+         * the statically-initialised 1-16MB mapping area.
          */
+        iostart_pfn = max_t(unsigned long, pfn, 1UL << (20 - PAGE_SHIFT));
         ioend_pfn = rstart_pfn;
 #if defined(CONFIG_X86_32)
         ioend_pfn = min_t(unsigned long, ioend_pfn,
                           DIRECTMAP_MBYTES << (20 - PAGE_SHIFT));
 #endif
-        if ( pfn < ioend_pfn )            
-            destroy_xen_mappings((unsigned long)mfn_to_virt(pfn),
+        if ( iostart_pfn < ioend_pfn )            
+            destroy_xen_mappings((unsigned long)mfn_to_virt(iostart_pfn),
                                  (unsigned long)mfn_to_virt(ioend_pfn));
 
         /* Mark as I/O up to next RAM region. */