From patchwork Wed Mar 22 15:59:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9639311 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 EEC3C6020B for ; Wed, 22 Mar 2017 16:01:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E04F028456 for ; Wed, 22 Mar 2017 16:01:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D56CC2845C; Wed, 22 Mar 2017 16:01:56 +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,HK_RANDOM_FROM, 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 D47A628456 for ; Wed, 22 Mar 2017 16:01:55 +0000 (UTC) Received: from localhost ([::1]:51791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqihu-0001yG-RF for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Mar 2017 12:01:54 -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) 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 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 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) 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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čmář --- 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 = "std"; m->no_floppy = 1; m->has_dynamic_sysbus = true; - m->max_cpus = 288; + m->max_cpus = INT32_MAX; } 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 = NULL; + m->max_cpus = 288; SET_MACHINE_COMPAT(m, PC_COMPAT_2_8); }