diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:11 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:11 -0500 |
commit | 746ef0cd0c7190d570c65b8e39a4ac67550ae43a (patch) | |
tree | f28b0168786b0a086c1d93b072fb854bafffd9fb /arch/x86/kernel | |
parent | ba082427ae6ffbf8e48a26ae4f72f4501a6b80c1 (diff) |
x86: prepare 64-bit architecture initialization for paravirt
This patch prepares the x86_64 architecture initialization for
paravirt. It requires a memory initialization step, which is done
by implementing 64-bit version for machine_specific_memory_setup,
and putting an ARCH_SETUP hook, for guest-dependent initialization.
This last step is done akin to i386
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/e820_64.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/setup_64.c | 28 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_64.c | 4 |
3 files changed, 36 insertions, 5 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index 8e7321101a0a..abc473bcabe8 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c | |||
@@ -638,8 +638,10 @@ static void early_panic(char *msg) | |||
638 | panic(msg); | 638 | panic(msg); |
639 | } | 639 | } |
640 | 640 | ||
641 | void __init setup_memory_region(void) | 641 | /* We're not void only for x86 32-bit compat */ |
642 | char * __init machine_specific_memory_setup(void) | ||
642 | { | 643 | { |
644 | char *who = "BIOS-e820"; | ||
643 | /* | 645 | /* |
644 | * Try to copy the BIOS-supplied E820-map. | 646 | * Try to copy the BIOS-supplied E820-map. |
645 | * | 647 | * |
@@ -650,7 +652,10 @@ void __init setup_memory_region(void) | |||
650 | if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0) | 652 | if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0) |
651 | early_panic("Cannot find a valid memory map"); | 653 | early_panic("Cannot find a valid memory map"); |
652 | printk(KERN_INFO "BIOS-provided physical RAM map:\n"); | 654 | printk(KERN_INFO "BIOS-provided physical RAM map:\n"); |
653 | e820_print_map("BIOS-e820"); | 655 | e820_print_map(who); |
656 | |||
657 | /* In case someone cares... */ | ||
658 | return who; | ||
654 | } | 659 | } |
655 | 660 | ||
656 | static int __init parse_memopt(char *p) | 661 | static int __init parse_memopt(char *p) |
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index f2b131ef844e..8dd110d93e73 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/dmi.h> | 39 | #include <linux/dmi.h> |
40 | #include <linux/dma-mapping.h> | 40 | #include <linux/dma-mapping.h> |
41 | #include <linux/ctype.h> | 41 | #include <linux/ctype.h> |
42 | #include <linux/uaccess.h> | ||
42 | 43 | ||
43 | #include <asm/mtrr.h> | 44 | #include <asm/mtrr.h> |
44 | #include <asm/uaccess.h> | 45 | #include <asm/uaccess.h> |
@@ -62,6 +63,12 @@ | |||
62 | #include <asm/mce.h> | 63 | #include <asm/mce.h> |
63 | #include <asm/ds.h> | 64 | #include <asm/ds.h> |
64 | 65 | ||
66 | #ifdef CONFIG_PARAVIRT | ||
67 | #include <asm/paravirt.h> | ||
68 | #else | ||
69 | #define ARCH_SETUP | ||
70 | #endif | ||
71 | |||
65 | /* | 72 | /* |
66 | * Machine setup.. | 73 | * Machine setup.. |
67 | */ | 74 | */ |
@@ -246,6 +253,16 @@ static void discover_ebda(void) | |||
246 | * 4K EBDA area at 0x40E | 253 | * 4K EBDA area at 0x40E |
247 | */ | 254 | */ |
248 | ebda_addr = *(unsigned short *)__va(EBDA_ADDR_POINTER); | 255 | ebda_addr = *(unsigned short *)__va(EBDA_ADDR_POINTER); |
256 | /* | ||
257 | * There can be some situations, like paravirtualized guests, | ||
258 | * in which there is no available ebda information. In such | ||
259 | * case, just skip it | ||
260 | */ | ||
261 | if (!ebda_addr) { | ||
262 | ebda_size = 0; | ||
263 | return; | ||
264 | } | ||
265 | |||
249 | ebda_addr <<= 4; | 266 | ebda_addr <<= 4; |
250 | 267 | ||
251 | ebda_size = *(unsigned short *)__va(ebda_addr); | 268 | ebda_size = *(unsigned short *)__va(ebda_addr); |
@@ -259,6 +276,12 @@ static void discover_ebda(void) | |||
259 | ebda_size = 64*1024; | 276 | ebda_size = 64*1024; |
260 | } | 277 | } |
261 | 278 | ||
279 | /* Overridden in paravirt.c if CONFIG_PARAVIRT */ | ||
280 | void __attribute__((weak)) memory_setup(void) | ||
281 | { | ||
282 | machine_specific_memory_setup(); | ||
283 | } | ||
284 | |||
262 | void __init setup_arch(char **cmdline_p) | 285 | void __init setup_arch(char **cmdline_p) |
263 | { | 286 | { |
264 | unsigned i; | 287 | unsigned i; |
@@ -276,7 +299,10 @@ void __init setup_arch(char **cmdline_p) | |||
276 | rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0); | 299 | rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0); |
277 | rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0); | 300 | rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0); |
278 | #endif | 301 | #endif |
279 | setup_memory_region(); | 302 | |
303 | ARCH_SETUP | ||
304 | |||
305 | memory_setup(); | ||
280 | copy_edd(); | 306 | copy_edd(); |
281 | 307 | ||
282 | if (!boot_params.hdr.root_flags) | 308 | if (!boot_params.hdr.root_flags) |
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index c3f2736ba530..cb73c4da87fc 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c | |||
@@ -369,7 +369,7 @@ void __cpuinit start_secondary(void) | |||
369 | 369 | ||
370 | unlock_ipi_call_lock(); | 370 | unlock_ipi_call_lock(); |
371 | 371 | ||
372 | setup_secondary_APIC_clock(); | 372 | setup_secondary_clock(); |
373 | 373 | ||
374 | cpu_idle(); | 374 | cpu_idle(); |
375 | } | 375 | } |
@@ -923,7 +923,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
923 | * Set up local APIC timer on boot CPU. | 923 | * Set up local APIC timer on boot CPU. |
924 | */ | 924 | */ |
925 | 925 | ||
926 | setup_boot_APIC_clock(); | 926 | setup_boot_clock(); |
927 | } | 927 | } |
928 | 928 | ||
929 | /* | 929 | /* |