From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iyxz9-0002lG-5k for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:12:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iyxz3-0002iw-Tr for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:12:26 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iyxz3-0002is-O1 for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:12:21 -0500 Received: from pop-tawny.atl.sa.earthlink.net ([207.69.195.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iyxz3-00070A-KI for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:12:21 -0500 Received: from user-142h2k8.cable.mindspring.com ([72.40.138.136] helo=earthlink.net) by pop-tawny.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1Iyxz2-0006RE-00 for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:12:20 -0500 Message-ID: <47533BD3.4000606@earthlink.net> Date: Sun, 02 Dec 2007 18:12:19 -0500 From: Robert Reif MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080407080008030706080802" Subject: [Qemu-devel] [PATCH] sparc32 machine specific maximums Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080407080008030706080802 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This patch sets the maximum number of CPUs and memory to what is supported by the actual hardware. --------------080407080008030706080802 Content-Type: text/plain; name="max.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="max.diff.txt" 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, }, }; --------------080407080008030706080802--