direct-io.hg

changeset 5214:ca9531e574f4

bitkeeper revision 1.1601 (429c1ed4wKexKmX-ibC6x3hHrciDNQ)

Fix CPU detection and initialisation. We now do early detection very
early, but pushed full initialisation to somewhat later when other
infrastructure is properly ready.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue May 31 08:22:44 2005 +0000 (2005-05-31)
parents 0c6cce9d9b82
children 69acd57e1bd8
files xen/arch/x86/apic.c xen/arch/x86/cpu/common.c xen/arch/x86/setup.c
line diff
     1.1 --- a/xen/arch/x86/apic.c	Mon May 30 23:43:01 2005 +0000
     1.2 +++ b/xen/arch/x86/apic.c	Tue May 31 08:22:44 2005 +0000
     1.3 @@ -493,14 +493,13 @@ custom_param("apic_verbosity", apic_set_
     1.4  static int __init detect_init_APIC (void)
     1.5  {
     1.6      u32 h, l, features;
     1.7 -    extern void get_cpu_vendor(struct cpuinfo_x86*);
     1.8  
     1.9      /* Disabled by kernel option? */
    1.10      if (enable_local_apic < 0)
    1.11          return -1;
    1.12  
    1.13      /* Workaround for us being called before identify_cpu(). */
    1.14 -    get_cpu_vendor(&boot_cpu_data);
    1.15 +    /*get_cpu_vendor(&boot_cpu_data); Not for Xen */
    1.16  
    1.17      switch (boot_cpu_data.x86_vendor) {
    1.18      case X86_VENDOR_AMD:
     2.1 --- a/xen/arch/x86/cpu/common.c	Mon May 30 23:43:01 2005 +0000
     2.2 +++ b/xen/arch/x86/cpu/common.c	Tue May 31 08:22:44 2005 +0000
     2.3 @@ -223,6 +223,7 @@ void __init early_cpu_detect(void)
     2.4  		c->x86_mask = tfms & 15;
     2.5  		if (cap0 & (1<<19))
     2.6  			c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
     2.7 +		c->x86_capability[0] = cap0; /* Added for Xen bootstrap */
     2.8  	}
     2.9  
    2.10  	early_intel_workaround(c);
     3.1 --- a/xen/arch/x86/setup.c	Mon May 30 23:43:01 2005 +0000
     3.2 +++ b/xen/arch/x86/setup.c	Tue May 31 08:22:44 2005 +0000
     3.3 @@ -85,7 +85,7 @@ extern void early_cpu_init(void);
     3.4  
     3.5  extern unsigned long cpu0_stack[];
     3.6  
     3.7 -struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1 };
     3.8 +struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
     3.9  
    3.10  #if defined(CONFIG_X86_64)
    3.11  unsigned long mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE;
    3.12 @@ -144,6 +144,8 @@ static void __init start_of_day(void)
    3.13  {
    3.14      int i;
    3.15  
    3.16 +    early_cpu_init();
    3.17 +
    3.18      /* Unmap the first page of CPU0's stack. */
    3.19      memguard_guard_stack(cpu0_stack);
    3.20  
    3.21 @@ -161,14 +163,6 @@ static void __init start_of_day(void)
    3.22          GDT_VIRT_START(current) + FIRST_RESERVED_GDT_BYTE,
    3.23          virt_to_phys(gdt_table) >> PAGE_SHIFT, 1, PAGE_HYPERVISOR);
    3.24  
    3.25 -    /* Process CPU type information. */
    3.26 -    early_cpu_init();
    3.27 -    identify_cpu(&boot_cpu_data);
    3.28 -    if ( cpu_has_fxsr )
    3.29 -        set_in_cr4(X86_CR4_OSFXSR);
    3.30 -    if ( cpu_has_xmm )
    3.31 -        set_in_cr4(X86_CR4_OSXMMEXCPT);
    3.32 -
    3.33      find_smp_config();
    3.34  
    3.35      smp_alloc_memory();
    3.36 @@ -199,6 +193,12 @@ static void __init start_of_day(void)
    3.37  
    3.38      scheduler_init();	
    3.39  
    3.40 +    identify_cpu(&boot_cpu_data);
    3.41 +    if ( cpu_has_fxsr )
    3.42 +        set_in_cr4(X86_CR4_OSFXSR);
    3.43 +    if ( cpu_has_xmm )
    3.44 +        set_in_cr4(X86_CR4_OSXMMEXCPT);
    3.45 +
    3.46      if ( opt_nosmp )
    3.47          max_cpus = 0;
    3.48      smp_prepare_cpus(max_cpus);