[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix CPU detection and initialisation. We now do early detection very



ChangeSet 1.1601, 2005/05/31 09:22:44+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        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@xxxxxxxxxxxxx>



 apic.c       |    3 +--
 cpu/common.c |    1 +
 setup.c      |   18 +++++++++---------
 3 files changed, 11 insertions(+), 11 deletions(-)


diff -Nru a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c       2005-05-31 05:01:51 -04:00
+++ b/xen/arch/x86/apic.c       2005-05-31 05:01:51 -04:00
@@ -493,14 +493,13 @@
 static int __init detect_init_APIC (void)
 {
     u32 h, l, features;
-    extern void get_cpu_vendor(struct cpuinfo_x86*);
 
     /* Disabled by kernel option? */
     if (enable_local_apic < 0)
         return -1;
 
     /* Workaround for us being called before identify_cpu(). */
-    get_cpu_vendor(&boot_cpu_data);
+    /*get_cpu_vendor(&boot_cpu_data); Not for Xen */
 
     switch (boot_cpu_data.x86_vendor) {
     case X86_VENDOR_AMD:
diff -Nru a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c 2005-05-31 05:01:51 -04:00
+++ b/xen/arch/x86/cpu/common.c 2005-05-31 05:01:51 -04:00
@@ -223,6 +223,7 @@
                c->x86_mask = tfms & 15;
                if (cap0 & (1<<19))
                        c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
+               c->x86_capability[0] = cap0; /* Added for Xen bootstrap */
        }
 
        early_intel_workaround(c);
diff -Nru a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      2005-05-31 05:01:51 -04:00
+++ b/xen/arch/x86/setup.c      2005-05-31 05:01:51 -04:00
@@ -85,7 +85,7 @@
 
 extern unsigned long cpu0_stack[];
 
-struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1 };
+struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
 
 #if defined(CONFIG_X86_64)
 unsigned long mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE;
@@ -144,6 +144,8 @@
 {
     int i;
 
+    early_cpu_init();
+
     /* Unmap the first page of CPU0's stack. */
     memguard_guard_stack(cpu0_stack);
 
@@ -161,14 +163,6 @@
         GDT_VIRT_START(current) + FIRST_RESERVED_GDT_BYTE,
         virt_to_phys(gdt_table) >> PAGE_SHIFT, 1, PAGE_HYPERVISOR);
 
-    /* Process CPU type information. */
-    early_cpu_init();
-    identify_cpu(&boot_cpu_data);
-    if ( cpu_has_fxsr )
-        set_in_cr4(X86_CR4_OSFXSR);
-    if ( cpu_has_xmm )
-        set_in_cr4(X86_CR4_OSXMMEXCPT);
-
     find_smp_config();
 
     smp_alloc_memory();
@@ -198,6 +192,12 @@
     arch_init_memory();
 
     scheduler_init();  
+
+    identify_cpu(&boot_cpu_data);
+    if ( cpu_has_fxsr )
+        set_in_cr4(X86_CR4_OSFXSR);
+    if ( cpu_has_xmm )
+        set_in_cr4(X86_CR4_OSXMMEXCPT);
 
     if ( opt_nosmp )
         max_cpus = 0;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.