浏览代码

x86: Fix broken VMI in 2.6.27-rc..

The lowmem mapping table created by VMI need not depend on max_low_pfn
at all.  Instead we now create an extra large mapping which covers all
possible lowmem instead of the physical ram that is actually available.

This allows the vmi initialization to be done before max_low_pfn could
be computed. We also move the vmi_init code very early in the boot process
so that nobody accidentally breaks the fixmap dependancy.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Acked-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Alok Kataria 17 年之前
父节点
当前提交
31343d8a50
共有 2 个文件被更改,包括 10 次插入9 次删除
  1. 8 8
      arch/x86/kernel/setup.c
  2. 2 1
      arch/x86/kernel/vmi_32.c

+ 8 - 8
arch/x86/kernel/setup.c

@@ -604,6 +604,14 @@ void __init setup_arch(char **cmdline_p)
 	early_cpu_init();
 	early_cpu_init();
 	early_ioremap_init();
 	early_ioremap_init();
 
 
+#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
+	/*
+	 * Must be before kernel pagetables are setup
+	 * or fixmap area is touched.
+	 */
+	vmi_init();
+#endif
+
 	ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
 	ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
 	screen_info = boot_params.screen_info;
 	screen_info = boot_params.screen_info;
 	edid_info = boot_params.edid_info;
 	edid_info = boot_params.edid_info;
@@ -817,14 +825,6 @@ void __init setup_arch(char **cmdline_p)
 	kvmclock_init();
 	kvmclock_init();
 #endif
 #endif
 
 
-#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
-	/*
-	 * Must be after max_low_pfn is determined, and before kernel
-	 * pagetables are setup.
-	 */
-	vmi_init();
-#endif
-
 	paravirt_pagetable_setup_start(swapper_pg_dir);
 	paravirt_pagetable_setup_start(swapper_pg_dir);
 	paging_init();
 	paging_init();
 	paravirt_pagetable_setup_done(swapper_pg_dir);
 	paravirt_pagetable_setup_done(swapper_pg_dir);

+ 2 - 1
arch/x86/kernel/vmi_32.c

@@ -37,6 +37,7 @@
 #include <asm/timer.h>
 #include <asm/timer.h>
 #include <asm/vmi_time.h>
 #include <asm/vmi_time.h>
 #include <asm/kmap_types.h>
 #include <asm/kmap_types.h>
+#include <asm/setup.h>
 
 
 /* Convenient for calling VMI functions indirectly in the ROM */
 /* Convenient for calling VMI functions indirectly in the ROM */
 typedef u32 __attribute__((regparm(1))) (VROMFUNC)(void);
 typedef u32 __attribute__((regparm(1))) (VROMFUNC)(void);
@@ -683,7 +684,7 @@ void vmi_bringup(void)
 {
 {
  	/* We must establish the lowmem mapping for MMU ops to work */
  	/* We must establish the lowmem mapping for MMU ops to work */
 	if (vmi_ops.set_linear_mapping)
 	if (vmi_ops.set_linear_mapping)
-		vmi_ops.set_linear_mapping(0, (void *)__PAGE_OFFSET, max_low_pfn, 0);
+		vmi_ops.set_linear_mapping(0, (void *)__PAGE_OFFSET, MAXMEM_PFN, 0);
 }
 }
 
 
 /*
 /*