aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_64.c
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:11 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:11 -0500
commit746ef0cd0c7190d570c65b8e39a4ac67550ae43a (patch)
treef28b0168786b0a086c1d93b072fb854bafffd9fb /arch/x86/kernel/setup_64.c
parentba082427ae6ffbf8e48a26ae4f72f4501a6b80c1 (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/setup_64.c')
-rw-r--r--arch/x86/kernel/setup_64.c28
1 files changed, 27 insertions, 1 deletions
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 */
280void __attribute__((weak)) memory_setup(void)
281{
282 machine_specific_memory_setup();
283}
284
262void __init setup_arch(char **cmdline_p) 285void __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)