qemu-kvm/kvm-pc-q35-Bump-max_cpus-to-4096-vcpus.patch
Miroslav Rezanina 639b862c69 * Tue Nov 19 2024 Miroslav Rezanina <mrezanin@redhat.com> - 9.1.0-3
- kvm-pc-q35-Bump-max_cpus-to-4096-vcpus.patch [RHEL-11043]
- kvm-kvm-replace-fprintf-with-error_report-printf-in-kvm_.patch [RHEL-57682]
- kvm-kvm-refactor-core-virtual-machine-creation-into-its-.patch [RHEL-57682]
- kvm-accel-kvm-refactor-dirty-ring-setup.patch [RHEL-57682]
- kvm-KVM-Dynamic-sized-kvm-memslots-array.patch [RHEL-57682]
- kvm-KVM-Define-KVM_MEMSLOTS_NUM_MAX_DEFAULT.patch [RHEL-57682]
- kvm-KVM-Rename-KVMMemoryListener.nr_used_slots-to-nr_slo.patch [RHEL-57682]
- kvm-KVM-Rename-KVMState-nr_slots-to-nr_slots_max.patch [RHEL-57682]
- kvm-Require-new-dtrace-package.patch [RHEL-67900]
- Resolves: RHEL-11043
  ([RFE] [HPEMC] [RHEL-9.6] qemu-kvm: support up to 4096 VCPUs)
- Resolves: RHEL-57682
  (Bad migration performance when performing vGPU VM live migration )
- Resolves: RHEL-67900
  (Failed to build qemu-kvm due to missing dtrace [rhel-9.6])
2024-11-19 00:37:25 -05:00

76 lines
2.9 KiB
Diff

From d06f8670b9304c66d45e2270a4f5b462ed6cbe09 Mon Sep 17 00:00:00 2001
From: Ani Sinha <anisinha@redhat.com>
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 <anisinha@redhat.com>
RH-MergeRequest: 273: pc: q35: Bump max_cpus to 4096 vcpus
RH-Jira: RHEL-11043
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
RH-Acked-by: MST <mst@redhat.com>
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 <anisinha@redhat.com>
---
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