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

David Matlack
2023-05-10T17:23:16Z

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.