WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Make sure that opt_nosmp also disables hyperthreading. T

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Make sure that opt_nosmp also disables hyperthreading. This stops us
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Jul 2005 07:00:10 -0400
Delivery-date: Wed, 27 Jul 2005 11:00:41 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Make sure that opt_nosmp also disables hyperthreading. This stops us, Xen patchbot -unstable <=