Received: from eggs.gnu.org ([2001:4830:134:3::10]:39367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxVa6-00007T-EB for qemu-devel@nongnu.org; Fri, 21 Oct 2016 04:53:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxVa0-0004xX-E3 for qemu-devel@nongnu.org; Fri, 21 Oct 2016 04:53:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43516) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxVa0-0004xB-8e for qemu-devel@nongnu.org; Fri, 21 Oct 2016 04:53:32 -0400 Date: Fri, 21 Oct 2016 10:53:27 +0200 From: Igor Mammedov Message-ID: <20161021105327.2bce44f7@nial.brq.redhat.com> In-Reply-To: <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> <20161020185148.GJ5057@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] fixup! pc: add 'etc/boot-cpus' fw_cfg file for machine with more than 255 CPUs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost 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 On Thu, 20 Oct 2016 16:51:48 -0200 Eduardo Habkost wrote: > 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 Could you squash it in while merging series? > --- > 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);