[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Make sure that opt_nosmp also disables hyperthreading. This stops us
# HG changeset patch # User sos22@xxxxxxxxxxxxxxxxxxxx # Node ID 5f9ca2959ffcf07a78ad52dfb30df147f5925140 # Parent a0a14aedfa68b5783508fde32135a329694b894e Make sure that opt_nosmp also disables hyperthreading. This stops us from trying to create domains on non-existent threads, which would lead to a rather nasty crash. Signed-off-by: Steven Smith, sos22@xxxxxxxxx diff -r a0a14aedfa68 -r 5f9ca2959ffc xen/arch/x86/cpu/common.c --- a/xen/arch/x86/cpu/common.c Wed Jul 27 09:24:51 2005 +++ b/xen/arch/x86/cpu/common.c Wed Jul 27 10:52:29 2005 @@ -427,12 +427,17 @@ u32 eax, ebx, ecx, edx; int index_msb, tmp; int cpu = smp_processor_id(); + extern int opt_nosmp; if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY)) return; - cpuid(1, &eax, &ebx, &ecx, &edx); - smp_num_siblings = (ebx & 0xff0000) >> 16; + if (opt_nosmp) { + smp_num_siblings = 1; + } else { + cpuid(1, &eax, &ebx, &ecx, &edx); + smp_num_siblings = (ebx & 0xff0000) >> 16; + } if (smp_num_siblings == 1) { printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); diff -r a0a14aedfa68 -r 5f9ca2959ffc xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Wed Jul 27 09:24:51 2005 +++ b/xen/arch/x86/setup.c Wed Jul 27 10:52:29 2005 @@ -35,7 +35,7 @@ #endif /* opt_nosmp: If true, secondary processors are ignored. */ -static int opt_nosmp = 0; +int opt_nosmp = 0; boolean_param("nosmp", opt_nosmp); /* maxcpus: maximum number of CPUs to activate. */ diff -r a0a14aedfa68 -r 5f9ca2959ffc xen/common/domain.c --- a/xen/common/domain.c Wed Jul 27 09:24:51 2005 +++ b/xen/common/domain.c Wed Jul 27 10:52:29 2005 @@ -31,6 +31,7 @@ struct domain *d, **pd; struct vcpu *v; + ASSERT(cpu_online(cpu)); if ( (d = alloc_domain_struct()) == NULL ) return NULL; @@ -41,7 +42,7 @@ d->domain_id = dom_id; v->processor = cpu; - + spin_lock_init(&d->big_lock); spin_lock_init(&d->page_alloc_lock); diff -r a0a14aedfa68 -r 5f9ca2959ffc xen/common/sched_sedf.c --- a/xen/common/sched_sedf.c Wed Jul 27 09:24:51 2005 +++ b/xen/common/sched_sedf.c Wed Jul 27 10:52:29 2005 @@ -1225,6 +1225,9 @@ /*check whether the awakened task needs to invoke the do_schedule routine. Try to avoid unnecessary runs but: Save approximation: Always switch to scheduler!*/ + ASSERT(d->processor >= 0); + ASSERT(d->processor < NR_CPUS); + ASSERT(schedule_data[d->processor].curr); if (should_switch(schedule_data[d->processor].curr, d, now)) cpu_raise_softirq(d->processor, SCHEDULE_SOFTIRQ); } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |