qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sparc32 machine specific maximums
@ 2007-12-02 23:12 Robert Reif
  2007-12-03 17:25 ` Blue Swirl
  0 siblings, 1 reply; 11+ messages in thread
From: Robert Reif @ 2007-12-02 23:12 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 100 bytes --]

This patch sets the maximum number of CPUs and memory to what is 
supported by the actual hardware.

[-- Attachment #2: max.diff.txt --]
[-- Type: text/plain, Size: 2331 bytes --]

Index: hw/sun4m.c
===================================================================
RCS file: /sources/qemu/qemu/hw/sun4m.c,v
retrieving revision 1.66
diff -p -u -r1.66 sun4m.c
--- hw/sun4m.c	2 Dec 2007 04:51:10 -0000	1.66
+++ hw/sun4m.c	2 Dec 2007 23:03:18 -0000
@@ -82,6 +82,7 @@ struct hwdef {
     uint32_t intbit_to_level[32];
     uint64_t max_mem;
     const char * const default_cpu_model;
+    unsigned int max_cpus;
 };
 
 /* TSC handling */
@@ -345,10 +346,16 @@ static void sun4m_hw_init(const struct h
     if (!cpu_model)
         cpu_model = hwdef->default_cpu_model;
 
+    if (smp_cpus > hwdef->max_cpus) {
+        fprintf(stderr, "qemu: Too many CPUs for this machine: %d, maximum %d\n",
+                smp_cpus, hwdef->max_cpus);
+        exit(1);
+    }
+
     for(i = 0; i < smp_cpus; i++) {
         env = cpu_init(cpu_model);
         if (!env) {
-            fprintf(stderr, "Unable to find Sparc CPU definition\n");
+            fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
             exit(1);
         }
         cpu_sparc_set_id(env, i);
@@ -514,8 +521,9 @@ static const struct hwdef hwdefs[] = {
             2, 3, 5, 7, 9, 11, 0, 14,   3, 5, 7, 9, 11, 13, 12, 12,
             6, 0, 4, 10, 8, 0, 11, 0,   0, 0, 0, 0, 15, 0, 15, 0,
         },
-        .max_mem = 0x10000000,
+        .max_mem = 0x10000000, // 256M (8 32M SIMMs)
         .default_cpu_model = "Fujitsu MB86904",
+        .max_cpus = 1,
     },
     /* SS-10 */
     {
@@ -550,8 +558,9 @@ static const struct hwdef hwdefs[] = {
             2, 3, 5, 7, 9, 11, 0, 14,   3, 5, 7, 9, 11, 13, 12, 12,
             6, 0, 4, 10, 8, 0, 11, 0,   0, 0, 0, 0, 15, 0, 15, 0,
         },
-        .max_mem = 0xffffffff, // XXX actually first 62GB ok
+        .max_mem = 0x20000000, // 512M (8 64M SIMMs)
         .default_cpu_model = "TI SuperSparc II",
+        .max_cpus = 4,
     },
     /* SS-600MP */
     {
@@ -586,8 +595,9 @@ static const struct hwdef hwdefs[] = {
             2, 3, 5, 7, 9, 11, 0, 14,   3, 5, 7, 9, 11, 13, 12, 12,
             6, 0, 4, 10, 8, 0, 11, 0,   0, 0, 0, 0, 15, 0, 15, 0,
         },
-        .max_mem = 0xffffffff, // XXX actually first 62GB ok
+        .max_mem = 0x40000000, // 1G (64 16M SIMMs)
         .default_cpu_model = "TI SuperSparc II",
+        .max_cpus = 4,
     },
 };
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-12-06 17:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-02 23:12 [Qemu-devel] [PATCH] sparc32 machine specific maximums Robert Reif
2007-12-03 17:25 ` Blue Swirl
2007-12-03 23:41   ` Robert Reif
2007-12-04 16:12     ` Blue Swirl
2007-12-04 23:30       ` Robert Reif
2007-12-06 17:37         ` Blue Swirl
2007-12-04 17:26     ` Paul Brook
2007-12-04 18:40       ` Blue Swirl
2007-12-03 23:53   ` Thiemo Seufer
2007-12-04 16:26     ` Blue Swirl
2007-12-04 16:30     ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).