]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Add kvm_vcpu_get_idx to get vcpu index in kvm->vcpus
authorChristoffer Dall <cdall@linaro.org>
Mon, 8 May 2017 18:38:40 +0000 (20:38 +0200)
committerChristoffer Dall <cdall@linaro.org>
Tue, 9 May 2017 10:19:14 +0000 (12:19 +0200)
commit5f0ece3f54b78e945b17b144a93fe05e6a628274
tree278c4ca307da2925f7f89078a38aad03bd3d213f
parentb19464d40fe0926bd4cdf3f5d49c4ab9739f5917
KVM: Add kvm_vcpu_get_idx to get vcpu index in kvm->vcpus

There are occasional needs to use the index of vcpu in the kvm->vcpus
array to map something related to a VCPU.  For example, unlike the
vcpu->vcpu_id, the vcpu index is guaranteed to not be sparse across all
vcpus which is useful when allocating a memory area for each vcpu.

Signed-off-by: Christoffer Dall <cdall@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
include/linux/kvm_host.h