From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JM2zP-0003Ao-TM for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JM2zO-00039x-4u for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:07 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JM2zN-00039q-UY for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:05 -0500 Received: from e1.ny.us.ibm.com ([32.97.182.141]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JM2zO-0006Gg-4v for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:06 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e1.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m14FBFmL026702 for ; Mon, 4 Feb 2008 10:11:15 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m14FBEh4241610 for ; Mon, 4 Feb 2008 10:11:14 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m14FBEuZ012020 for ; Mon, 4 Feb 2008 10:11:14 -0500 From: Anthony Liguori Date: Mon, 4 Feb 2008 09:11:04 -0600 Message-Id: <1202137865-20232-5-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1202137865-20232-1-git-send-email-aliguori@us.ibm.com> References: <1202137865-20232-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 4/5] Tell BIOS about the number of CPUs (v2) 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 Cc: kvm-devel@lists.sourceforge.net, Paul Brook Previously, the BIOS would probe the CPUs for SMP guests. This tends to be very unreliably because of startup timing issues. By passing the number of CPUs in the CMOS, the BIOS can detect the number of CPUs much more reliably. Since v1, I've incorporated Fabrice's feedback so this is now a 1-liner. diff --git a/hw/pc.c b/hw/pc.c index 64827be..de99879 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -210,6 +210,7 @@ static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, rtc_set_memory(s, 0x5c, (unsigned int)above_4g_mem_size >> 24); rtc_set_memory(s, 0x5d, (uint64_t)above_4g_mem_size >> 32); } + rtc_set_memory(s, 0x5f, smp_cpus - 1); if (ram_size > (16 * 1024 * 1024)) val = (ram_size / 65536) - ((16 * 1024 * 1024) / 65536);