KVM: Add max_vcpus field in common 'struct kvm'
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 4 Mar 2022 19:48:38 +0000 (11:48 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 May 2022 15:42:42 +0000 (11:42 -0400)
commitf502cc568de95e5ed9cc9e6133fa454fbe0c5c01
tree4fbed31352b8dd3ce27c1edb7d790bbe7c8bdb27
parent6fcee03df6a1a3101a77344be37bb85c6142d56c
KVM: Add max_vcpus field in common 'struct kvm'

For TDX guests, the maximum number of vcpus needs to be specified when the
TDX guest VM is initialized (creating the TDX data corresponding to TDX
guest) before creating vcpu.  It needs to record the maximum number of
vcpus on VM creation (KVM_CREATE_VM) and return error if the number of
vcpus exceeds it

Because there is already max_vcpu member in arm64 struct kvm_arch, move it
to common struct kvm and initialize it to KVM_MAX_VCPUS before
kvm_arch_init_vm() instead of adding it to x86 struct kvm_arch.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Message-Id: <e53234cdee6a92357d06c80c03d77c19cdefb804.1646422845.git.isaku.yamahata@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/vgic/vgic-init.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c