diff options
-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 | ||||
-rw-r--r-- | include/asm-x86/setup.h | 11 |
4 files changed, 44 insertions, 8 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 | /* |
diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h index 24d786e07b49..071e054abd82 100644 --- a/include/asm-x86/setup.h +++ b/include/asm-x86/setup.h | |||
@@ -3,6 +3,13 @@ | |||
3 | 3 | ||
4 | #define COMMAND_LINE_SIZE 2048 | 4 | #define COMMAND_LINE_SIZE 2048 |
5 | 5 | ||
6 | #ifndef __ASSEMBLY__ | ||
7 | char *machine_specific_memory_setup(void); | ||
8 | #ifndef CONFIG_PARAVIRT | ||
9 | #define paravirt_post_allocator_init() do {} while (0) | ||
10 | #endif | ||
11 | #endif /* __ASSEMBLY__ */ | ||
12 | |||
6 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
7 | 14 | ||
8 | #ifdef __i386__ | 15 | #ifdef __i386__ |
@@ -51,9 +58,7 @@ void __init add_memory_region(unsigned long long start, | |||
51 | 58 | ||
52 | extern unsigned long init_pg_tables_end; | 59 | extern unsigned long init_pg_tables_end; |
53 | 60 | ||
54 | #ifndef CONFIG_PARAVIRT | 61 | |
55 | #define paravirt_post_allocator_init() do {} while (0) | ||
56 | #endif | ||
57 | 62 | ||
58 | #endif /* __i386__ */ | 63 | #endif /* __i386__ */ |
59 | #endif /* _SETUP */ | 64 | #endif /* _SETUP */ |