On Mon, Apr 11, 2022, Zeng Guang wrote: > @@ -11180,6 +11192,9 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) > struct page *page; > int r; > > + if (vcpu->vcpu_id >= vcpu->kvm->arch.max_vcpu_ids) This belongs in pre-create. > + return -EINVAL; > + > vcpu->arch.last_vmentry_cpu = -1; > vcpu->arch.regs_avail = ~0; > vcpu->arch.regs_dirty = ~0;