setup.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /*
  2. * linux/arch/i386/kernel/setup.c
  3. *
  4. * Copyright (C) 1995 Linus Torvalds
  5. *
  6. * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
  7. *
  8. * Memory region support
  9. * David Parsons <orc@pell.chi.il.us>, July-August 1999
  10. *
  11. * Added E820 sanitization routine (removes overlapping memory regions);
  12. * Brian Moyle <bmoyle@mvista.com>, February 2001
  13. *
  14. * Moved CPU detection code to cpu/${cpu}.c
  15. * Patrick Mochel <mochel@osdl.org>, March 2002
  16. *
  17. * Provisions for empty E820 memory regions (reported by certain BIOSes).
  18. * Alex Achenbach <xela@slit.de>, December 2002.
  19. *
  20. */
  21. /*
  22. * This file handles the architecture-dependent parts of initialization
  23. */
  24. #include <linux/sched.h>
  25. #include <linux/mm.h>
  26. #include <linux/mmzone.h>
  27. #include <linux/screen_info.h>
  28. #include <linux/ioport.h>
  29. #include <linux/acpi.h>
  30. #include <linux/apm_bios.h>
  31. #include <linux/initrd.h>
  32. #include <linux/bootmem.h>
  33. #include <linux/seq_file.h>
  34. #include <linux/console.h>
  35. #include <linux/mca.h>
  36. #include <linux/root_dev.h>
  37. #include <linux/highmem.h>
  38. #include <linux/module.h>
  39. #include <linux/efi.h>
  40. #include <linux/init.h>
  41. #include <linux/edd.h>
  42. #include <linux/nodemask.h>
  43. #include <linux/kexec.h>
  44. #include <linux/crash_dump.h>
  45. #include <linux/dmi.h>
  46. #include <linux/pfn.h>
  47. #include <video/edid.h>
  48. #include <asm/apic.h>
  49. #include <asm/e820.h>
  50. #include <asm/mpspec.h>
  51. #include <asm/mmzone.h>
  52. #include <asm/setup.h>
  53. #include <asm/arch_hooks.h>
  54. #include <asm/sections.h>
  55. #include <asm/io_apic.h>
  56. #include <asm/ist.h>
  57. #include <asm/io.h>
  58. #include <asm/vmi.h>
  59. #include <setup_arch.h>
  60. #include <bios_ebda.h>
  61. /* This value is set up by the early boot code to point to the value
  62. immediately after the boot time page tables. It contains a *physical*
  63. address, and must not be in the .bss segment! */
  64. unsigned long init_pg_tables_end __initdata = ~0UL;
  65. int disable_pse __devinitdata = 0;
  66. /*
  67. * Machine setup..
  68. */
  69. extern struct resource code_resource;
  70. extern struct resource data_resource;
  71. /* cpu data as detected by the assembly code in head.S */
  72. struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
  73. /* common cpu data for all cpus */
  74. struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
  75. EXPORT_SYMBOL(boot_cpu_data);
  76. unsigned long mmu_cr4_features;
  77. /* for MCA, but anyone else can use it if they want */
  78. unsigned int machine_id;
  79. #ifdef CONFIG_MCA
  80. EXPORT_SYMBOL(machine_id);
  81. #endif
  82. unsigned int machine_submodel_id;
  83. unsigned int BIOS_revision;
  84. unsigned int mca_pentium_flag;
  85. /* Boot loader ID as an integer, for the benefit of proc_dointvec */
  86. int bootloader_type;
  87. /* user-defined highmem size */
  88. static unsigned int highmem_pages = -1;
  89. /*
  90. * Setup options
  91. */
  92. struct screen_info screen_info;
  93. EXPORT_SYMBOL(screen_info);
  94. struct apm_info apm_info;
  95. EXPORT_SYMBOL(apm_info);
  96. struct edid_info edid_info;
  97. EXPORT_SYMBOL_GPL(edid_info);
  98. struct ist_info ist_info;
  99. #if defined(CONFIG_X86_SPEEDSTEP_SMI) || \
  100. defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
  101. EXPORT_SYMBOL(ist_info);
  102. #endif
  103. extern void early_cpu_init(void);
  104. extern int root_mountflags;
  105. unsigned long saved_videomode;
  106. #define RAMDISK_IMAGE_START_MASK 0x07FF
  107. #define RAMDISK_PROMPT_FLAG 0x8000
  108. #define RAMDISK_LOAD_FLAG 0x4000
  109. static char __initdata command_line[COMMAND_LINE_SIZE];
  110. struct boot_params __initdata boot_params;
  111. #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
  112. struct edd edd;
  113. #ifdef CONFIG_EDD_MODULE
  114. EXPORT_SYMBOL(edd);
  115. #endif
  116. /**
  117. * copy_edd() - Copy the BIOS EDD information
  118. * from boot_params into a safe place.
  119. *
  120. */
  121. static inline void copy_edd(void)
  122. {
  123. memcpy(edd.mbr_signature, EDD_MBR_SIGNATURE, sizeof(edd.mbr_signature));
  124. memcpy(edd.edd_info, EDD_BUF, sizeof(edd.edd_info));
  125. edd.mbr_signature_nr = EDD_MBR_SIG_NR;
  126. edd.edd_info_nr = EDD_NR;
  127. }
  128. #else
  129. static inline void copy_edd(void)
  130. {
  131. }
  132. #endif
  133. int __initdata user_defined_memmap = 0;
  134. /*
  135. * "mem=nopentium" disables the 4MB page tables.
  136. * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM
  137. * to <mem>, overriding the bios size.
  138. * "memmap=XXX[KkmM]@XXX[KkmM]" defines a memory region from
  139. * <start> to <start>+<mem>, overriding the bios size.
  140. *
  141. * HPA tells me bootloaders need to parse mem=, so no new
  142. * option should be mem= [also see Documentation/i386/boot.txt]
  143. */
  144. static int __init parse_mem(char *arg)
  145. {
  146. if (!arg)
  147. return -EINVAL;
  148. if (strcmp(arg, "nopentium") == 0) {
  149. clear_bit(X86_FEATURE_PSE, boot_cpu_data.x86_capability);
  150. disable_pse = 1;
  151. } else {
  152. /* If the user specifies memory size, we
  153. * limit the BIOS-provided memory map to
  154. * that size. exactmap can be used to specify
  155. * the exact map. mem=number can be used to
  156. * trim the existing memory map.
  157. */
  158. unsigned long long mem_size;
  159. mem_size = memparse(arg, &arg);
  160. limit_regions(mem_size);
  161. user_defined_memmap = 1;
  162. }
  163. return 0;
  164. }
  165. early_param("mem", parse_mem);
  166. #ifdef CONFIG_PROC_VMCORE
  167. /* elfcorehdr= specifies the location of elf core header
  168. * stored by the crashed kernel.
  169. */
  170. static int __init parse_elfcorehdr(char *arg)
  171. {
  172. if (!arg)
  173. return -EINVAL;
  174. elfcorehdr_addr = memparse(arg, &arg);
  175. return 0;
  176. }
  177. early_param("elfcorehdr", parse_elfcorehdr);
  178. #endif /* CONFIG_PROC_VMCORE */
  179. /*
  180. * highmem=size forces highmem to be exactly 'size' bytes.
  181. * This works even on boxes that have no highmem otherwise.
  182. * This also works to reduce highmem size on bigger boxes.
  183. */
  184. static int __init parse_highmem(char *arg)
  185. {
  186. if (!arg)
  187. return -EINVAL;
  188. highmem_pages = memparse(arg, &arg) >> PAGE_SHIFT;
  189. return 0;
  190. }
  191. early_param("highmem", parse_highmem);
  192. /*
  193. * vmalloc=size forces the vmalloc area to be exactly 'size'
  194. * bytes. This can be used to increase (or decrease) the
  195. * vmalloc area - the default is 128m.
  196. */
  197. static int __init parse_vmalloc(char *arg)
  198. {
  199. if (!arg)
  200. return -EINVAL;
  201. __VMALLOC_RESERVE = memparse(arg, &arg);
  202. return 0;
  203. }
  204. early_param("vmalloc", parse_vmalloc);
  205. /*
  206. * reservetop=size reserves a hole at the top of the kernel address space which
  207. * a hypervisor can load into later. Needed for dynamically loaded hypervisors,
  208. * so relocating the fixmap can be done before paging initialization.
  209. */
  210. static int __init parse_reservetop(char *arg)
  211. {
  212. unsigned long address;
  213. if (!arg)
  214. return -EINVAL;
  215. address = memparse(arg, &arg);
  216. reserve_top_address(address);
  217. return 0;
  218. }
  219. early_param("reservetop", parse_reservetop);
  220. /*
  221. * Determine low and high memory ranges:
  222. */
  223. unsigned long __init find_max_low_pfn(void)
  224. {
  225. unsigned long max_low_pfn;
  226. max_low_pfn = max_pfn;
  227. if (max_low_pfn > MAXMEM_PFN) {
  228. if (highmem_pages == -1)
  229. highmem_pages = max_pfn - MAXMEM_PFN;
  230. if (highmem_pages + MAXMEM_PFN < max_pfn)
  231. max_pfn = MAXMEM_PFN + highmem_pages;
  232. if (highmem_pages + MAXMEM_PFN > max_pfn) {
  233. printk("only %luMB highmem pages available, ignoring highmem size of %uMB.\n", pages_to_mb(max_pfn - MAXMEM_PFN), pages_to_mb(highmem_pages));
  234. highmem_pages = 0;
  235. }
  236. max_low_pfn = MAXMEM_PFN;
  237. #ifndef CONFIG_HIGHMEM
  238. /* Maximum memory usable is what is directly addressable */
  239. printk(KERN_WARNING "Warning only %ldMB will be used.\n",
  240. MAXMEM>>20);
  241. if (max_pfn > MAX_NONPAE_PFN)
  242. printk(KERN_WARNING "Use a PAE enabled kernel.\n");
  243. else
  244. printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
  245. max_pfn = MAXMEM_PFN;
  246. #else /* !CONFIG_HIGHMEM */
  247. #ifndef CONFIG_X86_PAE
  248. if (max_pfn > MAX_NONPAE_PFN) {
  249. max_pfn = MAX_NONPAE_PFN;
  250. printk(KERN_WARNING "Warning only 4GB will be used.\n");
  251. printk(KERN_WARNING "Use a PAE enabled kernel.\n");
  252. }
  253. #endif /* !CONFIG_X86_PAE */
  254. #endif /* !CONFIG_HIGHMEM */
  255. } else {
  256. if (highmem_pages == -1)
  257. highmem_pages = 0;
  258. #ifdef CONFIG_HIGHMEM
  259. if (highmem_pages >= max_pfn) {
  260. printk(KERN_ERR "highmem size specified (%uMB) is bigger than pages available (%luMB)!.\n", pages_to_mb(highmem_pages), pages_to_mb(max_pfn));
  261. highmem_pages = 0;
  262. }
  263. if (highmem_pages) {
  264. if (max_low_pfn-highmem_pages < 64*1024*1024/PAGE_SIZE){
  265. printk(KERN_ERR "highmem size %uMB results in smaller than 64MB lowmem, ignoring it.\n", pages_to_mb(highmem_pages));
  266. highmem_pages = 0;
  267. }
  268. max_low_pfn -= highmem_pages;
  269. }
  270. #else
  271. if (highmem_pages)
  272. printk(KERN_ERR "ignoring highmem size on non-highmem kernel!\n");
  273. #endif
  274. }
  275. return max_low_pfn;
  276. }
  277. /*
  278. * workaround for Dell systems that neglect to reserve EBDA
  279. */
  280. static void __init reserve_ebda_region(void)
  281. {
  282. unsigned int addr;
  283. addr = get_bios_ebda();
  284. if (addr)
  285. reserve_bootmem(addr, PAGE_SIZE);
  286. }
  287. #ifndef CONFIG_NEED_MULTIPLE_NODES
  288. void __init setup_bootmem_allocator(void);
  289. static unsigned long __init setup_memory(void)
  290. {
  291. /*
  292. * partially used pages are not usable - thus
  293. * we are rounding upwards:
  294. */
  295. min_low_pfn = PFN_UP(init_pg_tables_end);
  296. find_max_pfn();
  297. max_low_pfn = find_max_low_pfn();
  298. #ifdef CONFIG_HIGHMEM
  299. highstart_pfn = highend_pfn = max_pfn;
  300. if (max_pfn > max_low_pfn) {
  301. highstart_pfn = max_low_pfn;
  302. }
  303. printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
  304. pages_to_mb(highend_pfn - highstart_pfn));
  305. num_physpages = highend_pfn;
  306. high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
  307. #else
  308. num_physpages = max_low_pfn;
  309. high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
  310. #endif
  311. #ifdef CONFIG_FLATMEM
  312. max_mapnr = num_physpages;
  313. #endif
  314. printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
  315. pages_to_mb(max_low_pfn));
  316. setup_bootmem_allocator();
  317. return max_low_pfn;
  318. }
  319. void __init zone_sizes_init(void)
  320. {
  321. unsigned long max_zone_pfns[MAX_NR_ZONES];
  322. memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
  323. max_zone_pfns[ZONE_DMA] =
  324. virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
  325. max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
  326. #ifdef CONFIG_HIGHMEM
  327. max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
  328. add_active_range(0, 0, highend_pfn);
  329. #else
  330. add_active_range(0, 0, max_low_pfn);
  331. #endif
  332. free_area_init_nodes(max_zone_pfns);
  333. }
  334. #else
  335. extern unsigned long __init setup_memory(void);
  336. extern void zone_sizes_init(void);
  337. #endif /* !CONFIG_NEED_MULTIPLE_NODES */
  338. void __init setup_bootmem_allocator(void)
  339. {
  340. unsigned long bootmap_size;
  341. /*
  342. * Initialize the boot-time allocator (with low memory only):
  343. */
  344. bootmap_size = init_bootmem(min_low_pfn, max_low_pfn);
  345. register_bootmem_low_pages(max_low_pfn);
  346. /*
  347. * Reserve the bootmem bitmap itself as well. We do this in two
  348. * steps (first step was init_bootmem()) because this catches
  349. * the (very unlikely) case of us accidentally initializing the
  350. * bootmem allocator with an invalid RAM area.
  351. */
  352. reserve_bootmem(__pa_symbol(_text), (PFN_PHYS(min_low_pfn) +
  353. bootmap_size + PAGE_SIZE-1) - __pa_symbol(_text));
  354. /*
  355. * reserve physical page 0 - it's a special BIOS page on many boxes,
  356. * enabling clean reboots, SMP operation, laptop functions.
  357. */
  358. reserve_bootmem(0, PAGE_SIZE);
  359. /* reserve EBDA region, it's a 4K region */
  360. reserve_ebda_region();
  361. /* could be an AMD 768MPX chipset. Reserve a page before VGA to prevent
  362. PCI prefetch into it (errata #56). Usually the page is reserved anyways,
  363. unless you have no PS/2 mouse plugged in. */
  364. if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
  365. boot_cpu_data.x86 == 6)
  366. reserve_bootmem(0xa0000 - 4096, 4096);
  367. #ifdef CONFIG_SMP
  368. /*
  369. * But first pinch a few for the stack/trampoline stuff
  370. * FIXME: Don't need the extra page at 4K, but need to fix
  371. * trampoline before removing it. (see the GDT stuff)
  372. */
  373. reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
  374. #endif
  375. #ifdef CONFIG_ACPI_SLEEP
  376. /*
  377. * Reserve low memory region for sleep support.
  378. */
  379. acpi_reserve_bootmem();
  380. #endif
  381. #ifdef CONFIG_X86_FIND_SMP_CONFIG
  382. /*
  383. * Find and reserve possible boot-time SMP configuration:
  384. */
  385. find_smp_config();
  386. #endif
  387. numa_kva_reserve();
  388. #ifdef CONFIG_BLK_DEV_INITRD
  389. if (LOADER_TYPE && INITRD_START) {
  390. if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
  391. reserve_bootmem(INITRD_START, INITRD_SIZE);
  392. initrd_start = INITRD_START + PAGE_OFFSET;
  393. initrd_end = initrd_start+INITRD_SIZE;
  394. }
  395. else {
  396. printk(KERN_ERR "initrd extends beyond end of memory "
  397. "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
  398. INITRD_START + INITRD_SIZE,
  399. max_low_pfn << PAGE_SHIFT);
  400. initrd_start = 0;
  401. }
  402. }
  403. #endif
  404. #ifdef CONFIG_KEXEC
  405. if (crashk_res.start != crashk_res.end)
  406. reserve_bootmem(crashk_res.start,
  407. crashk_res.end - crashk_res.start + 1);
  408. #endif
  409. }
  410. /*
  411. * The node 0 pgdat is initialized before all of these because
  412. * it's needed for bootmem. node>0 pgdats have their virtual
  413. * space allocated before the pagetables are in place to access
  414. * them, so they can't be cleared then.
  415. *
  416. * This should all compile down to nothing when NUMA is off.
  417. */
  418. void __init remapped_pgdat_init(void)
  419. {
  420. int nid;
  421. for_each_online_node(nid) {
  422. if (nid != 0)
  423. memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
  424. }
  425. }
  426. #ifdef CONFIG_MCA
  427. static void set_mca_bus(int x)
  428. {
  429. MCA_bus = x;
  430. }
  431. #else
  432. static void set_mca_bus(int x) { }
  433. #endif
  434. /* Overridden in paravirt.c if CONFIG_PARAVIRT */
  435. char * __init __attribute__((weak)) memory_setup(void)
  436. {
  437. return machine_specific_memory_setup();
  438. }
  439. /*
  440. * Determine if we were loaded by an EFI loader. If so, then we have also been
  441. * passed the efi memmap, systab, etc., so we should use these data structures
  442. * for initialization. Note, the efi init code path is determined by the
  443. * global efi_enabled. This allows the same kernel image to be used on existing
  444. * systems (with a traditional BIOS) as well as on EFI systems.
  445. */
  446. void __init setup_arch(char **cmdline_p)
  447. {
  448. unsigned long max_low_pfn;
  449. memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
  450. pre_setup_arch_hook();
  451. early_cpu_init();
  452. /*
  453. * FIXME: This isn't an official loader_type right
  454. * now but does currently work with elilo.
  455. * If we were configured as an EFI kernel, check to make
  456. * sure that we were loaded correctly from elilo and that
  457. * the system table is valid. If not, then initialize normally.
  458. */
  459. #ifdef CONFIG_EFI
  460. if ((LOADER_TYPE == 0x50) && EFI_SYSTAB)
  461. efi_enabled = 1;
  462. #endif
  463. ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
  464. screen_info = SCREEN_INFO;
  465. edid_info = EDID_INFO;
  466. apm_info.bios = APM_BIOS_INFO;
  467. ist_info = IST_INFO;
  468. saved_videomode = VIDEO_MODE;
  469. if( SYS_DESC_TABLE.length != 0 ) {
  470. set_mca_bus(SYS_DESC_TABLE.table[3] & 0x2);
  471. machine_id = SYS_DESC_TABLE.table[0];
  472. machine_submodel_id = SYS_DESC_TABLE.table[1];
  473. BIOS_revision = SYS_DESC_TABLE.table[2];
  474. }
  475. bootloader_type = LOADER_TYPE;
  476. #ifdef CONFIG_BLK_DEV_RAM
  477. rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
  478. rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
  479. rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
  480. #endif
  481. ARCH_SETUP
  482. if (efi_enabled)
  483. efi_init();
  484. else {
  485. printk(KERN_INFO "BIOS-provided physical RAM map:\n");
  486. print_memory_map(memory_setup());
  487. }
  488. copy_edd();
  489. if (!MOUNT_ROOT_RDONLY)
  490. root_mountflags &= ~MS_RDONLY;
  491. init_mm.start_code = (unsigned long) _text;
  492. init_mm.end_code = (unsigned long) _etext;
  493. init_mm.end_data = (unsigned long) _edata;
  494. init_mm.brk = init_pg_tables_end + PAGE_OFFSET;
  495. code_resource.start = virt_to_phys(_text);
  496. code_resource.end = virt_to_phys(_etext)-1;
  497. data_resource.start = virt_to_phys(_etext);
  498. data_resource.end = virt_to_phys(_edata)-1;
  499. parse_early_param();
  500. if (user_defined_memmap) {
  501. printk(KERN_INFO "user-defined physical RAM map:\n");
  502. print_memory_map("user");
  503. }
  504. strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
  505. *cmdline_p = command_line;
  506. max_low_pfn = setup_memory();
  507. #ifdef CONFIG_VMI
  508. /*
  509. * Must be after max_low_pfn is determined, and before kernel
  510. * pagetables are setup.
  511. */
  512. vmi_init();
  513. #endif
  514. /*
  515. * NOTE: before this point _nobody_ is allowed to allocate
  516. * any memory using the bootmem allocator. Although the
  517. * alloctor is now initialised only the first 8Mb of the kernel
  518. * virtual address space has been mapped. All allocations before
  519. * paging_init() has completed must use the alloc_bootmem_low_pages()
  520. * variant (which allocates DMA'able memory) and care must be taken
  521. * not to exceed the 8Mb limit.
  522. */
  523. #ifdef CONFIG_SMP
  524. smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
  525. #endif
  526. paging_init();
  527. remapped_pgdat_init();
  528. sparse_init();
  529. zone_sizes_init();
  530. /*
  531. * NOTE: at this point the bootmem allocator is fully available.
  532. */
  533. dmi_scan_machine();
  534. #ifdef CONFIG_X86_GENERICARCH
  535. generic_apic_probe();
  536. #endif
  537. if (efi_enabled)
  538. efi_map_memmap();
  539. #ifdef CONFIG_ACPI
  540. /*
  541. * Parse the ACPI tables for possible boot-time SMP configuration.
  542. */
  543. acpi_boot_table_init();
  544. #endif
  545. #ifdef CONFIG_PCI
  546. #ifdef CONFIG_X86_IO_APIC
  547. check_acpi_pci(); /* Checks more than just ACPI actually */
  548. #endif
  549. #endif
  550. #ifdef CONFIG_ACPI
  551. acpi_boot_init();
  552. #if defined(CONFIG_SMP) && defined(CONFIG_X86_PC)
  553. if (def_to_bigsmp)
  554. printk(KERN_WARNING "More than 8 CPUs detected and "
  555. "CONFIG_X86_PC cannot handle it.\nUse "
  556. "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
  557. #endif
  558. #endif
  559. #ifdef CONFIG_X86_LOCAL_APIC
  560. if (smp_found_config)
  561. get_smp_config();
  562. #endif
  563. e820_register_memory();
  564. #ifdef CONFIG_VT
  565. #if defined(CONFIG_VGA_CONSOLE)
  566. if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
  567. conswitchp = &vga_con;
  568. #elif defined(CONFIG_DUMMY_CONSOLE)
  569. conswitchp = &dummy_con;
  570. #endif
  571. #endif
  572. }