ia64/xen-unstable

annotate xen/arch/x86/setup.c @ 5776:64f26eed8d47

Allow arch-specific defaults to be specified for ns16550
uart configuration. Based on a patch from Hollis Blanchard
at IBM.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jul 14 09:05:22 2005 +0000 (2005-07-14)
parents f66a730a2c3d
children a83ac0806d6b
rev   line source
kaf24@1452 1
kaf24@1452 2 #include <xen/config.h>
kaf24@1452 3 #include <xen/init.h>
kaf24@1452 4 #include <xen/lib.h>
kaf24@1452 5 #include <xen/sched.h>
cl349@5247 6 #include <xen/domain.h>
kaf24@1452 7 #include <xen/serial.h>
kaf24@1506 8 #include <xen/softirq.h>
kaf24@1452 9 #include <xen/acpi.h>
kaf24@3338 10 #include <xen/console.h>
iap10@4287 11 #include <xen/serial.h>
kaf24@3338 12 #include <xen/trace.h>
kaf24@3338 13 #include <xen/multiboot.h>
kaf24@5356 14 #include <xen/domain_page.h>
kaf24@1452 15 #include <asm/bitops.h>
kaf24@1452 16 #include <asm/smp.h>
kaf24@1452 17 #include <asm/processor.h>
kaf24@1452 18 #include <asm/mpspec.h>
kaf24@1452 19 #include <asm/apic.h>
kaf24@1452 20 #include <asm/desc.h>
kaf24@3338 21 #include <asm/shadow.h>
kaf24@3344 22 #include <asm/e820.h>
kaf24@5536 23 #include <acm/acm_hooks.h>
kaf24@3338 24
kaf24@5157 25 extern void dmi_scan_machine(void);
kaf24@5211 26 extern void generic_apic_probe(void);
kaf24@5157 27
kaf24@3338 28 /*
kaf24@3338 29 * opt_xenheap_megabytes: Size of Xen heap in megabytes, excluding the
kaf24@3338 30 * pfn_info table and allocation bitmap.
kaf24@3338 31 */
kaf24@3338 32 static unsigned int opt_xenheap_megabytes = XENHEAP_DEFAULT_MB;
kaf24@4950 33 #if defined(CONFIG_X86_64)
kaf24@3338 34 integer_param("xenheap_megabytes", opt_xenheap_megabytes);
kaf24@3354 35 #endif
kaf24@1452 36
kaf24@5146 37 /* opt_nosmp: If true, secondary processors are ignored. */
kaf24@5146 38 static int opt_nosmp = 0;
kaf24@5146 39 boolean_param("nosmp", opt_nosmp);
kaf24@5146 40
kaf24@5146 41 /* maxcpus: maximum number of CPUs to activate. */
kaf24@5146 42 static unsigned int max_cpus = NR_CPUS;
kaf24@5146 43 integer_param("maxcpus", max_cpus);
kaf24@5146 44
kaf24@3334 45 /* opt_watchdog: If true, run a watchdog NMI on each processor. */
kaf24@3334 46 static int opt_watchdog = 0;
kaf24@3334 47 boolean_param("watchdog", opt_watchdog);
kaf24@3334 48
kaf24@4850 49 /* **** Linux config option: propagated to domain0. */
kaf24@4850 50 /* "acpi=off": Sisables both ACPI table parsing and interpreter. */
kaf24@4850 51 /* "acpi=force": Override the disable blacklist. */
kaf24@4850 52 /* "acpi=strict": Disables out-of-spec workarounds. */
kaf24@4850 53 /* "acpi=ht": Limit ACPI just to boot-time to enable HT. */
kaf24@4850 54 /* "acpi=noirq": Disables ACPI interrupt routing. */
kaf24@4850 55 static void parse_acpi_param(char *s);
kaf24@4850 56 custom_param("acpi", parse_acpi_param);
kaf24@4850 57
kaf24@4850 58 /* **** Linux config option: propagated to domain0. */
kaf24@4850 59 /* acpi_skip_timer_override: Skip IRQ0 overrides. */
kaf24@4850 60 extern int acpi_skip_timer_override;
kaf24@4850 61 boolean_param("acpi_skip_timer_override", acpi_skip_timer_override);
kaf24@4850 62
kaf24@4850 63 /* **** Linux config option: propagated to domain0. */
kaf24@4850 64 /* noapic: Disable IOAPIC setup. */
kaf24@4850 65 extern int skip_ioapic_setup;
kaf24@4850 66 boolean_param("noapic", skip_ioapic_setup);
kaf24@4850 67
kaf24@3594 68 int early_boot = 1;
kaf24@3594 69
kaf24@5146 70 cpumask_t cpu_present_map;
kaf24@5146 71
kaf24@5003 72 /* Limits of Xen heap, used to initialise the allocator. */
kaf24@5003 73 unsigned long xenheap_phys_start, xenheap_phys_end;
kaf24@3338 74
kaf24@2298 75 extern void arch_init_memory(void);
kaf24@1589 76 extern void init_IRQ(void);
kaf24@1589 77 extern void trap_init(void);
kaf24@5604 78 extern void early_time_init(void);
kaf24@1589 79 extern void ac_timer_init(void);
kaf24@5167 80 extern void initialize_keytable(void);
kaf24@5167 81 extern void early_cpu_init(void);
kaf24@1589 82
kaf24@5011 83 extern unsigned long cpu0_stack[];
kaf24@5011 84
kaf24@5214 85 struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
kaf24@1452 86
kaf24@5237 87 #if CONFIG_PAGING_LEVELS > 2
kaf24@1670 88 unsigned long mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE;
kaf24@1670 89 #else
kaf24@5593 90 unsigned long mmu_cr4_features = X86_CR4_PSE;
kaf24@1670 91 #endif
kaf24@1452 92 EXPORT_SYMBOL(mmu_cr4_features);
kaf24@1452 93
kaf24@5289 94 struct vcpu *idle_task[NR_CPUS] = { &idle0_vcpu };
kaf24@1452 95
kaf24@4818 96 int acpi_disabled;
kaf24@1452 97
kaf24@4850 98 int acpi_force;
kaf24@4850 99 char acpi_param[10] = "";
kaf24@4850 100 static void parse_acpi_param(char *s)
kaf24@4850 101 {
kaf24@4850 102 /* Save the parameter so it can be propagated to domain0. */
kaf24@4850 103 strncpy(acpi_param, s, sizeof(acpi_param));
kaf24@4850 104 acpi_param[sizeof(acpi_param)-1] = '\0';
kaf24@4850 105
kaf24@4850 106 /* Interpret the parameter for use within Xen. */
kaf24@4850 107 if ( !strcmp(s, "off") )
kaf24@4850 108 {
kaf24@4850 109 disable_acpi();
kaf24@4850 110 }
kaf24@4850 111 else if ( !strcmp(s, "force") )
kaf24@4850 112 {
kaf24@4850 113 acpi_force = 1;
kaf24@4850 114 acpi_ht = 1;
kaf24@4850 115 acpi_disabled = 0;
kaf24@4850 116 }
kaf24@4850 117 else if ( !strcmp(s, "strict") )
kaf24@4850 118 {
kaf24@4850 119 acpi_strict = 1;
kaf24@4850 120 }
kaf24@4850 121 else if ( !strcmp(s, "ht") )
kaf24@4850 122 {
kaf24@4850 123 if ( !acpi_force )
kaf24@4850 124 disable_acpi();
kaf24@4850 125 acpi_ht = 1;
kaf24@4850 126 }
kaf24@4850 127 else if ( !strcmp(s, "noirq") )
kaf24@4850 128 {
kaf24@4850 129 acpi_noirq_set();
kaf24@4850 130 }
kaf24@4850 131 }
kaf24@4850 132
kaf24@1452 133 static void __init do_initcalls(void)
kaf24@1452 134 {
kaf24@1452 135 initcall_t *call;
kaf24@1452 136 for ( call = &__initcall_start; call < &__initcall_end; call++ )
kaf24@1452 137 (*call)();
kaf24@1452 138 }
kaf24@1452 139
kaf24@3338 140 static void __init start_of_day(void)
kaf24@1452 141 {
kaf24@5146 142 int i;
kaf24@5146 143
kaf24@5214 144 early_cpu_init();
kaf24@5214 145
kaf24@5298 146 paging_init();
kaf24@5298 147
kaf24@1452 148 /* Unmap the first page of CPU0's stack. */
kaf24@3686 149 memguard_guard_stack(cpu0_stack);
kaf24@1452 150
kaf24@1505 151 open_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ, new_tlbflush_clock_period);
kaf24@1452 152
kaf24@1452 153 if ( opt_watchdog )
kaf24@1452 154 nmi_watchdog = NMI_LOCAL_APIC;
kaf24@1452 155
kaf24@3120 156 sort_exception_tables();
kaf24@3120 157
kaf24@3272 158 arch_do_createdomain(current);
kaf24@4972 159
kaf24@4972 160 /* Map default GDT into their final position in the idle page table. */
kaf24@5003 161 map_pages_to_xen(
kaf24@4972 162 GDT_VIRT_START(current) + FIRST_RESERVED_GDT_BYTE,
kaf24@5004 163 virt_to_phys(gdt_table) >> PAGE_SHIFT, 1, PAGE_HYPERVISOR);
kaf24@3272 164
kaf24@4850 165 find_smp_config();
kaf24@4850 166
kaf24@4850 167 smp_alloc_memory();
kaf24@4850 168
kaf24@5157 169 dmi_scan_machine();
kaf24@5157 170
kaf24@5211 171 generic_apic_probe();
kaf24@5157 172
kaf24@4850 173 acpi_boot_table_init();
kaf24@4850 174 acpi_boot_init();
kaf24@4850 175
kaf24@1452 176 if ( smp_found_config )
kaf24@1452 177 get_smp_config();
kaf24@4850 178
kaf24@4850 179 init_apic_mappings();
kaf24@4850 180
kaf24@4850 181 init_IRQ();
kaf24@4850 182
kaf24@1452 183 trap_init();
kaf24@4850 184
kaf24@5174 185 ac_timer_init();
kaf24@5174 186
kaf24@5604 187 early_time_init();
kaf24@1452 188
kaf24@2298 189 arch_init_memory();
kaf24@2298 190
kaf24@5536 191 scheduler_init();
kaf24@1452 192
kaf24@5214 193 identify_cpu(&boot_cpu_data);
kaf24@5214 194 if ( cpu_has_fxsr )
kaf24@5214 195 set_in_cr4(X86_CR4_OSFXSR);
kaf24@5214 196 if ( cpu_has_xmm )
kaf24@5214 197 set_in_cr4(X86_CR4_OSXMMEXCPT);
kaf24@5214 198
kaf24@5146 199 if ( opt_nosmp )
kaf24@5146 200 max_cpus = 0;
kaf24@5146 201 smp_prepare_cpus(max_cpus);
kaf24@5146 202
kaf24@5146 203 /* We aren't hotplug-capable yet. */
kaf24@5146 204 BUG_ON(!cpus_empty(cpu_present_map));
kaf24@5146 205 for_each_cpu ( i )
kaf24@5146 206 cpu_set(i, cpu_present_map);
kaf24@1452 207
kaf24@5604 208 /*
kaf24@5604 209 * Initialise higher-level timer functions. We do this fairly late
kaf24@5604 210 * (post-SMP) because the time bases and scale factors need to be updated
kaf24@5604 211 * regularly, and SMP initialisation can cause a long delay with
kaf24@5604 212 * interrupts not yet enabled.
kaf24@5604 213 */
kaf24@5604 214 init_xen_time();
kaf24@5177 215
kaf24@4850 216 initialize_keytable();
kaf24@1452 217
kaf24@5195 218 serial_init_postirq();
kaf24@1452 219
kaf24@5604 220 BUG_ON(!local_irq_is_enabled());
kaf24@5146 221
kaf24@5146 222 for_each_present_cpu ( i )
kaf24@1452 223 {
kaf24@5146 224 if ( num_online_cpus() >= max_cpus )
kaf24@5146 225 break;
kaf24@5146 226 if ( !cpu_online(i) )
kaf24@5146 227 __cpu_up(i);
kaf24@1452 228 }
kaf24@1452 229
kaf24@5146 230 printk("Brought up %ld CPUs\n", (long)num_online_cpus());
kaf24@5146 231 smp_cpus_done(max_cpus);
kaf24@1452 232
kaf24@1452 233 do_initcalls();
kaf24@1452 234
kaf24@5146 235 schedulers_start();
kaf24@1452 236
kaf24@4926 237 watchdog_enable();
kaf24@1452 238 }
kaf24@3338 239
kaf24@5011 240 #define EARLY_FAIL() for ( ; ; ) __asm__ __volatile__ ( "hlt" )
kaf24@5011 241
kaf24@3338 242 void __init __start_xen(multiboot_info_t *mbi)
kaf24@3338 243 {
riel@3992 244 char *cmdline;
kaf24@3338 245 module_t *mod = (module_t *)__va(mbi->mods_addr);
kaf24@3354 246 unsigned long firsthole_start, nr_pages;
kaf24@3338 247 unsigned long initial_images_start, initial_images_end;
kaf24@3344 248 struct e820entry e820_raw[E820MAX];
kaf24@3354 249 int i, e820_raw_nr = 0, bytes = 0;
kaf24@5776 250 struct ns16550_defaults ns16550 = {
kaf24@5776 251 .data_bits = 8,
kaf24@5776 252 .parity = 'n',
kaf24@5776 253 .stop_bits = 1
kaf24@5776 254 };
kaf24@3338 255
kaf24@3338 256 /* Parse the command-line options. */
kaf24@3344 257 if ( (mbi->flags & MBI_CMDLINE) && (mbi->cmdline != 0) )
kaf24@5211 258 cmdline_parse(__va(mbi->cmdline));
kaf24@3338 259
kaf24@3338 260 /* Must do this early -- e.g., spinlocks rely on get_current(). */
kaf24@5289 261 set_current(&idle0_vcpu);
kaf24@4986 262 set_processor_id(0);
kaf24@3338 263
kaf24@5146 264 smp_prepare_boot_cpu();
kaf24@5146 265
kaf24@3338 266 /* We initialise the serial devices very early so we can get debugging. */
kaf24@5776 267 ns16550.io_base = 0x3f8;
kaf24@5776 268 ns16550.irq = 4;
kaf24@5776 269 ns16550_init(0, &ns16550);
kaf24@5776 270 ns16550.io_base = 0x2f8;
kaf24@5776 271 ns16550.irq = 3;
kaf24@5776 272 ns16550_init(1, &ns16550);
kaf24@5195 273 serial_init_preirq();
kaf24@3338 274
kaf24@3338 275 init_console();
kaf24@3338 276
kaf24@3344 277 /* Check that we have at least one Multiboot module. */
kaf24@3344 278 if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
kaf24@3338 279 {
kaf24@5542 280 printk("FATAL ERROR: dom0 kernel not specified."
kaf24@5542 281 " Check bootloader configuration.\n");
kaf24@5011 282 EARLY_FAIL();
kaf24@5011 283 }
kaf24@5011 284
kaf24@5011 285 if ( ((unsigned long)cpu0_stack & (STACK_SIZE-1)) != 0 )
kaf24@5011 286 {
kaf24@5011 287 printk("FATAL ERROR: Misaligned CPU0 stack.\n");
kaf24@5011 288 EARLY_FAIL();
kaf24@3338 289 }
kaf24@3338 290
kaf24@3338 291 xenheap_phys_end = opt_xenheap_megabytes << 20;
kaf24@3338 292
kaf24@3344 293 if ( mbi->flags & MBI_MEMMAP )
kaf24@3344 294 {
kaf24@3344 295 while ( bytes < mbi->mmap_length )
kaf24@3344 296 {
kaf24@3344 297 memory_map_t *map = __va(mbi->mmap_addr + bytes);
kaf24@3344 298 e820_raw[e820_raw_nr].addr =
kaf24@3344 299 ((u64)map->base_addr_high << 32) | (u64)map->base_addr_low;
kaf24@3344 300 e820_raw[e820_raw_nr].size =
kaf24@3344 301 ((u64)map->length_high << 32) | (u64)map->length_low;
kaf24@3344 302 e820_raw[e820_raw_nr].type =
kaf24@3346 303 (map->type > E820_SHARED_PAGE) ? E820_RESERVED : map->type;
kaf24@3344 304 e820_raw_nr++;
kaf24@3344 305 bytes += map->size + 4;
kaf24@3344 306 }
kaf24@3344 307 }
kaf24@3344 308 else if ( mbi->flags & MBI_MEMLIMITS )
kaf24@3344 309 {
kaf24@3344 310 e820_raw[0].addr = 0;
kaf24@3344 311 e820_raw[0].size = mbi->mem_lower << 10;
kaf24@3344 312 e820_raw[0].type = E820_RAM;
kaf24@3354 313 e820_raw[1].addr = 0x100000;
kaf24@3354 314 e820_raw[1].size = mbi->mem_upper << 10;
kaf24@3354 315 e820_raw[1].type = E820_RAM;
kaf24@3344 316 e820_raw_nr = 2;
kaf24@3344 317 }
kaf24@3344 318 else
kaf24@3344 319 {
kaf24@3344 320 printk("FATAL ERROR: Bootloader provided no memory information.\n");
kaf24@3344 321 for ( ; ; ) ;
kaf24@3344 322 }
kaf24@3344 323
kaf24@4950 324 max_page = init_e820(e820_raw, &e820_raw_nr);
kaf24@3338 325
kaf24@3354 326 /* Find the first high-memory RAM hole. */
kaf24@3354 327 for ( i = 0; i < e820.nr_map; i++ )
kaf24@3354 328 if ( (e820.map[i].type == E820_RAM) &&
kaf24@3354 329 (e820.map[i].addr >= 0x100000) )
kaf24@3354 330 break;
kaf24@3354 331 firsthole_start = e820.map[i].addr + e820.map[i].size;
kaf24@3338 332
kaf24@3354 333 /* Relocate the Multiboot modules. */
kaf24@3354 334 initial_images_start = xenheap_phys_end;
kaf24@3338 335 initial_images_end = initial_images_start +
kaf24@3338 336 (mod[mbi->mods_count-1].mod_end - mod[0].mod_start);
kaf24@3354 337 if ( initial_images_end > firsthole_start )
kaf24@3338 338 {
kaf24@3338 339 printk("Not enough memory to stash the DOM0 kernel image.\n");
kaf24@3338 340 for ( ; ; ) ;
kaf24@3338 341 }
kaf24@4950 342 #if defined(CONFIG_X86_32)
kaf24@3338 343 memmove((void *)initial_images_start, /* use low mapping */
kaf24@3338 344 (void *)mod[0].mod_start, /* use low mapping */
kaf24@3338 345 mod[mbi->mods_count-1].mod_end - mod[0].mod_start);
kaf24@4950 346 #elif defined(CONFIG_X86_64)
kaf24@3338 347 memmove(__va(initial_images_start),
kaf24@3338 348 __va(mod[0].mod_start),
kaf24@3338 349 mod[mbi->mods_count-1].mod_end - mod[0].mod_start);
kaf24@3338 350 #endif
kaf24@3338 351
kaf24@3354 352 /* Initialise boot-time allocator with all RAM situated after modules. */
kaf24@5003 353 xenheap_phys_start = init_boot_allocator(__pa(&_end));
kaf24@3354 354 nr_pages = 0;
kaf24@3354 355 for ( i = 0; i < e820.nr_map; i++ )
kaf24@3354 356 {
kaf24@3354 357 if ( e820.map[i].type != E820_RAM )
kaf24@3354 358 continue;
kaf24@3354 359 nr_pages += e820.map[i].size >> PAGE_SHIFT;
kaf24@3354 360 if ( (e820.map[i].addr + e820.map[i].size) >= initial_images_end )
kaf24@3354 361 init_boot_pages((e820.map[i].addr < initial_images_end) ?
kaf24@3354 362 initial_images_end : e820.map[i].addr,
kaf24@3354 363 e820.map[i].addr + e820.map[i].size);
kaf24@5003 364 #if defined (CONFIG_X86_64)
kaf24@5003 365 /*
kaf24@5003 366 * x86/64 maps all registered RAM. Points to note:
kaf24@5003 367 * 1. The initial pagetable already maps low 64MB, so skip that.
kaf24@5003 368 * 2. We must map *only* RAM areas, taking care to avoid I/O holes.
kaf24@5003 369 * Failure to do this can cause coherency problems and deadlocks
kaf24@5003 370 * due to cache-attribute mismatches (e.g., AMD/AGP Linux bug).
kaf24@5003 371 */
kaf24@5003 372 {
kaf24@5004 373 /* Calculate page-frame range, discarding partial frames. */
kaf24@5004 374 unsigned long start, end;
kaf24@5005 375 start = PFN_UP(e820.map[i].addr);
kaf24@5005 376 end = PFN_DOWN(e820.map[i].addr + e820.map[i].size);
kaf24@5004 377 /* Clip the range to above 64MB. */
kaf24@5004 378 if ( end < (64UL << (20-PAGE_SHIFT)) )
kaf24@5004 379 continue;
kaf24@5004 380 if ( start < (64UL << (20-PAGE_SHIFT)) )
kaf24@5004 381 start = 64UL << (20-PAGE_SHIFT);
kaf24@5004 382 /* Request the mapping. */
kaf24@5003 383 map_pages_to_xen(
kaf24@5004 384 PAGE_OFFSET + (start << PAGE_SHIFT),
kaf24@5004 385 start, end-start, PAGE_HYPERVISOR);
kaf24@5003 386 }
kaf24@5003 387 #endif
kaf24@3354 388 }
kaf24@3354 389
kaf24@5003 390 memguard_init();
kaf24@4950 391
kaf24@3354 392 printk("System RAM: %luMB (%lukB)\n",
kaf24@3354 393 nr_pages >> (20 - PAGE_SHIFT),
kaf24@3354 394 nr_pages << (PAGE_SHIFT - 10));
kaf24@3354 395
kaf24@3354 396 init_frametable();
kaf24@3338 397
kaf24@3354 398 end_boot_allocator();
kaf24@3354 399
kaf24@5003 400 init_xenheap_pages(xenheap_phys_start, xenheap_phys_end);
kaf24@3354 401 printk("Xen heap: %luMB (%lukB)\n",
kaf24@5536 402 (xenheap_phys_end-xenheap_phys_start) >> 20,
kaf24@5536 403 (xenheap_phys_end-xenheap_phys_start) >> 10);
kaf24@3338 404
kaf24@3594 405 early_boot = 0;
kaf24@3338 406
kaf24@3338 407 start_of_day();
kaf24@3338 408
kaf24@3338 409 grant_table_init();
kaf24@3338 410
kaf24@3338 411 shadow_mode_init();
kaf24@3338 412
smh22@5514 413 /* initialize access control security module */
smh22@5514 414 acm_init();
smh22@5514 415
kaf24@3338 416 /* Create initial domain 0. */
kaf24@3338 417 dom0 = do_createdomain(0, 0);
kaf24@3338 418 if ( dom0 == NULL )
kaf24@3338 419 panic("Error creating domain 0\n");
kaf24@3338 420
kaf24@4877 421 set_bit(_DOMF_privileged, &dom0->domain_flags);
smh22@5514 422 /* post-create hooks sets security label */
smh22@5514 423 acm_post_domain0_create(dom0->domain_id);
kaf24@3338 424
kaf24@4850 425 /* Grab the DOM0 command line. */
riel@3992 426 cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
kaf24@3338 427 if ( cmdline != NULL )
kaf24@3338 428 {
kaf24@5366 429 static char dom0_cmdline[MAX_GUEST_CMDLINE];
kaf24@4850 430
kaf24@4850 431 /* Skip past the image name. */
kaf24@3338 432 while ( *cmdline == ' ' ) cmdline++;
kaf24@3338 433 if ( (cmdline = strchr(cmdline, ' ')) != NULL )
kaf24@3338 434 while ( *cmdline == ' ' ) cmdline++;
kaf24@4850 435
kaf24@4850 436 /* Copy the command line to a local buffer. */
kaf24@4850 437 strcpy(dom0_cmdline, cmdline);
kaf24@4850 438 cmdline = dom0_cmdline;
kaf24@4850 439
kaf24@4850 440 /* Append any extra parameters. */
kaf24@4850 441 if ( skip_ioapic_setup && !strstr(cmdline, "noapic") )
kaf24@4850 442 strcat(cmdline, " noapic");
kaf24@4850 443 if ( acpi_skip_timer_override &&
kaf24@4850 444 !strstr(cmdline, "acpi_skip_timer_override") )
kaf24@4850 445 strcat(cmdline, " acpi_skip_timer_override");
kaf24@4850 446 if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") )
kaf24@4850 447 {
kaf24@4850 448 strcat(cmdline, " acpi=");
kaf24@4850 449 strcat(cmdline, acpi_param);
kaf24@4850 450 }
kaf24@3338 451 }
kaf24@3338 452
kaf24@3338 453 /*
kaf24@3338 454 * We're going to setup domain0 using the module(s) that we stashed safely
kaf24@3338 455 * above our heap. The second module, if present, is an initrd ramdisk.
kaf24@3338 456 */
kaf24@3935 457 if ( construct_dom0(dom0,
kaf24@3635 458 initial_images_start,
kaf24@3338 459 mod[0].mod_end-mod[0].mod_start,
kaf24@3338 460 (mbi->mods_count == 1) ? 0 :
kaf24@3635 461 initial_images_start +
kaf24@3338 462 (mod[1].mod_start-mod[0].mod_start),
kaf24@3338 463 (mbi->mods_count == 1) ? 0 :
kaf24@3338 464 mod[mbi->mods_count-1].mod_end - mod[1].mod_start,
kaf24@3338 465 cmdline) != 0)
kaf24@3338 466 panic("Could not set up DOM0 guest OS\n");
kaf24@3338 467
kaf24@3935 468 /* Scrub RAM that is still free and so may go to an unprivileged domain. */
kaf24@3338 469 scrub_heap_pages();
kaf24@3338 470
kaf24@3338 471 init_trace_bufs();
kaf24@3338 472
kaf24@3338 473 /* Give up the VGA console if DOM0 is configured to grab it. */
kaf24@3338 474 console_endboot(cmdline && strstr(cmdline, "tty0"));
kaf24@3338 475
iap10@4287 476 /* Hide UART from DOM0 if we're using it */
iap10@4287 477 serial_endboot();
iap10@4287 478
kaf24@3338 479 domain_unpause_by_systemcontroller(dom0);
kaf24@5146 480
kaf24@3338 481 startup_cpu_idle_loop();
kaf24@3338 482 }
kaf24@3914 483
kaf24@3914 484 /*
kaf24@3914 485 * Local variables:
kaf24@3914 486 * mode: C
kaf24@3914 487 * c-set-style: "BSD"
kaf24@3914 488 * c-basic-offset: 4
kaf24@3914 489 * tab-width: 4
kaf24@3914 490 * indent-tabs-mode: nil
kaf24@3988 491 * End:
kaf24@3914 492 */