Re: [PATCH v2 5/6] KVM: x86: Keep a per-VM MTRR state

From: David Matlack
Date: Wed May 10 2023 - 13:23:20 EST


On Tue, May 09, 2023 at 09:53:00PM +0800, Yan Zhao wrote:
> +void kvm_mtrr_init(struct kvm_vcpu *vcpu)
> +{
> + struct kvm *kvm = vcpu->kvm;
> +
> + if (vcpu->vcpu_id)
> + return;

vcpu_id is provided by userspace so I don't think there's any guarantee
that a vCPU with vcpu_id == 0 exists.