]> xenbits.xensource.com Git - xen.git/commitdiff
bitkeeper revision 1.1159.127.1 (4177edc2yMpJyLOU9Q_EQYFZXYJiIw)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 21 Oct 2004 17:11:30 +0000 (17:11 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 21 Oct 2004 17:11:30 +0000 (17:11 +0000)
Fix option ``noht'' for machines which report HT logical cpus in their MP tables.

xen/arch/x86/setup.c
xen/arch/x86/smpboot.c
xen/common/dom0_ops.c
xen/include/xen/smp.h

index 975f8a4724bb40fb1791e77e72eef8482f1fe528..b565bbd083daa4a2698e8c4877959fa4f04ad74b 100644 (file)
@@ -23,7 +23,7 @@ extern void time_init(void);
 extern void ac_timer_init(void);
 extern void initialize_keytable();
 extern int opt_nosmp, opt_watchdog, opt_noacpi;
-extern int opt_ignorebiostables, opt_noht;
+extern int opt_ignorebiostables;
 extern int do_timer_lists_from_pit;
 
 char ignore_irq13;             /* set if exception 16 works */
@@ -116,12 +116,6 @@ static void __init init_intel(struct cpuinfo_x86 *c)
     if ( c->x86 == 6 && c->x86_model < 3 && c->x86_mask < 3 )
         clear_bit(X86_FEATURE_SEP, &c->x86_capability);
 
-    if ( opt_noht )
-    {
-        opt_noacpi = 1; /* Virtual CPUs only appear in ACPI tables. */
-        clear_bit(X86_FEATURE_HT, &c->x86_capability[0]);
-    }
-
 #ifdef CONFIG_SMP
     if ( test_bit(X86_FEATURE_HT, &c->x86_capability) )
     {
@@ -129,8 +123,11 @@ static void __init init_intel(struct cpuinfo_x86 *c)
         int     initial_apic_id, siblings, cpu = smp_processor_id();
         
         cpuid(1, &eax, &ebx, &ecx, &edx);
-        siblings = (ebx & 0xff0000) >> 16;
-        
+        ht_per_core = siblings = (ebx & 0xff0000) >> 16;
+
+        if ( opt_noht )
+            clear_bit(X86_FEATURE_HT, &c->x86_capability[0]);
+
         if ( siblings <= 1 )
         {
             printk(KERN_INFO  "CPU#%d: Hyper-Threading is disabled\n", cpu);
index bd9c0951ec760b50f9da1a3f275d3fdf4df93bbc..a8017a4a65bdb3ddf9d77d69cf58e72ba709a99c 100644 (file)
@@ -57,6 +57,9 @@ static int max_cpus = -1;
 /* Total count of live CPUs */
 int smp_num_cpus = 1;
 
+/* Number of hyperthreads per core */
+int ht_per_core = 1;
+
 /* Bitmask of currently online CPUs */
 unsigned long cpu_online_map;
 
@@ -868,6 +871,12 @@ void __init smp_boot_cpus(void)
         if (apicid == boot_cpu_apicid)
             continue;
 
+        /* 
+         * Don't start hyperthreads if option noht requested.
+         */
+        if (opt_noht && (apicid & (ht_per_core - 1)))
+            continue;
+
         if (!(phys_cpu_present_map & (1 << bit)))
             continue;
         if ((max_cpus >= 0) && (max_cpus <= cpucount+1))
index 12762d1af90f2ea25fc2942d6b4e58c14e2532e1..ed2785a0ea758309e2a15b78d91a574833f01423 100644 (file)
@@ -498,16 +498,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
 
     case DOM0_PHYSINFO:
     {
-        extern int phys_proc_id[];
-
         dom0_physinfo_t *pi = &op->u.physinfo;
 
-        int old_id = phys_proc_id[0];
-        int ht = 0;
-
-        while( ( ht < smp_num_cpus ) && ( phys_proc_id[ht] == old_id ) ) ht++;
-
-        pi->ht_per_core = ht;
+        pi->ht_per_core = opt_noht ? 1 : ht_per_core;
         pi->cores       = smp_num_cpus / pi->ht_per_core;
         pi->total_pages = max_page;
         pi->free_pages  = avail_domheap_pages();
index 12885a503744adaa0dbaea4f21a119335ccd4439..13e370cdcac8e3144cff31754dda86ae1d0373b9 100644 (file)
@@ -52,6 +52,8 @@ extern int smp_call_function (void (*func) (void *info), void *info,
 extern int smp_threads_ready;
 
 extern int smp_num_cpus;
+extern int ht_per_core;
+extern int opt_noht;
 
 extern volatile unsigned long smp_msg_data;
 extern volatile int smp_src_cpu;