aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r--arch/x86/kernel/setup_32.c95
1 files changed, 78 insertions, 17 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index 2b3e5d45176b..5b0bffb7fcc9 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -62,8 +62,9 @@
62#include <asm/io.h> 62#include <asm/io.h>
63#include <asm/vmi.h> 63#include <asm/vmi.h>
64#include <setup_arch.h> 64#include <setup_arch.h>
65#include <bios_ebda.h> 65#include <asm/bios_ebda.h>
66#include <asm/cacheflush.h> 66#include <asm/cacheflush.h>
67#include <asm/processor.h>
67 68
68/* This value is set up by the early boot code to point to the value 69/* This value is set up by the early boot code to point to the value
69 immediately after the boot time page tables. It contains a *physical* 70 immediately after the boot time page tables. It contains a *physical*
@@ -154,6 +155,8 @@ struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
154struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 155struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
155EXPORT_SYMBOL(boot_cpu_data); 156EXPORT_SYMBOL(boot_cpu_data);
156 157
158unsigned int def_to_bigsmp;
159
157#ifndef CONFIG_X86_PAE 160#ifndef CONFIG_X86_PAE
158unsigned long mmu_cr4_features; 161unsigned long mmu_cr4_features;
159#else 162#else
@@ -189,7 +192,7 @@ EXPORT_SYMBOL(ist_info);
189extern void early_cpu_init(void); 192extern void early_cpu_init(void);
190extern int root_mountflags; 193extern int root_mountflags;
191 194
192unsigned long saved_videomode; 195unsigned long saved_video_mode;
193 196
194#define RAMDISK_IMAGE_START_MASK 0x07FF 197#define RAMDISK_IMAGE_START_MASK 0x07FF
195#define RAMDISK_PROMPT_FLAG 0x8000 198#define RAMDISK_PROMPT_FLAG 0x8000
@@ -227,7 +230,7 @@ static inline void copy_edd(void)
227} 230}
228#endif 231#endif
229 232
230int __initdata user_defined_memmap = 0; 233int __initdata user_defined_memmap;
231 234
232/* 235/*
233 * "mem=nopentium" disables the 4MB page tables. 236 * "mem=nopentium" disables the 4MB page tables.
@@ -385,15 +388,56 @@ unsigned long __init find_max_low_pfn(void)
385 return max_low_pfn; 388 return max_low_pfn;
386} 389}
387 390
391#define BIOS_EBDA_SEGMENT 0x40E
392#define BIOS_LOWMEM_KILOBYTES 0x413
393
388/* 394/*
389 * workaround for Dell systems that neglect to reserve EBDA 395 * The BIOS places the EBDA/XBDA at the top of conventional
396 * memory, and usually decreases the reported amount of
397 * conventional memory (int 0x12) too. This also contains a
398 * workaround for Dell systems that neglect to reserve EBDA.
399 * The same workaround also avoids a problem with the AMD768MPX
400 * chipset: reserve a page before VGA to prevent PCI prefetch
401 * into it (errata #56). Usually the page is reserved anyways,
402 * unless you have no PS/2 mouse plugged in.
390 */ 403 */
391static void __init reserve_ebda_region(void) 404static void __init reserve_ebda_region(void)
392{ 405{
393 unsigned int addr; 406 unsigned int lowmem, ebda_addr;
394 addr = get_bios_ebda(); 407
395 if (addr) 408 /* To determine the position of the EBDA and the */
396 reserve_bootmem(addr, PAGE_SIZE, BOOTMEM_DEFAULT); 409 /* end of conventional memory, we need to look at */
410 /* the BIOS data area. In a paravirtual environment */
411 /* that area is absent. We'll just have to assume */
412 /* that the paravirt case can handle memory setup */
413 /* correctly, without our help. */
414 if (paravirt_enabled())
415 return;
416
417 /* end of low (conventional) memory */
418 lowmem = *(unsigned short *)__va(BIOS_LOWMEM_KILOBYTES);
419 lowmem <<= 10;
420
421 /* start of EBDA area */
422 ebda_addr = *(unsigned short *)__va(BIOS_EBDA_SEGMENT);
423 ebda_addr <<= 4;
424
425 /* Fixup: bios puts an EBDA in the top 64K segment */
426 /* of conventional memory, but does not adjust lowmem. */
427 if ((lowmem - ebda_addr) <= 0x10000)
428 lowmem = ebda_addr;
429
430 /* Fixup: bios does not report an EBDA at all. */
431 /* Some old Dells seem to need 4k anyhow (bugzilla 2990) */
432 if ((ebda_addr == 0) && (lowmem >= 0x9f000))
433 lowmem = 0x9f000;
434
435 /* Paranoia: should never happen, but... */
436 if ((lowmem == 0) || (lowmem >= 0x100000))
437 lowmem = 0x9f000;
438
439 /* reserve all memory between lowmem and the 1MB mark */
440 reserve_bootmem(lowmem, 0x100000 - lowmem, BOOTMEM_DEFAULT);
397} 441}
398 442
399#ifndef CONFIG_NEED_MULTIPLE_NODES 443#ifndef CONFIG_NEED_MULTIPLE_NODES
@@ -617,16 +661,9 @@ void __init setup_bootmem_allocator(void)
617 */ 661 */
618 reserve_bootmem(0, PAGE_SIZE, BOOTMEM_DEFAULT); 662 reserve_bootmem(0, PAGE_SIZE, BOOTMEM_DEFAULT);
619 663
620 /* reserve EBDA region, it's a 4K region */ 664 /* reserve EBDA region */
621 reserve_ebda_region(); 665 reserve_ebda_region();
622 666
623 /* could be an AMD 768MPX chipset. Reserve a page before VGA to prevent
624 PCI prefetch into it (errata #56). Usually the page is reserved anyways,
625 unless you have no PS/2 mouse plugged in. */
626 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
627 boot_cpu_data.x86 == 6)
628 reserve_bootmem(0xa0000 - 4096, 4096, BOOTMEM_DEFAULT);
629
630#ifdef CONFIG_SMP 667#ifdef CONFIG_SMP
631 /* 668 /*
632 * But first pinch a few for the stack/trampoline stuff 669 * But first pinch a few for the stack/trampoline stuff
@@ -687,6 +724,18 @@ char * __init __attribute__((weak)) memory_setup(void)
687 return machine_specific_memory_setup(); 724 return machine_specific_memory_setup();
688} 725}
689 726
727#ifdef CONFIG_NUMA
728/*
729 * In the golden day, when everything among i386 and x86_64 will be
730 * integrated, this will not live here
731 */
732void *x86_cpu_to_node_map_early_ptr;
733int x86_cpu_to_node_map_init[NR_CPUS] = {
734 [0 ... NR_CPUS-1] = NUMA_NO_NODE
735};
736DEFINE_PER_CPU(int, x86_cpu_to_node_map) = NUMA_NO_NODE;
737#endif
738
690/* 739/*
691 * Determine if we were loaded by an EFI loader. If so, then we have also been 740 * Determine if we were loaded by an EFI loader. If so, then we have also been
692 * passed the efi memmap, systab, etc., so we should use these data structures 741 * passed the efi memmap, systab, etc., so we should use these data structures
@@ -714,7 +763,7 @@ void __init setup_arch(char **cmdline_p)
714 edid_info = boot_params.edid_info; 763 edid_info = boot_params.edid_info;
715 apm_info.bios = boot_params.apm_bios_info; 764 apm_info.bios = boot_params.apm_bios_info;
716 ist_info = boot_params.ist_info; 765 ist_info = boot_params.ist_info;
717 saved_videomode = boot_params.hdr.vid_mode; 766 saved_video_mode = boot_params.hdr.vid_mode;
718 if( boot_params.sys_desc_table.length != 0 ) { 767 if( boot_params.sys_desc_table.length != 0 ) {
719 set_mca_bus(boot_params.sys_desc_table.table[3] & 0x2); 768 set_mca_bus(boot_params.sys_desc_table.table[3] & 0x2);
720 machine_id = boot_params.sys_desc_table.table[0]; 769 machine_id = boot_params.sys_desc_table.table[0];
@@ -820,6 +869,18 @@ void __init setup_arch(char **cmdline_p)
820 869
821 io_delay_init(); 870 io_delay_init();
822 871
872#ifdef CONFIG_X86_SMP
873 /*
874 * setup to use the early static init tables during kernel startup
875 * X86_SMP will exclude sub-arches that don't deal well with it.
876 */
877 x86_cpu_to_apicid_early_ptr = (void *)x86_cpu_to_apicid_init;
878 x86_bios_cpu_apicid_early_ptr = (void *)x86_bios_cpu_apicid_init;
879#ifdef CONFIG_NUMA
880 x86_cpu_to_node_map_early_ptr = (void *)x86_cpu_to_node_map_init;
881#endif
882#endif
883
823#ifdef CONFIG_X86_GENERICARCH 884#ifdef CONFIG_X86_GENERICARCH
824 generic_apic_probe(); 885 generic_apic_probe();
825#endif 886#endif