From d06f8670b9304c66d45e2270a4f5b462ed6cbe09 Mon Sep 17 00:00:00 2001 From: Ani Sinha Date: Wed, 16 Oct 2024 17:21:34 +0530 Subject: [PATCH 1/9] pc: q35: Bump max_cpus to 4096 vcpus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Ani Sinha RH-MergeRequest: 273: pc: q35: Bump max_cpus to 4096 vcpus RH-Jira: RHEL-11043 RH-Acked-by: Igor Mammedov RH-Acked-by: Daniel P. Berrangé RH-Acked-by: MST RH-Commit: [1/1] 23caa8c9e4f34c3114701b7a5bb25002a9372b2e (anisinha/centos-qemu-kvm) This is the downstream change equivalent of the upstream QEMU commit e4e98c7e ("pc: q35: Bump max_cpus to 4096 vcpus") Since upstream Linux kernel 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. This upstream change has been backported to c9s kernel already. Please see JIRA https://issues.redhat.com/browse/RHEL-11579 and the following commit authored by Vitaly Kuznetsov: a85f846be686b0a ("KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS to allow up to 4096 vCPUs") At present, QEMU has been tested to correctly boot a linux guest with 4096 vcpus using edk2 that has the fixes corresponding to the following two upstream edk2 PRs: https://github.com/tianocore/edk2/pull/5410 https://github.com/tianocore/edk2/pull/5418 The changes corresponding to the above two upstream edk2 PRs has been included in the downstream c9s edk2 with the following MR: https://gitlab.com/redhat/centos-stream/src/edk2/-/merge_requests/59 So bump up the value max_cpus to 4096 for RHEL q35 machines versions 9.6 and newer. Q35 RHEL machines versions 9.4 and older continue to support 710 maximum vcpus as before for compatibility reasons. See also https://gitlab.com/redhat/centos-stream/src/qemu-kvm/-/merge_requests/236 Signed-off-by: Ani Sinha --- hw/i386/pc_q35.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7606007bda..578f63524f 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -344,7 +344,7 @@ static void pc_q35_machine_options(MachineClass *m) m->default_display = "std"; m->default_nic = "e1000e"; m->no_floppy = 1; - m->max_cpus = 710; + m->max_cpus = 4096; m->no_parallel = 1; machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE); machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE); @@ -687,6 +687,9 @@ static void pc_q35_rhel_machine_9_4_0_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_q35_rhel_machine_9_6_0_options(m); + + /* older RHEL machines continue to support 710 vcpus */ + m->max_cpus = 710; m->desc = "RHEL-9.4.0 PC (Q35 + ICH9, 2009)"; m->alias = NULL; pcmc->smbios_stream_product = "RHEL"; -- 2.39.3