diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2009-08-20 08:23:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-21 10:40:30 -0400 |
commit | 8126dec32738421afa362114337331337b4be17f (patch) | |
tree | 2de6e2c7f543d2b750ab5402ec8046d9b929211f | |
parent | fc0ce23506d943b9eaa731a051769d0e0605eb03 (diff) |
x86: Fix system crash when loading with "reservetop" parameter
The system will die if the kernel is booted with "reservetop"
parameter, in present code, parse "reservetop" parameter after
early_ioremap_init(), and some function still use
early_ioremap() after it.
The problem is, "reservetop" parameter can modify
'FIXADDR_TOP', then the virtual address got by early_ioremap()
is base on old 'FIXADDR_TOP', but the page mapping is base on
new 'FIXADDR_TOP', it will occur page fault, and the IDT is not
prepare yet, so, the system is dead.
So, put parse_early_param() in the front of
early_ioremap_init() in this patch.
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: yinghai@kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <4A8D402F.4080805@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/setup.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 63f32d220ef2..02643cc3bf26 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -711,6 +711,11 @@ void __init setup_arch(char **cmdline_p) | |||
711 | printk(KERN_INFO "Command line: %s\n", boot_command_line); | 711 | printk(KERN_INFO "Command line: %s\n", boot_command_line); |
712 | #endif | 712 | #endif |
713 | 713 | ||
714 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | ||
715 | *cmdline_p = command_line; | ||
716 | |||
717 | parse_early_param(); | ||
718 | |||
714 | /* VMI may relocate the fixmap; do this before touching ioremap area */ | 719 | /* VMI may relocate the fixmap; do this before touching ioremap area */ |
715 | vmi_init(); | 720 | vmi_init(); |
716 | 721 | ||
@@ -793,11 +798,6 @@ void __init setup_arch(char **cmdline_p) | |||
793 | #endif | 798 | #endif |
794 | #endif | 799 | #endif |
795 | 800 | ||
796 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | ||
797 | *cmdline_p = command_line; | ||
798 | |||
799 | parse_early_param(); | ||
800 | |||
801 | #ifdef CONFIG_X86_64 | 801 | #ifdef CONFIG_X86_64 |
802 | check_efer(); | 802 | check_efer(); |
803 | #endif | 803 | #endif |