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-devel

[Xen-devel] [PATCH] xenalyze: Raise MAX_CPUS to 256 cpus

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenalyze: Raise MAX_CPUS to 256 cpus
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Wed, 20 Jul 2011 16:10:29 +0100
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Wed, 20 Jul 2011 08:12:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
Some systems actually have that many now.  (And XenServer builds
with MAX_PHYS_CPUS set to 256.)

Also, check if a CPU is out of range before using, warn and exit,
instead of segfaulting.

To-do: Make the size dynamically adjustable.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r 405fc96c0ec2 -r e11e13e66c62 xenalyze.c
--- a/xenalyze.c        Thu Jul 14 12:55:17 2011 +0100
+++ b/xenalyze.c        Wed Jul 20 16:10:20 2011 +0100
@@ -1621,7 +1621,7 @@ struct cr3_value_struct {
 };
 
 #ifndef MAX_CPUS
-#define MAX_CPUS 128
+#define MAX_CPUS 256
 #endif
 typedef uint32_t cpu_mask_t;
 
@@ -7968,6 +7968,14 @@ loff_t scan_for_new_pcpu(loff_t offset) 
     }
 
     cd = (typeof(cd))rec.u.notsc.data;
+
+    if ( cd->cpu > MAX_CPUS )
+    {
+        fprintf(stderr, "%s: cpu %d exceeds MAX_CPU %d!\n",
+                __func__, cd->cpu, MAX_CPUS);
+        /* FIXME: Figure out if we could handle this more gracefully */
+        error(ERR_ASSERT, NULL);
+    }
         
     if(cd->cpu > P.max_active_pcpu || !P.pcpu[cd->cpu].active) {
         struct pcpu_info *p = P.pcpu + cd->cpu;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xenalyze: Raise MAX_CPUS to 256 cpus, George Dunlap <=