Lines Matching defs:vcpu

73 	pool_init(&vcpu_pool, sizeof(struct vcpu), 64, IPL_MPFLOOR, PR_WAITOK,
320 * id: index id of vcpu
322 * Returns pointer to vcpu structure if successful, NULL otherwise
324 struct vcpu *
327 struct vcpu *vcpu;
332 SLIST_FOREACH(vcpu, &vm->vm_vcpu_list, vc_vcpu_link) {
333 if (vcpu->vc_id == id)
334 return (vcpu);
358 struct vcpu *vcpu;
368 /* Bail early if we're already at vcpu capacity. */
399 vcpu = pool_get(&vcpu_pool, PR_WAITOK | PR_ZERO);
401 vcpu->vc_parent = vm;
402 vcpu->vc_id = vm->vm_vcpu_ct;
404 if ((ret = vcpu_init(vcpu, vcp)) != 0) {
405 printf("failed to init vcpu %d for vm %p\n", i, vm);
409 /* Publish vcpu to list, inheriting the reference. */
410 SLIST_INSERT_HEAD(&vm->vm_vcpu_list, vcpu, vc_vcpu_link);
533 struct vcpu *vcpu, *tmp;
540 SLIST_FOREACH_SAFE(vcpu, &vm->vm_vcpu_list, vc_vcpu_link, tmp) {
541 SLIST_REMOVE(&vm->vm_vcpu_list, vcpu, vcpu, vc_vcpu_link);
542 vcpu_deinit(vcpu);
544 pool_put(&vcpu_pool, vcpu);
586 struct vcpu *vcpu;
623 SLIST_FOREACH(vcpu, &vm->vm_vcpu_list,
625 if (vcpu->vc_id == j)
627 vcpu->vc_state;
705 * Resets the vcpu defined in 'vrp' to power-on-init register state
708 * vrp: ioctl structure defining the vcpu to reset (see vmmvar.h)
712 * if vrp describes an unknown vcpu for this VM
720 struct vcpu *vcpu;
733 vcpu = vm_find_vcpu(vm, vrp->vrp_vcpu_id);
735 if (vcpu == NULL) {
736 DPRINTF("%s: vcpu id %u of vm %u not found\n", __func__,
742 rw_enter_write(&vcpu->vc_lock);
743 if (vcpu->vc_state != VCPU_STATE_STOPPED)
746 if (vcpu_reset_regs(vcpu, &vrp->vrp_init_state)) {
749 dump_vcpu(vcpu);
754 rw_exit_write(&vcpu->vc_lock);
770 * vcpu: the VCPU to check
777 vcpu_must_stop(struct vcpu *vcpu)
781 if (vcpu->vc_state == VCPU_STATE_REQTERM)