]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
x86: Merge early kernel reserve for 32bit and 64bit
authorYinghai Lu <yinghai@kernel.org>
Thu, 24 Jan 2013 20:20:12 +0000 (12:20 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 30 Jan 2013 03:32:58 +0000 (19:32 -0800)
They are the same, and we could move them out from head32/64.c to setup.c.

We are using memblock, and it could handle overlapping properly, so
we don't need to reserve some at first to hold the location, and just
need to make sure we reserve them before we are using memblock to find
free mem to use.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1359058816-7615-32-git-send-email-yinghai@kernel.org
Cc: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/kernel/head32.c
arch/x86/kernel/head64.c
arch/x86/kernel/setup.c

index a795b54de7d3b8721b4a50c68aefc267334469c1..138463a24877df63e1fae62ca2870a4819481889 100644 (file)
@@ -33,9 +33,6 @@ void __init i386_start_kernel(void)
 {
        sanitize_boot_params(&boot_params);
 
-       memblock_reserve(__pa_symbol(&_text),
-                        __pa_symbol(&__bss_stop) - __pa_symbol(&_text));
-
        /* Call the subarch specific early setup function */
        switch (boot_params.hdr.hardware_subarch) {
        case X86_SUBARCH_MRST:
@@ -49,11 +46,5 @@ void __init i386_start_kernel(void)
                break;
        }
 
-       /*
-        * At this point everything still needed from the boot loader
-        * or BIOS or kernel text should be early reserved or marked not
-        * RAM in e820. All other memory is free game.
-        */
-
        start_kernel();
 }
index 6873b070d72cba1c8aeefb082cf8f7acef835854..57334f4cd3af1765a4dd3a63bcf141fe49a6f0f3 100644 (file)
@@ -186,16 +186,7 @@ void __init x86_64_start_reservations(char *real_mode_data)
        if (!boot_params.hdr.version)
                copy_bootdata(__va(real_mode_data));
 
-       memblock_reserve(__pa_symbol(&_text),
-                        __pa_symbol(&__bss_stop) - __pa_symbol(&_text));
-
        reserve_ebda_region();
 
-       /*
-        * At this point everything still needed from the boot loader
-        * or BIOS or kernel text should be early reserved or marked not
-        * RAM in e820. All other memory is free game.
-        */
-
        start_kernel();
 }
index 5dc47c3e537b62f5d5af814bbaacf0a6b93cc581..a74701af74e33b18e9fd530d6c8e362eea37e7e0 100644 (file)
@@ -805,8 +805,17 @@ early_param("reservelow", parse_reservelow);
 
 void __init setup_arch(char **cmdline_p)
 {
+       memblock_reserve(__pa_symbol(_text),
+                        (unsigned long)__bss_stop - (unsigned long)_text);
+
        early_reserve_initrd();
 
+       /*
+        * At this point everything still needed from the boot loader
+        * or BIOS or kernel text should be early reserved or marked not
+        * RAM in e820. All other memory is free game.
+        */
+
 #ifdef CONFIG_X86_32
        memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
        visws_early_detect();