From nobody Mon Apr 29 14:25:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149019854712418.87391276746746; Wed, 22 Mar 2017 09:02:27 -0700 (PDT) Received: from localhost ([::1]:51845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqiiO-0003F8-DC for importer@patchew.org; Wed, 22 Mar 2017 12:02:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqig5-0001RP-Mp for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:00:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqig4-0005u3-V7 for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:00:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45810) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqig4-0005sd-Po for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:00:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 078AF7F7C5; Wed, 22 Mar 2017 16:00:00 +0000 (UTC) Received: from potion (dhcp-1-208.brq.redhat.com [10.34.1.208]) by smtp.corp.redhat.com (Postfix) with SMTP id 29F6918A4F; Wed, 22 Mar 2017 15:59:56 +0000 (UTC) Received: by potion (sSMTP sendmail emulation); Wed, 22 Mar 2017 16:59:54 +0100 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 078AF7F7C5 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=rkrcmar@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 078AF7F7C5 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: qemu-devel@nongnu.org Date: Wed, 22 Mar 2017 16:59:06 +0100 Message-Id: <20170322155906.10679-1-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 22 Mar 2017 16:00:00 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] pc: q35: bump max_cpus to INT32_MAX 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: Igor Mammedov , Richard Henderson , "Michael S. Tsirkin" , Eduardo Habkost , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QEMU does not allocate based on machine's max_cpus, but only uses it to limit the maximum selected by user and the actual limit of VCPUs is enfoced by other components: - machine without vIOMMU ends at 255 VCPUs - TCG currently doesn't support x2APIC, so it also ends below 256 - KVM with vIOMMU cannot exceed the KVM limit (currently 288) Using a big value should bring no drawbacks and the benefit is that components (especially out-of-tree KVM) can bump their limits without touching machine's max_cpus. max_cpus is unsigned, but it is treated as signed at least in printf and the other two billion VCPU won't be needed for a while, so we can ignore possible bugs by using signed max. Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 --- Should the 2.9 machine type still have 288? --- hw/i386/pc_q35.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index dd792a8547b3..3d5710ca20e0 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -298,7 +298,7 @@ static void pc_q35_machine_options(MachineClass *m) m->default_display =3D "std"; m->no_floppy =3D 1; m->has_dynamic_sysbus =3D true; - m->max_cpus =3D 288; + m->max_cpus =3D INT32_MAX; } =20 static void pc_q35_2_9_machine_options(MachineClass *m) @@ -314,6 +314,7 @@ static void pc_q35_2_8_machine_options(MachineClass *m) { pc_q35_2_9_machine_options(m); m->alias =3D NULL; + m->max_cpus =3D 288; SET_MACHINE_COMPAT(m, PC_COMPAT_2_8); } =20 --=20 2.12.0