]> 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)
commit32acd1ba1da24159c942606109c08263247d1643
tree4fbed31352b8dd3ce27c1edb7d790bbe7c8bdb27
parent2b14d1486c58f0516a9e0807e6ac82f309e31694
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