From nobody Thu Nov 14 06:53:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1708443799; cv=none; d=zohomail.com; s=zohoarc; b=ko5RIxtTlekNFSv1tDG097pcTJXfWJK52QbUoNQtf4nsOpaVC9qvxuScV6SeIAMppZT4h7ojwo6EdDzEEeYyS654Szu1U6QK8QgCa3XutZLFo5svw4TUaorJUrshGibVW9U786GeCpdVAax58GEbdqvTViCmaih1mugUPdYFo1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708443799; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SSLdFxG3HoFwMkYCcqEKJGeeVNAi2EULDymLMtF1B6E=; b=KM8ij8ayW2BlD9jn1nQbowYRgYc7JYZ0oS7Gb0MR5zm+vP+vX7sysvOmQCeK1m0owTQQyYggG0MyGQMidQe28uAsxdImDqH6bgF804p2ouXlwUxOeHjDCkJ9n4wNAovW/ivI8sj722XK14vBQ4SIo7w9VMJbOQLIRrc3WSdKvZs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708443799099358.89301329224656; Tue, 20 Feb 2024 07:43:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcSGH-0003Fc-Ov; Tue, 20 Feb 2024 10:42:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcSGC-0003FR-54 for qemu-devel@nongnu.org; Tue, 20 Feb 2024 10:42:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcSGA-00019y-5W for qemu-devel@nongnu.org; Tue, 20 Feb 2024 10:42:19 -0500 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-HhWWLfvfNlSO22H0ZqX6fw-1; Tue, 20 Feb 2024 10:42:14 -0500 Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-59a38af7ea6so6536619eaf.2 for ; Tue, 20 Feb 2024 07:42:14 -0800 (PST) Received: from localhost.localdomain ([203.163.244.72]) by smtp.googlemail.com with ESMTPSA id 18-20020a631052000000b005d553239b16sm6738702pgq.20.2024.02.20.07.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:42:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708443736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SSLdFxG3HoFwMkYCcqEKJGeeVNAi2EULDymLMtF1B6E=; b=PkFT14noLtdmC2ykuDnuiK91923OS3RXE2Se1zZxy9qQTtUKWgW1YZhAOyntrQOZC6meWt lLG9LLdx4ENowzk5tUz/BOJvyjR+jtvNtPsuF6JhRrIEyISmUYvgR3uBDj/hGNlis8UeGX Pf8ANIxK24iyNVUJPjYNmskm1WeQ+uA= X-MC-Unique: HhWWLfvfNlSO22H0ZqX6fw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443734; x=1709048534; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SSLdFxG3HoFwMkYCcqEKJGeeVNAi2EULDymLMtF1B6E=; b=pfcs07FNDtiAmXlSk/ZqPB1TECT6OEzXW7IgYsqC29cJ3Py7Fn29LvQqK3MNmv6eKg 8Zl2wo85GD1/8CN9ipphq4MuCQjKSGZZEp55Ta3FZClv48LY72juM8LwZacXZoFOnTOx oHgTaICRrrwDbw8o4vJ89LhQabLmThG2hofRkNZ4MWHRhIK9+ejmj7Qck0ozLqi761FY bas9KMVhGxhONkl5NjOMz12HWymrRj7nzJ/CrQDOOsvtMk4WoMjzaAbxQj6MPRm7LZSr DwKhmr9BljSGs7C1KD5AGHq/Cz9a12Dw0+32lOoquVJOuQVY0d4CVrLkU/N0ExCk7wdK sQOQ== X-Forwarded-Encrypted: i=1; AJvYcCV8C4hUgd2TC4SHuSqPkuQrisQoW1W9CxcWiICfOdjGd6X2JdOeuoMyMabVTmt43id/BrBBkCxgLmGWWQINvltSVbYpGuI= X-Gm-Message-State: AOJu0Yw1DYspT9SV6suZCR6asVI7H0s/2U4KPnq9FPhxQOGo+QhuP+RY vnTxoqYVDHeqACrcDbU6lrWHLU8HCDNMR7TwZNQTGpIIilRpvLnUR9GfX1lPVQaSmLfhGxh7GQd NHa0iJdBZkvPBOOzBWEFvXVX7vlI0sY51Qxo5WVHKwCy422nTWuIb X-Received: by 2002:a05:6358:f485:b0:17a:e627:9012 with SMTP id ku5-20020a056358f48500b0017ae6279012mr16845720rwb.19.1708443733954; Tue, 20 Feb 2024 07:42:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFULnw5L4FlkZ4yzsTBZ26of+obzA/omVYUR40vDa6iFoaptRN6RVH6Fy7zhMhYi2zjhUBNzw== X-Received: by 2002:a05:6358:f485:b0:17a:e627:9012 with SMTP id ku5-20020a056358f48500b0017ae6279012mr16845694rwb.19.1708443733603; Tue, 20 Feb 2024 07:42:13 -0800 (PST) From: Ani Sinha To: "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Cc: Ani Sinha , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Igor Mammedov , Julia Suvorova , kraxel@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v3] pc: q35: Bump max_cpus to 4096 vcpus Date: Tue, 20 Feb 2024 21:12:04 +0530 Message-ID: <20240220154204.29676-1-anisinha@redhat.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1708443800671100001 Since commit f10a570b093e6 ("KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS to allow= up to 4096 vCPUs") Linux kernel can support upto a maximum number of 4096 vCPUS when MAXSMP is enabled in the kernel. At present, QEMU has been tested to correctly boot a linux guest with 4096 vcpus both with edk2 and seabios firmwares. So bump up the value max_cpus to 4096 for q35 machines versions 9 and newer. Q35 machines versions 8.2 and older continue to support 1024 maximum vcpus as before for compatibility reasons. If KVM is not able to support the specified number of vcpus, QEMU would return the following error messages: $ ./qemu-system-x86_64 -cpu host -accel kvm -machine q35 -smp 1728 qemu-system-x86_64: -accel kvm: warning: Number of SMP cpus requested (1728= ) exceeds the recommended cpus supported by KVM (12) qemu-system-x86_64: -accel kvm: warning: Number of hotpluggable cpus reques= ted (1728) exceeds the recommended cpus supported by KVM (12) Number of SMP cpus requested (1728) exceeds the maximum cpus supported by K= VM (1024) Cc: Daniel P. Berrang=C3=A9 Cc: Igor Mammedov Cc: Michael S. Tsirkin Cc: Julia Suvorova Cc: kraxel@redhat.com Signed-off-by: Ani Sinha Reviewed-by: Daniel P. Berrang=C3=A9 --- hw/i386/pc_q35.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Changelog: v3: bump up to 4096 vcpus. It has now been tested to work with edk2. See RH Jira: https://issues.redhat.com/browse/RHEL-22202 v2: bump up the vcpu number to 1856. Add failure messages from ekd2 in the commit description. diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index d346fa3b1d..ae60e6b919 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -366,7 +366,7 @@ static void pc_q35_machine_options(MachineClass *m) m->default_nic =3D "e1000e"; m->default_kernel_irqchip_split =3D false; m->no_floppy =3D 1; - m->max_cpus =3D 1024; + m->max_cpus =3D 4096; m->no_parallel =3D !module_object_class_by_name(TYPE_ISA_PARALLEL); machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE); machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE); @@ -387,6 +387,7 @@ static void pc_q35_8_2_machine_options(MachineClass *m) { pc_q35_9_0_machine_options(m); m->alias =3D NULL; + m->max_cpus =3D 1024; compat_props_add(m->compat_props, hw_compat_8_2, hw_compat_8_2_len); compat_props_add(m->compat_props, pc_compat_8_2, pc_compat_8_2_len); } --=20 2.42.0