From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5BOZ-0003Uf-7R for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:57:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5BOU-0007e7-Cv for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:57:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51442) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c5BOU-0007dv-7t for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:57:22 -0500 Date: Fri, 11 Nov 2016 13:57:17 +0100 From: Igor Mammedov Message-ID: <20161111135717.18eaa6dc@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] FW_CFG_NB_CPUS vs fwcfg file 'etc/boot-cpus' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laszlo Ersek , mst@redhat.com, Stefan Hajnoczi , Kevin O'Connor , Gerd Hoffmann , Eduardo Habkost While looking at OVMF and how it handles CPUs (ACPI/AP wakeup), I've noticed that it uses legacy FW_CFG_NB_CPUS(0x05) to get the number of present at start CPUs. Variable was introduced back in 2008 by fbfcf955ba and is/was used by ppc/sparc/arm/x86 and a bunch of firmwares (but not by SeaBIOS). However in 2.8 I've just added similar fwcfg file 'etc/boot-cpus' which is used for the same purpose \-) Both variables are UINT16 and the only difference that FW_CFG_NB_CPUS doesn't account for CPUs added with -device which might make a firmware to wait indefinitely in FW_CFG_NB_CPUS == Woken-up-APs loop due to extra not expected APs being woken up. FW_CFG_NB_CPUS should be fixed to mimic 'etc/boot-cpus' behavior anyway, so question arises why not to reuse fixed legacy FW_CFG_NB_CPUS and drop just added but not yet released 'etc/boot-cpus' from QEMU and SeaBIOS. Any opinions?