ia64/xen-unstable

changeset 2704:bffd969a5a07

bitkeeper revision 1.1159.123.5 (4177ede7EGpZy4-xUlQEeAnL84bCnw)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xeno.bk-26dom0
author cl349@freefall.cl.cam.ac.uk
date Thu Oct 21 17:12:07 2004 +0000 (2004-10-21)
parents d0beb68a7ae0 744573a15e95
children 3897c6ce9024 41e31d1ac03f
files xen/arch/x86/setup.c xen/arch/x86/smpboot.c xen/common/dom0_ops.c xen/include/xen/smp.h
line diff
     1.1 --- a/xen/arch/x86/setup.c	Thu Oct 21 15:54:48 2004 +0000
     1.2 +++ b/xen/arch/x86/setup.c	Thu Oct 21 17:12:07 2004 +0000
     1.3 @@ -23,7 +23,7 @@ extern void time_init(void);
     1.4  extern void ac_timer_init(void);
     1.5  extern void initialize_keytable();
     1.6  extern int opt_nosmp, opt_watchdog, opt_noacpi;
     1.7 -extern int opt_ignorebiostables, opt_noht;
     1.8 +extern int opt_ignorebiostables;
     1.9  extern int do_timer_lists_from_pit;
    1.10  
    1.11  char ignore_irq13;		/* set if exception 16 works */
    1.12 @@ -116,12 +116,6 @@ static void __init init_intel(struct cpu
    1.13      if ( c->x86 == 6 && c->x86_model < 3 && c->x86_mask < 3 )
    1.14          clear_bit(X86_FEATURE_SEP, &c->x86_capability);
    1.15  
    1.16 -    if ( opt_noht )
    1.17 -    {
    1.18 -        opt_noacpi = 1; /* Virtual CPUs only appear in ACPI tables. */
    1.19 -        clear_bit(X86_FEATURE_HT, &c->x86_capability[0]);
    1.20 -    }
    1.21 -
    1.22  #ifdef CONFIG_SMP
    1.23      if ( test_bit(X86_FEATURE_HT, &c->x86_capability) )
    1.24      {
    1.25 @@ -129,8 +123,11 @@ static void __init init_intel(struct cpu
    1.26          int     initial_apic_id, siblings, cpu = smp_processor_id();
    1.27          
    1.28          cpuid(1, &eax, &ebx, &ecx, &edx);
    1.29 -        siblings = (ebx & 0xff0000) >> 16;
    1.30 -        
    1.31 +        ht_per_core = siblings = (ebx & 0xff0000) >> 16;
    1.32 +
    1.33 +        if ( opt_noht )
    1.34 +            clear_bit(X86_FEATURE_HT, &c->x86_capability[0]);
    1.35 +
    1.36          if ( siblings <= 1 )
    1.37          {
    1.38              printk(KERN_INFO  "CPU#%d: Hyper-Threading is disabled\n", cpu);
     2.1 --- a/xen/arch/x86/smpboot.c	Thu Oct 21 15:54:48 2004 +0000
     2.2 +++ b/xen/arch/x86/smpboot.c	Thu Oct 21 17:12:07 2004 +0000
     2.3 @@ -57,6 +57,9 @@ static int max_cpus = -1;
     2.4  /* Total count of live CPUs */
     2.5  int smp_num_cpus = 1;
     2.6  
     2.7 +/* Number of hyperthreads per core */
     2.8 +int ht_per_core = 1;
     2.9 +
    2.10  /* Bitmask of currently online CPUs */
    2.11  unsigned long cpu_online_map;
    2.12  
    2.13 @@ -868,6 +871,12 @@ void __init smp_boot_cpus(void)
    2.14          if (apicid == boot_cpu_apicid)
    2.15              continue;
    2.16  
    2.17 +        /* 
    2.18 +         * Don't start hyperthreads if option noht requested.
    2.19 +         */
    2.20 +        if (opt_noht && (apicid & (ht_per_core - 1)))
    2.21 +            continue;
    2.22 +
    2.23          if (!(phys_cpu_present_map & (1 << bit)))
    2.24              continue;
    2.25          if ((max_cpus >= 0) && (max_cpus <= cpucount+1))
     3.1 --- a/xen/common/dom0_ops.c	Thu Oct 21 15:54:48 2004 +0000
     3.2 +++ b/xen/common/dom0_ops.c	Thu Oct 21 17:12:07 2004 +0000
     3.3 @@ -498,16 +498,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     3.4  
     3.5      case DOM0_PHYSINFO:
     3.6      {
     3.7 -        extern int phys_proc_id[];
     3.8 -
     3.9          dom0_physinfo_t *pi = &op->u.physinfo;
    3.10  
    3.11 -        int old_id = phys_proc_id[0];
    3.12 -        int ht = 0;
    3.13 -
    3.14 -        while( ( ht < smp_num_cpus ) && ( phys_proc_id[ht] == old_id ) ) ht++;
    3.15 -
    3.16 -        pi->ht_per_core = ht;
    3.17 +        pi->ht_per_core = opt_noht ? 1 : ht_per_core;
    3.18          pi->cores       = smp_num_cpus / pi->ht_per_core;
    3.19          pi->total_pages = max_page;
    3.20          pi->free_pages  = avail_domheap_pages();
     4.1 --- a/xen/include/xen/smp.h	Thu Oct 21 15:54:48 2004 +0000
     4.2 +++ b/xen/include/xen/smp.h	Thu Oct 21 17:12:07 2004 +0000
     4.3 @@ -52,6 +52,8 @@ extern int smp_call_function (void (*fun
     4.4  extern int smp_threads_ready;
     4.5  
     4.6  extern int smp_num_cpus;
     4.7 +extern int ht_per_core;
     4.8 +extern int opt_noht;
     4.9  
    4.10  extern volatile unsigned long smp_msg_data;
    4.11  extern volatile int smp_src_cpu;