]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita94de513e2766c64aa6262221209197a3739a9cb
tree4fbed31352b8dd3ce27c1edb7d790bbe7c8bdb27
parentdbccf0992cee022f8d9a1f82d2460190822a1bb4
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