aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c71
1 files changed, 32 insertions, 39 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 531b55b8e81a..9838f2539dfc 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -57,12 +57,8 @@
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/user.h> 58#include <linux/user.h>
59#include <linux/delay.h> 59#include <linux/delay.h>
60#include <linux/highmem.h>
61 60
62#include <linux/kallsyms.h> 61#include <linux/kallsyms.h>
63#include <linux/edd.h>
64#include <linux/iscsi_ibft.h>
65#include <linux/kexec.h>
66#include <linux/cpufreq.h> 62#include <linux/cpufreq.h>
67#include <linux/dma-mapping.h> 63#include <linux/dma-mapping.h>
68#include <linux/ctype.h> 64#include <linux/ctype.h>
@@ -96,7 +92,7 @@
96#include <asm/smp.h> 92#include <asm/smp.h>
97#include <asm/desc.h> 93#include <asm/desc.h>
98#include <asm/dma.h> 94#include <asm/dma.h>
99#include <asm/gart.h> 95#include <asm/iommu.h>
100#include <asm/mmu_context.h> 96#include <asm/mmu_context.h>
101#include <asm/proto.h> 97#include <asm/proto.h>
102 98
@@ -104,7 +100,6 @@
104#include <asm/paravirt.h> 100#include <asm/paravirt.h>
105 101
106#include <asm/percpu.h> 102#include <asm/percpu.h>
107#include <asm/sections.h>
108#include <asm/topology.h> 103#include <asm/topology.h>
109#include <asm/apicdef.h> 104#include <asm/apicdef.h>
110#ifdef CONFIG_X86_64 105#ifdef CONFIG_X86_64
@@ -450,7 +445,7 @@ static void __init reserve_early_setup_data(void)
450 * @size: Size of the crashkernel memory to reserve. 445 * @size: Size of the crashkernel memory to reserve.
451 * Returns the base address on success, and -1ULL on failure. 446 * Returns the base address on success, and -1ULL on failure.
452 */ 447 */
453unsigned long long find_and_reserve_crashkernel(unsigned long long size) 448unsigned long long __init find_and_reserve_crashkernel(unsigned long long size)
454{ 449{
455 const unsigned long long alignment = 16<<20; /* 16M */ 450 const unsigned long long alignment = 16<<20; /* 16M */
456 unsigned long long start = 0LL; 451 unsigned long long start = 0LL;
@@ -579,6 +574,10 @@ static int __init setup_elfcorehdr(char *arg)
579early_param("elfcorehdr", setup_elfcorehdr); 574early_param("elfcorehdr", setup_elfcorehdr);
580#endif 575#endif
581 576
577static struct x86_quirks default_x86_quirks __initdata;
578
579struct x86_quirks *x86_quirks __initdata = &default_x86_quirks;
580
582/* 581/*
583 * Determine if we were loaded by an EFI loader. If so, then we have also been 582 * Determine if we were loaded by an EFI loader. If so, then we have also been
584 * passed the efi memmap, systab, etc., so we should use these data structures 583 * passed the efi memmap, systab, etc., so we should use these data structures
@@ -598,11 +597,11 @@ void __init setup_arch(char **cmdline_p)
598 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); 597 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
599 visws_early_detect(); 598 visws_early_detect();
600 pre_setup_arch_hook(); 599 pre_setup_arch_hook();
601 early_cpu_init();
602#else 600#else
603 printk(KERN_INFO "Command line: %s\n", boot_command_line); 601 printk(KERN_INFO "Command line: %s\n", boot_command_line);
604#endif 602#endif
605 603
604 early_cpu_init();
606 early_ioremap_init(); 605 early_ioremap_init();
607 606
608 ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev); 607 ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
@@ -666,14 +665,23 @@ void __init setup_arch(char **cmdline_p)
666 bss_resource.start = virt_to_phys(&__bss_start); 665 bss_resource.start = virt_to_phys(&__bss_start);
667 bss_resource.end = virt_to_phys(&__bss_stop)-1; 666 bss_resource.end = virt_to_phys(&__bss_stop)-1;
668 667
669#ifdef CONFIG_X86_64
670 early_cpu_init();
671#endif
672 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); 668 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
673 *cmdline_p = command_line; 669 *cmdline_p = command_line;
674 670
675 parse_early_param(); 671 parse_early_param();
676 672
673#ifdef CONFIG_X86_64
674 check_efer();
675#endif
676
677#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
678 /*
679 * Must be before kernel pagetables are setup
680 * or fixmap area is touched.
681 */
682 vmi_init();
683#endif
684
677 /* after early param, so could get panic from serial */ 685 /* after early param, so could get panic from serial */
678 reserve_early_setup_data(); 686 reserve_early_setup_data();
679 687
@@ -681,7 +689,7 @@ void __init setup_arch(char **cmdline_p)
681#ifdef CONFIG_X86_LOCAL_APIC 689#ifdef CONFIG_X86_LOCAL_APIC
682 disable_apic = 1; 690 disable_apic = 1;
683#endif 691#endif
684 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC); 692 setup_clear_cpu_cap(X86_FEATURE_APIC);
685 } 693 }
686 694
687#ifdef CONFIG_PCI 695#ifdef CONFIG_PCI
@@ -734,7 +742,6 @@ void __init setup_arch(char **cmdline_p)
734#else 742#else
735 num_physpages = max_pfn; 743 num_physpages = max_pfn;
736 744
737 check_efer();
738 745
739 /* How many end-of-memory variables you have, grandma! */ 746 /* How many end-of-memory variables you have, grandma! */
740 /* need this before calling reserve_initrd */ 747 /* need this before calling reserve_initrd */
@@ -792,10 +799,6 @@ void __init setup_arch(char **cmdline_p)
792 799
793 initmem_init(0, max_pfn); 800 initmem_init(0, max_pfn);
794 801
795#ifdef CONFIG_X86_64
796 dma32_reserve_bootmem();
797#endif
798
799#ifdef CONFIG_ACPI_SLEEP 802#ifdef CONFIG_ACPI_SLEEP
800 /* 803 /*
801 * Reserve low memory region for sleep support. 804 * Reserve low memory region for sleep support.
@@ -810,21 +813,25 @@ void __init setup_arch(char **cmdline_p)
810#endif 813#endif
811 reserve_crashkernel(); 814 reserve_crashkernel();
812 815
816#ifdef CONFIG_X86_64
817 /*
818 * dma32_reserve_bootmem() allocates bootmem which may conflict
819 * with the crashkernel command line, so do that after
820 * reserve_crashkernel()
821 */
822 dma32_reserve_bootmem();
823#endif
824
813 reserve_ibft_region(); 825 reserve_ibft_region();
814 826
815#ifdef CONFIG_KVM_CLOCK 827#ifdef CONFIG_KVM_CLOCK
816 kvmclock_init(); 828 kvmclock_init();
817#endif 829#endif
818 830
819#if defined(CONFIG_VMI) && defined(CONFIG_X86_32) 831 paravirt_pagetable_setup_start(swapper_pg_dir);
820 /*
821 * Must be after max_low_pfn is determined, and before kernel
822 * pagetables are setup.
823 */
824 vmi_init();
825#endif
826
827 paging_init(); 832 paging_init();
833 paravirt_pagetable_setup_done(swapper_pg_dir);
834 paravirt_post_allocator_init();
828 835
829#ifdef CONFIG_X86_64 836#ifdef CONFIG_X86_64
830 map_vsyscall(); 837 map_vsyscall();
@@ -854,23 +861,9 @@ void __init setup_arch(char **cmdline_p)
854 init_cpu_to_node(); 861 init_cpu_to_node();
855#endif 862#endif
856 863
857#ifdef CONFIG_X86_NUMAQ
858 /*
859 * need to check online nodes num, call it
860 * here before time_init/tsc_init
861 */
862 numaq_tsc_disable();
863#endif
864
865 init_apic_mappings(); 864 init_apic_mappings();
866 ioapic_init_mappings(); 865 ioapic_init_mappings();
867 866
868#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC) && defined(CONFIG_X86_32)
869 if (def_to_bigsmp)
870 printk(KERN_WARNING "More than 8 CPUs detected and "
871 "CONFIG_X86_PC cannot handle it.\nUse "
872 "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
873#endif
874 kvm_guest_init(); 867 kvm_guest_init();
875 868
876 e820_reserve_resources(); 869 e820_reserve_resources();