Skip to content

kvm: x86: Set KVM_MAX_VCPUS=1024, KVM_SOFT_MAX_VCPUS=710

Eduardo Habkost kvm 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 4 repliesApplied

Changes in v2 from the cover letter

* KVM_MAX_VCPUS is now 1024 (v1 set it to 710)
* KVM_MAX_VCPU_ID is now 4096 (v1 left it unchanged, at 1023)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3kvm: x86: Set KVM_MAX_VCPU_ID to 4*KVM_MAX_VCPUSarch/x86/include/asm/kvm_host.h+13 -10 replies
2/3kvm: x86: Increase MAX_VCPUS to 1024arch/x86/include/asm/kvm_host.h+1 -10 replies
3/3kvm: x86: Increase KVM_SOFT_MAX_VCPUS to 710arch/x86/include/asm/kvm_host.h+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] kvm: x86: Set KVM_MAX_VCPUS=1024, KVM_SOFT_MAX_VCPUS=710

This:
- Increases KVM_MAX_VCPUS 288 to 1024.
- Increases KVM_MAX_VCPU_ID from 1023 to 4096.
- Increases KVM_SOFT_MAX_VCPUS from 240 to 710.

Note that this conflicts with:
https://lore.kernel.org/lkml/[email protected]
Date: Fri, 3 Sep 2021 15:08:01 +0200
From: Juergen Gross <[email protected]>
Subject: [PATCH v2 0/6] x86/kvm: add boot parameters for max vcpu configs
Message-Id: <[email protected]>

I don't intend to block Juergen's work. I will be happy to rebase and resubmit in case Juergen's series is merged first. However, I do propose that we set the values above as the default even if Juergen's series is merged.

The additional overhead (on x86_64) of the new defaults will be:
- struct kvm_ioapic will grow from 1628 to 5084 bytes.
- struct kvm will grow from 19328 to 22272 bytes.
- Bitmap stack variables that will grow:
- At kvm_hv_flush_tlb() & kvm_hv_send_ipi(), vp_bitmap[] and vcpu_bitmap[] will now be 128 bytes long
- vcpu_bitmap at bioapic_write_indirect() will be 128 bytes long once patch "KVM: x86: Fix stack-out-of-bounds memory access from ioapic_write_indirect()" is applied

Changes v1 -> v2:
* KVM_MAX_VCPUS is now 1024 (v1 set it to 710)
* KVM_MAX_VCPU_ID is now 4096 (v1 left it unchanged, at 1023)

v1 of this series was:

https://lore.kernel.org/lkml/[email protected]
Date: Tue, 31 Aug 2021 16:45:35 -0400
From: Eduardo Habkost <[email protected]>
Subject: [PATCH] kvm: x86: Increase MAX_VCPUS to 710
Message-Id: <[email protected]>

Eduardo Habkost (3):
kvm: x86: Set KVM_MAX_VCPU_ID to 4*KVM_MAX_VCPUS
kvm: x86: Increase MAX_VCPUS to 1024
kvm: x86: Increase KVM_SOFT_MAX_VCPUS to 710

 arch/x86/include/asm/kvm_host.h | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
Signature · 1 line
2.31.1