]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Allow userspace to set maximum VCPU id for VM
authorZeng Guang <guang.zeng@intel.com>
Tue, 19 Apr 2022 15:44:44 +0000 (23:44 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jun 2022 08:47:31 +0000 (04:47 -0400)
commit0ef6ffd860f48fd2d4ebfa4a414a60c3e4d84c6b
tree68c6884064bf6e7827c802d9b72aff9b966df290
parent958147a5ddb1fbd027ba70b287bef1f71136448d
KVM: x86: Allow userspace to set maximum VCPU id for VM

Introduce new max_vcpu_ids in KVM for x86 architecture. Userspace
can assign maximum possible vcpu id for current VM session using
KVM_CAP_MAX_VCPU_ID of KVM_ENABLE_CAP ioctl().

This is done for x86 only because the sole use case is to guide
memory allocation for PID-pointer table, a structure needed to
enable VMX IPI.

By default, max_vcpu_ids set as KVM_MAX_VCPU_IDS.

Suggested-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Zeng Guang <guang.zeng@intel.com>
Message-Id: <20220419154444.11888-1-guang.zeng@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virt/kvm/api.rst
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c