From patchwork Thu Oct 20 18:51:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9387541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8EBE360487 for ; Thu, 20 Oct 2016 20:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78EF02947D for ; Thu, 20 Oct 2016 20:42:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C2EF29BE0; Thu, 20 Oct 2016 20:42:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E9A152947D for ; Thu, 20 Oct 2016 20:42:38 +0000 (UTC) Received: from localhost ([::1]:57009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxKAf-00046C-3o for patchwork-qemu-devel@patchwork.kernel.org; Thu, 20 Oct 2016 16:42:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxKAM-00045w-NV for qemu-devel@nongnu.org; Thu, 20 Oct 2016 16:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxKAJ-0006cW-Lf for qemu-devel@nongnu.org; Thu, 20 Oct 2016 16:42:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxKAJ-0006c2-Gx for qemu-devel@nongnu.org; Thu, 20 Oct 2016 16:42:15 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B4513F1F6; Thu, 20 Oct 2016 20:42:14 +0000 (UTC) Received: from localhost (ovpn-116-161.phx2.redhat.com [10.3.116.161]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9KKgCLA024410; Thu, 20 Oct 2016 16:42:13 -0400 Date: Thu, 20 Oct 2016 16:51:48 -0200 From: Eduardo Habkost To: Igor Mammedov Message-ID: <20161020185148.GJ5057@thinpad.lan.raisama.net> References: <1476878743-144953-12-git-send-email-imammedo@redhat.com> <1476975522-154506-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1476975522-154506-1-git-send-email-imammedo@redhat.com> X-Fnord: you can see the fnord User-Agent: Mutt/1.7.0 (2016-08-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 20 Oct 2016 20:42:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] fixup! pc: add 'etc/boot-cpus' fw_cfg file for machine with more than 255 CPUs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: liuxiaojian6@huawei.com, rkrcmar@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, peterx@redhat.com, kevin@koconnor.net, kraxel@redhat.com, pbonzini@redhat.com, lersek@redhat.com, chao.gao@intel.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Oct 20, 2016 at 04:58:42PM +0200, Igor Mammedov wrote: > Currently firmware uses 1 byte at 0x5F offset in RTC CMOS > to get number of CPUs present at boot. However 1 byte is > not enough to handle more than 255 CPUs. So add a new > fw_cfg file that would allow QEMU to tell it. > For compat reasons add file only for machine types that > support more than 255 CPUs. > > Signed-off-by: Igor Mammedov I suggest squashing this into the patch, to clarify why we are setting it to 0. Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c6f6747..a03b384 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1225,6 +1225,10 @@ static void pc_build_feature_control_file(PCMachineState *pcms) static void rtc_set_cpus_count(ISADevice *rtc, uint16_t cpus_count) { if (cpus_count > 0xff) { + /* If the number of CPUs can't be represented in 8 bits, the + * BIOS must use "etc/boot-cpus". Set RTC field to 0 just + * to make old BIOSes fail more predictably. + */ rtc_set_memory(rtc, 0x5f, 0); } else { rtc_set_memory(rtc, 0x5f, cpus_count - 1);