Lines Matching full:vcpu

111 static void vm_loop(struct vmctx *ctx, struct vcpu *vcpu);
115 struct vcpu *vcpu; member
127 * manual page syntax specification, this results in a topology of 1 vCPU.
245 int vcpu, pcpu; in bhyve_pincpu_parse() local
247 if (sscanf(opt, "%d:%d", &vcpu, &pcpu) != 2) { in bhyve_pincpu_parse()
252 if (vcpu < 0) { in bhyve_pincpu_parse()
253 fprintf(stderr, "invalid vcpu '%d'\n", vcpu); in bhyve_pincpu_parse()
263 snprintf(key, sizeof(key), "vcpu.%d.cpuset", vcpu); in bhyve_pincpu_parse()
278 parse_cpuset(int vcpu, const char *list, cpuset_t *set) in parse_cpuset() argument
289 errx(4, "invalid cpuset for vcpu %d: '%s'", vcpu, list); in parse_cpuset()
310 errx(4, "invalid cpuset for vcpu %d: '%s'", in parse_cpuset()
311 vcpu, list); in parse_cpuset()
315 errx(4, "invalid cpuset for vcpu %d: '%s'", vcpu, list); in parse_cpuset()
328 int vcpu; in build_vcpumaps() local
331 for (vcpu = 0; vcpu < guest_ncpus; vcpu++) { in build_vcpumaps()
332 snprintf(key, sizeof(key), "vcpu.%d.cpuset", vcpu); in build_vcpumaps()
336 vcpumap[vcpu] = malloc(sizeof(cpuset_t)); in build_vcpumaps()
337 if (vcpumap[vcpu] == NULL) in build_vcpumaps()
338 err(4, "Failed to allocate cpuset for vcpu %d", vcpu); in build_vcpumaps()
339 parse_cpuset(vcpu, value, vcpumap[vcpu]); in build_vcpumaps()
365 struct vcpu *
368 return (vcpu_info[vcpuid].vcpu); in fbsdrun_vcpu()
378 snprintf(tname, sizeof(tname), "vcpu %d", vi->vcpuid); in fbsdrun_start_thread()
391 gdb_cpu_add(vi->vcpu); in fbsdrun_start_thread()
394 vm_loop(vi->ctx, vi->vcpu); in fbsdrun_start_thread()
410 error = vm_activate_cpu(vi->vcpu); in fbsdrun_addcpu()
416 error = vm_suspend_cpu(vi->vcpu); in fbsdrun_addcpu()
424 fbsdrun_deletecpu(int vcpu) in fbsdrun_deletecpu() argument
430 if (!CPU_ISSET(vcpu, &cpumask)) { in fbsdrun_deletecpu()
431 EPRINTLN("Attempting to delete unknown cpu %d", vcpu); in fbsdrun_deletecpu()
435 CPU_CLR(vcpu, &cpumask); in fbsdrun_deletecpu()
437 if (vcpu != BSP) { in fbsdrun_deletecpu()
453 return (vm_suspend_cpu(vcpu_info[vcpuid].vcpu)); in fbsdrun_suspendcpu()
457 vm_loop(struct vmctx *ctx, struct vcpu *vcpu) in vm_loop() argument
466 assert(CPU_ISSET(vcpu_id(vcpu), &active_cpus)); in vm_loop()
473 error = vm_run(vcpu, &vmrun); in vm_loop()
484 rc = (*vmexit_handlers[exitcode])(ctx, vcpu, &vmrun); in vm_loop()
499 num_vcpus_allowed(struct vmctx *ctx, struct vcpu *vcpu) in num_vcpus_allowed() argument
508 error = vm_get_capability(vcpu, VM_CAP_UNRESTRICTED_GUEST, &tmp); in num_vcpus_allowed()
630 struct vcpu *bsp; in main()
705 /* Allocate per-VCPU resources. */ in main()
711 vcpu_info[vcpuid].vcpu = bsp; in main()
713 vcpu_info[vcpuid].vcpu = vm_vcpu_open(ctx, vcpuid); in main()
772 bhyve_start_vcpu(vcpu_info[vcpuid].vcpu, vcpuid == BSP); in main()
841 vm_resume_cpu(vcpu_info[vcpuid].vcpu); in main()