Re: [PATCH 2/2] KVM: x86: Identify vCPU0 by its vcpu_idx instead of walking vCPUs array

From: Jim Mattson
Date: Fri Sep 10 2021 - 17:46:30 EST


On Fri, Sep 10, 2021 at 11:32 AM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> Use vcpu_idx to identify vCPU0 when updating HyperV's TSC page, which is
> shared by all vCPUs and "owned" by vCPU0 (because vCPU0 is the only vCPU
> that's guaranteed to exist). Using kvm_get_vcpu() to find vCPU works,
> but it's a rather odd and suboptimal method to check the index of a given
> vCPU.
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>