ia64/xen-unstable

changeset 5900:7599a943b39e

On opt_nosmp, also force num_cores to 1. Do this in setup.c
instead of cpu/common.c. This is where opt_nosmp is defined,
and it reduces diff of cpu/ subdir against native Linux.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jul 27 11:20:47 2005 +0000 (2005-07-27)
parents 828d512b22ba
children b7e975425dd6
files xen/arch/x86/cpu/common.c xen/arch/x86/setup.c xen/common/domain.c
line diff
     1.1 --- a/xen/arch/x86/cpu/common.c	Wed Jul 27 11:02:30 2005 +0000
     1.2 +++ b/xen/arch/x86/cpu/common.c	Wed Jul 27 11:20:47 2005 +0000
     1.3 @@ -427,17 +427,12 @@ void __init detect_ht(struct cpuinfo_x86
     1.4  	u32 	eax, ebx, ecx, edx;
     1.5  	int 	index_msb, tmp;
     1.6  	int 	cpu = smp_processor_id();
     1.7 -	extern int opt_nosmp;
     1.8  
     1.9  	if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
    1.10  		return;
    1.11  
    1.12 -	if (opt_nosmp) {
    1.13 -		smp_num_siblings = 1;
    1.14 -	} else {
    1.15 -		cpuid(1, &eax, &ebx, &ecx, &edx);
    1.16 -		smp_num_siblings = (ebx & 0xff0000) >> 16;
    1.17 -	}
    1.18 +	cpuid(1, &eax, &ebx, &ecx, &edx);
    1.19 +	smp_num_siblings = (ebx & 0xff0000) >> 16;
    1.20  
    1.21  	if (smp_num_siblings == 1) {
    1.22  		printk(KERN_INFO  "CPU: Hyper-Threading is disabled\n");
     2.1 --- a/xen/arch/x86/setup.c	Wed Jul 27 11:02:30 2005 +0000
     2.2 +++ b/xen/arch/x86/setup.c	Wed Jul 27 11:20:47 2005 +0000
     2.3 @@ -35,7 +35,7 @@ integer_param("xenheap_megabytes", opt_x
     2.4  #endif
     2.5  
     2.6  /* opt_nosmp: If true, secondary processors are ignored. */
     2.7 -int opt_nosmp = 0;
     2.8 +static int opt_nosmp = 0;
     2.9  boolean_param("nosmp", opt_nosmp);
    2.10  
    2.11  /* maxcpus: maximum number of CPUs to activate. */
    2.12 @@ -197,7 +197,12 @@ static void __init start_of_day(void)
    2.13          set_in_cr4(X86_CR4_OSXMMEXCPT);
    2.14  
    2.15      if ( opt_nosmp )
    2.16 +    {
    2.17          max_cpus = 0;
    2.18 +        smp_num_siblings = 1;
    2.19 +        boot_cpu_data.x86_num_cores = 1;
    2.20 +    }
    2.21 +
    2.22      smp_prepare_cpus(max_cpus);
    2.23  
    2.24      /* We aren't hotplug-capable yet. */
     3.1 --- a/xen/common/domain.c	Wed Jul 27 11:02:30 2005 +0000
     3.2 +++ b/xen/common/domain.c	Wed Jul 27 11:20:47 2005 +0000
     3.3 @@ -39,8 +39,8 @@ struct domain *do_createdomain(domid_t d
     3.4      atomic_set(&d->refcnt, 1);
     3.5      atomic_set(&v->pausecnt, 0);
     3.6  
     3.7 -    d->domain_id   = dom_id;
     3.8 -    v->processor  = cpu;
     3.9 +    d->domain_id = dom_id;
    3.10 +    v->processor = cpu;
    3.11  
    3.12      spin_lock_init(&d->big_lock);
    3.13