kvm: x86: Set KVM_MAX_VCPU_ID to 4*KVM_MAX_VCPUS
authorEduardo Habkost <ehabkost@redhat.com>
Fri, 3 Sep 2021 21:15:58 +0000 (17:15 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Sep 2021 10:11:39 +0000 (06:11 -0400)
commit4ddacd525a2f16cebec8ba409fbce6b6fb45e987
tree50a66972534c7de8f1ba01ded331cf8e4a3edcbc
parent81b4b56d4f8130bbb99cf4e2b48082e5b4cfccb9
kvm: x86: Set KVM_MAX_VCPU_ID to 4*KVM_MAX_VCPUS

Instead of requiring KVM_MAX_VCPU_ID to be manually increased
every time we increase KVM_MAX_VCPUS, set it to 4*KVM_MAX_VCPUS.
This should be enough for CPU topologies where Cores-per-Package
and Packages-per-Socket are not powers of 2.

In practice, this increases KVM_MAX_VCPU_ID from 1023 to 1152.
The only side effect of this change is making some fields in
struct kvm_ioapic larger, increasing the struct size from 1628 to
1780 bytes (in x86_64).

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20210903211600.2002377-2-ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h