On 5/13/22 6:23 PM, Michael S. Tsirkin wrote:
On Mon, May 09, 2022 at 09:12:49AM +0200, Igor Mammedov wrote:
On Wed, 4 May 2022 08:16:39 -0500
Suravee Suthikulpanit<[email protected]> wrote:
This is the maximum number of vCPU supported by
the AMD x2APIC virtualization.
Signed-off-by: Suravee Suthikulpanit<[email protected]>
---
hw/i386/pc_q35.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 302288342a..e82b1c690d 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -357,7 +357,7 @@ static void pc_q35_machine_options(MachineClass *m)
machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
- m->max_cpus = 288;
+ m->max_cpus = 512;
Maybe we should bump it to KVM VCPU maximum,
and make sure we error out if asked for combination of
hardware/irqchip is not usable.
So what happens if one does 710 and then tries to use AMD x2APIC?
We'd like that to error out, right?
Since the AMD SVM x2AVIC can support only upto 512 vCPUs,
KVM would return error when QEMU tries to create more than 512 vcpus
in the following call-path:
kvm_vm_ioctl_create_vcpu
kvm_arch_vcpu_create
svm_vcpu_create
avic_init_vcpu
Also, I tried to find a way to get the KVM VCPU max value via KVM_CAP_MAX_VCPUS
ioctl,
but the accel/kvm/kvm-all.c:kvm_init() is called later than
hw/core/machine-smp.c:
machine_parse_smp_config(), where it checks the specified QEMU -smp option.
So, if there is no objection, I will send out a patch to change m->max_cpus =
1024
to match current KVM limit.
Best Regards,
Suravee