x86: extend e820 early_res support 32bit -fix #3
introduce init_pg_table_start, so xen PV could specify the value. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
3945e2c9ab
commit
f0d43100f1
|
@ -76,7 +76,8 @@ void __init i386_start_kernel(void)
|
||||||
reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
|
reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
reserve_early(__pa_symbol(&_end), init_pg_tables_end, "INIT_PG_TABLE");
|
reserve_early(init_pg_tables_start, init_pg_tables_end,
|
||||||
|
"INIT_PG_TABLE");
|
||||||
|
|
||||||
reserve_ebda_region();
|
reserve_ebda_region();
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,7 @@ default_entry:
|
||||||
xorl %ebx,%ebx /* %ebx is kept at zero */
|
xorl %ebx,%ebx /* %ebx is kept at zero */
|
||||||
|
|
||||||
movl $pa(pg0), %edi
|
movl $pa(pg0), %edi
|
||||||
|
movl %edi, pa(init_pg_tables_start)
|
||||||
movl $pa(swapper_pg_pmd), %edx
|
movl $pa(swapper_pg_pmd), %edx
|
||||||
movl $PTE_ATTR, %eax
|
movl $PTE_ATTR, %eax
|
||||||
10:
|
10:
|
||||||
|
@ -228,6 +229,7 @@ default_entry:
|
||||||
page_pde_offset = (__PAGE_OFFSET >> 20);
|
page_pde_offset = (__PAGE_OFFSET >> 20);
|
||||||
|
|
||||||
movl $pa(pg0), %edi
|
movl $pa(pg0), %edi
|
||||||
|
movl %edi, pa(init_pg_tables_start)
|
||||||
movl $pa(swapper_pg_dir), %edx
|
movl $pa(swapper_pg_dir), %edx
|
||||||
movl $PTE_ATTR, %eax
|
movl $PTE_ATTR, %eax
|
||||||
10:
|
10:
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
/* This value is set up by the early boot code to point to the value
|
/* This value is set up by the early boot code to point to the value
|
||||||
immediately after the boot time page tables. It contains a *physical*
|
immediately after the boot time page tables. It contains a *physical*
|
||||||
address, and must not be in the .bss segment! */
|
address, and must not be in the .bss segment! */
|
||||||
|
unsigned long init_pg_tables_start __initdata = ~0UL;
|
||||||
unsigned long init_pg_tables_end __initdata = ~0UL;
|
unsigned long init_pg_tables_end __initdata = ~0UL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -485,6 +486,10 @@ static void __init reserve_initrd(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printk(KERN_INFO "old RAMDISK: %08llx - %08llx\n", ramdisk_image,
|
||||||
|
ramdisk_end);
|
||||||
|
|
||||||
|
|
||||||
if (ramdisk_end <= end_of_lowmem) {
|
if (ramdisk_end <= end_of_lowmem) {
|
||||||
/* All in lowmem, easy case */
|
/* All in lowmem, easy case */
|
||||||
/*
|
/*
|
||||||
|
@ -511,6 +516,8 @@ static void __init reserve_initrd(void)
|
||||||
"NEW RAMDISK");
|
"NEW RAMDISK");
|
||||||
initrd_start = ramdisk_here + PAGE_OFFSET;
|
initrd_start = ramdisk_here + PAGE_OFFSET;
|
||||||
initrd_end = initrd_start + ramdisk_size;
|
initrd_end = initrd_start + ramdisk_size;
|
||||||
|
printk(KERN_INFO "Allocated new RAMDISK: %08llx - %08llx\n",
|
||||||
|
ramdisk_here, ramdisk_here + ramdisk_size);
|
||||||
|
|
||||||
do_relocate_initrd = true;
|
do_relocate_initrd = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1011,6 +1011,7 @@ __init void lguest_init(void)
|
||||||
* clobbered. The Launcher places our initial pagetables somewhere at
|
* clobbered. The Launcher places our initial pagetables somewhere at
|
||||||
* the top of our physical memory, so we don't need extra space: set
|
* the top of our physical memory, so we don't need extra space: set
|
||||||
* init_pg_tables_end to the end of the kernel. */
|
* init_pg_tables_end to the end of the kernel. */
|
||||||
|
init_pg_tables_start = __pa(pg0);
|
||||||
init_pg_tables_end = __pa(pg0);
|
init_pg_tables_end = __pa(pg0);
|
||||||
|
|
||||||
/* Load the %fs segment register (the per-cpu segment register) with
|
/* Load the %fs segment register (the per-cpu segment register) with
|
||||||
|
@ -1064,9 +1065,9 @@ __init void lguest_init(void)
|
||||||
pm_power_off = lguest_power_off;
|
pm_power_off = lguest_power_off;
|
||||||
machine_ops.restart = lguest_restart;
|
machine_ops.restart = lguest_restart;
|
||||||
|
|
||||||
/* Now we're set up, call start_kernel() in init/main.c and we proceed
|
/* Now we're set up, call i386_start_kernel() in head32.c and we proceed
|
||||||
* to boot as normal. It never returns. */
|
* to boot as normal. It never returns. */
|
||||||
start_kernel();
|
i386_start_kernel();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* This marks the end of stage II of our journey, The Guest.
|
* This marks the end of stage II of our journey, The Guest.
|
||||||
|
|
|
@ -1211,6 +1211,7 @@ asmlinkage void __init xen_start_kernel(void)
|
||||||
|
|
||||||
pgd = (pgd_t *)xen_start_info->pt_base;
|
pgd = (pgd_t *)xen_start_info->pt_base;
|
||||||
|
|
||||||
|
init_pg_tables_start = __pa(pgd);
|
||||||
init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE;
|
init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE;
|
||||||
|
|
||||||
init_mm.pgd = pgd; /* use the Xen pagetables to start */
|
init_mm.pgd = pgd; /* use the Xen pagetables to start */
|
||||||
|
@ -1246,5 +1247,5 @@ asmlinkage void __init xen_start_kernel(void)
|
||||||
add_preferred_console("hvc", 0, NULL);
|
add_preferred_console("hvc", 0, NULL);
|
||||||
|
|
||||||
/* Start the world */
|
/* Start the world */
|
||||||
start_kernel();
|
i386_start_kernel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,10 +59,12 @@ int __init copy_e820_map(struct e820entry *biosmap, int nr_map);
|
||||||
void __init add_memory_region(unsigned long long start,
|
void __init add_memory_region(unsigned long long start,
|
||||||
unsigned long long size, int type);
|
unsigned long long size, int type);
|
||||||
|
|
||||||
|
|
||||||
|
void __init i386_start_kernel(void);
|
||||||
|
|
||||||
|
extern unsigned long init_pg_tables_start;
|
||||||
extern unsigned long init_pg_tables_end;
|
extern unsigned long init_pg_tables_end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __i386__ */
|
#endif /* __i386__ */
|
||||||
#endif /* _SETUP */
|
#endif /* _SETUP */
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
Loading…
Reference in New Issue