All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Reif <reif@earthlink.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] sparc32 machine specific maximums
Date: Sun, 02 Dec 2007 18:12:19 -0500	[thread overview]
Message-ID: <47533BD3.4000606@earthlink.net> (raw)

[-- 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,
     },
 };
 

             reply	other threads:[~2007-12-02 23:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-02 23:12 Robert Reif [this message]
2007-12-03 17:25 ` [Qemu-devel] [PATCH] sparc32 machine specific maximums 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47533BD3.4000606@earthlink.net \
    --to=reif@earthlink.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.