| /freebsd-12.1/usr.sbin/bhyvectl/ |
| H A D | bhyvectl.c | 1051 vcpu, target_addr); in get_misc_vmcs() 1058 vcpu, target_addr); in get_misc_vmcs() 1115 vcpu, u64); in get_misc_vmcs() 1133 vcpu, insterr); in get_misc_vmcs() 1195 vcpu, u64); in get_misc_vmcs() 1204 vcpu, u64); in get_misc_vmcs() 1213 vcpu, u64); in get_misc_vmcs() 1230 vcpu, u64); in get_misc_vmcs() 1317 vcpu, addr); in get_misc_vmcb() 1322 vcpu, addr); in get_misc_vmcb() [all …]
|
| /freebsd-12.1/usr.sbin/bhyve/ |
| H A D | task_switch.c | 103 GETREG(struct vmctx *ctx, int vcpu, int reg) in GETREG() argument 118 error = vm_set_register(ctx, vcpu, reg, val); in SETREG() 168 vm_inject_fault(ctx, vcpu, vector, 1, sel); in sel_exception() 343 sel = GETREG(ctx, vcpu, segment); in validate_seg_desc() 398 cs = GETREG(ctx, vcpu, VM_REG_GUEST_CS); in validate_seg_desc() 522 vm_inject_gp(ctx, vcpu); in tss32_restore() 638 cr0 = GETREG(ctx, vcpu, VM_REG_GUEST_CR0); in push_errcode() 677 vm_inject_ac(ctx, vcpu, 1); in push_errcode() 688 SETREG(ctx, vcpu, VM_REG_GUEST_RSP, esp); in push_errcode() 725 vcpu = *pvcpu; in vmexit_task_switch() [all …]
|
| H A D | mem.c | 142 typedef int (mem_cb_t)(struct vmctx *ctx, int vcpu, uint64_t gpa, 151 error = (*mr->handler)(ctx, vcpu, MEM_F_READ, gpa, size, in mem_read() 162 error = (*mr->handler)(ctx, vcpu, MEM_F_WRITE, gpa, size, in mem_write() 178 if (mmio_hint[vcpu] && in access_memory() 179 paddr >= mmio_hint[vcpu]->mr_base && in access_memory() 180 paddr <= mmio_hint[vcpu]->mr_end) { in access_memory() 181 entry = mmio_hint[vcpu]; in access_memory() 188 mmio_hint[vcpu] = entry; in access_memory() 215 err = cb(ctx, vcpu, paddr, &entry->mr_param, arg); in access_memory() 266 return (mr->handler(ctx, vcpu, MEM_F_READ, paddr, rma->size, in read_mem_cb() [all …]
|
| H A D | gdb.c | 654 while (CPU_ISSET(vcpu, &vcpus_suspended) && vcpu != stepping_vcpu) in _gdb_cpu_suspend() 661 gdb_cpu_add(int vcpu) in gdb_cpu_add() argument 681 gdb_cpu_suspend(int vcpu) in gdb_cpu_suspend() argument 690 gdb_cpu_mtrap(int vcpu) in gdb_cpu_mtrap() argument 698 vm_suspend_cpu(ctx, vcpu); in gdb_cpu_mtrap() 700 stopped_vcpu = vcpu; in gdb_cpu_mtrap() 719 gdb_step_vcpu(int vcpu) in gdb_step_vcpu() argument 728 vm_resume_cpu(ctx, vcpu); in gdb_step_vcpu() 729 stepping_vcpu = vcpu; in gdb_step_vcpu() 895 int vcpu; in gdb_query() local [all …]
|
| H A D | bhyverun.c | 333 int vcpu, pcpu; in pincpu_parse() local 340 if (vcpu < 0 || vcpu >= VM_MAXCPU) { in pincpu_parse() 357 CPU_ZERO(vcpumap[vcpu]); in pincpu_parse() 411 int vcpu; in fbsdrun_start_thread() local 414 vcpu = mtp->mt_vcpu; in fbsdrun_start_thread() 419 gdb_cpu_add(vcpu); in fbsdrun_start_thread() 421 vm_loop(mtp->mt_ctx, vcpu, vmexit[vcpu].rip); in fbsdrun_start_thread() 492 int vcpu; in vmexit_inout() local 494 vcpu = *pvcpu; in vmexit_inout() 814 error = vm_run(ctx, vcpu, &vmexit[vcpu]); in vm_loop() [all …]
|
| H A D | inout.c | 163 vm_inject_gp(ctx, vcpu); in emulate_inout() 167 error = vm_copy_setup(ctx, vcpu, &vis->paging, gla, in emulate_inout() 179 vm_inject_ac(ctx, vcpu, 0); in emulate_inout() 185 vm_copyin(ctx, vcpu, iov, &val, bytes); in emulate_inout() 187 retval = handler(ctx, vcpu, in, port, bytes, &val, arg); in emulate_inout() 192 vm_copyout(ctx, vcpu, &val, iov, bytes); in emulate_inout() 205 error = vie_update_register(ctx, vcpu, idxreg, index, addrsize); in emulate_inout() 213 error = vie_update_register(ctx, vcpu, VM_REG_GUEST_RCX, in emulate_inout() 220 error = vm_restart_instruction(ctx, vcpu); in emulate_inout() 226 retval = handler(ctx, vcpu, in, port, bytes, &val, arg); in emulate_inout() [all …]
|
| H A D | gdb.h | 34 void gdb_cpu_add(int vcpu); 35 void gdb_cpu_mtrap(int vcpu); 36 void gdb_cpu_suspend(int vcpu);
|
| H A D | mem.h | 38 typedef int (*mem_func_t)(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, 56 int emulate_mem(struct vmctx *, int vcpu, uint64_t paddr, struct vie *vie, 59 int read_mem(struct vmctx *ctx, int vcpu, uint64_t gpa, uint64_t *rval,
|
| H A D | pm.c | 59 reset_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, in reset_handler() argument 154 pm1_status_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, in pm1_status_handler() argument 178 pm1_enable_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, in pm1_enable_handler() argument 231 pm1_control_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, in pm1_control_handler() argument 271 smi_cmd_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, in smi_cmd_handler() argument
|
| /freebsd-12.1/sys/amd64/vmm/ |
| H A D | vmm.c | 265 struct vcpu *vcpu = &vm->vcpu[i]; in vcpu_cleanup() local 277 struct vcpu *vcpu; in vcpu_init() local 316 struct vcpu *vcpu; in vm_exitinfo() local 1025 struct vcpu *vcpu; in vm_set_register() local 1151 struct vcpu *vcpu; in vcpu_set_state_locked() local 1302 struct vcpu *vcpu; in vm_handle_hlt() local 1389 struct vcpu *vcpu; in vm_handle_paging() local 1430 struct vcpu *vcpu; in vm_handle_inst_emul() local 1508 struct vcpu *vcpu; in vm_handle_suspend() local 1559 struct vcpu *vcpu = &vm->vcpu[vcpuid]; in vm_handle_reqidle() local [all …]
|
| H A D | vmm_stat.h | 48 typedef void (*vmm_stat_func_t)(struct vm *vm, int vcpu, 93 int vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf); 97 vmm_stat_array_incr(struct vm *vm, int vcpu, struct vmm_stat_type *vst, in vmm_stat_array_incr() argument 103 stats = vcpu_stats(vm, vcpu); in vmm_stat_array_incr() 111 vmm_stat_array_set(struct vm *vm, int vcpu, struct vmm_stat_type *vst, in vmm_stat_array_set() argument 117 stats = vcpu_stats(vm, vcpu); in vmm_stat_array_set() 125 vmm_stat_incr(struct vm *vm, int vcpu, struct vmm_stat_type *vst, uint64_t x) in vmm_stat_incr() argument 129 vmm_stat_array_incr(vm, vcpu, vst, 0, x); in vmm_stat_incr() 134 vmm_stat_set(struct vm *vm, int vcpu, struct vmm_stat_type *vst, uint64_t val) in vmm_stat_set() argument 138 vmm_stat_array_set(vm, vcpu, vst, 0, val); in vmm_stat_set()
|
| H A D | vmm_dev.c | 114 if (vcpu < 0 || vcpu >= vm_get_maxcpus(sc->vm)) in vcpu_lock_one() 129 vcpu, state); in vcpu_unlock_one() 138 int error, vcpu; in vcpu_lock_all() local 142 for (vcpu = 0; vcpu < maxcpus; vcpu++) { in vcpu_lock_all() 149 while (--vcpu >= 0) in vcpu_lock_all() 150 vcpu_unlock_one(sc, vcpu); in vcpu_lock_all() 159 int vcpu; in vcpu_unlock_all() local 163 for (vcpu = 0; vcpu < maxcpus; vcpu++) in vcpu_unlock_all() 164 vcpu_unlock_one(sc, vcpu); in vcpu_unlock_all() 388 vcpu = -1; in vmmdev_ioctl() [all …]
|
| H A D | vmm_stat.c | 85 vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf) in vmm_stat_copy() argument 91 if (vcpu < 0 || vcpu >= vm_get_maxcpus(vm)) in vmm_stat_copy() 98 (*vst->func)(vm, vcpu, vst); in vmm_stat_copy() 102 stats = vcpu_stats(vm, vcpu); in vmm_stat_copy()
|
| /freebsd-12.1/sys/amd64/vmm/amd/ |
| H A D | svm.c | 537 struct svm_vcpu *vcpu; in svm_vminit() local 597 vcpu->nextrip = ~0; in svm_vminit() 598 vcpu->lastcpu = NOCPU; in svm_vminit() 599 vcpu->vmcb_pa = vtophys(&vcpu->vmcb); in svm_vminit() 956 vlapic = vm_lapic(vm, vcpu); in svm_update_virqinfo() 1186 vm_inject_gp(sc->vm, vcpu); in svm_write_efer() 1621 svm_inj_intinfo(sc, vcpu); in svm_inj_interrupts() 1625 if (nmi_blocked(sc, vcpu)) { in svm_inj_interrupts() 1660 vm_nmi_clear(sc->vm, vcpu); in svm_inj_interrupts() 1983 vlapic = vm_lapic(vm, vcpu); in svm_vmrun() [all …]
|
| H A D | svm_softc.h | 62 struct svm_vcpu vcpu[VM_MAXCPU]; member 72 svm_get_vcpu(struct svm_softc *sc, int vcpu) in svm_get_vcpu() argument 75 return (&(sc->vcpu[vcpu])); in svm_get_vcpu() 79 svm_get_vmcb(struct svm_softc *sc, int vcpu) in svm_get_vmcb() argument 82 return (&(sc->vcpu[vcpu].vmcb)); in svm_get_vmcb() 86 svm_get_vmcb_state(struct svm_softc *sc, int vcpu) in svm_get_vmcb_state() argument 89 return (&(sc->vcpu[vcpu].vmcb.state)); in svm_get_vmcb_state() 93 svm_get_vmcb_ctrl(struct svm_softc *sc, int vcpu) in svm_get_vmcb_ctrl() argument 96 return (&(sc->vcpu[vcpu].vmcb.ctrl)); in svm_get_vmcb_ctrl() 103 return (&(sc->vcpu[vcpu].swctx)); in svm_get_guest_regctx() [all …]
|
| H A D | vmcb.c | 123 vmcb = svm_get_vmcb(softc, vcpu); in vmcb_access() 145 VCPU_CTR1(softc->vm, vcpu, in vmcb_access() 152 svm_set_dirty(softc, vcpu, 0xffffffff); in vmcb_access() 168 vmcb = svm_get_vmcb(sc, vcpu); in vmcb_read() 258 vmcb = svm_get_vmcb(sc, vcpu); in vmcb_write() 269 svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); in vmcb_write() 279 svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); in vmcb_write() 284 svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); in vmcb_write() 289 svm_set_dirty(sc, vcpu, VMCB_CACHE_DR); in vmcb_write() 372 vmcb = svm_get_vmcb(sc, vcpu); in vmcb_setdesc() [all …]
|
| H A D | svm_msr.h | 37 void svm_msr_guest_init(struct svm_softc *sc, int vcpu); 38 void svm_msr_guest_enter(struct svm_softc *sc, int vcpu); 39 void svm_msr_guest_exit(struct svm_softc *sc, int vcpu); 41 int svm_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, 43 int svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t *result,
|
| H A D | svm_msr.c | 73 svm_msr_guest_init(struct svm_softc *sc, int vcpu) in svm_msr_guest_init() argument 87 svm_msr_guest_enter(struct svm_softc *sc, int vcpu) in svm_msr_guest_enter() argument 95 svm_msr_guest_exit(struct svm_softc *sc, int vcpu) in svm_msr_guest_exit() argument 109 svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t *result, in svm_rdmsr() argument 138 svm_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, bool *retu) in svm_wrmsr() argument 147 vm_inject_gp(sc->vm, vcpu); in svm_wrmsr()
|
| /freebsd-12.1/lib/libvmmapi/ |
| H A D | vmmapi_freebsd.c | 128 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_CS, in vm_setup_freebsd_registers_i386() 132 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_DS, in vm_setup_freebsd_registers_i386() 137 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_ES, in vm_setup_freebsd_registers_i386() 142 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_FS, in vm_setup_freebsd_registers_i386() 147 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_GS, in vm_setup_freebsd_registers_i386() 152 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_SS, in vm_setup_freebsd_registers_i386() 160 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_TR, in vm_setup_freebsd_registers_i386() 253 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_CS, in vm_setup_freebsd_registers() 259 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_DS, in vm_setup_freebsd_registers() 264 error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_ES, in vm_setup_freebsd_registers() [all …]
|
| H A D | vmmapi.h | 125 int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, 127 int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, 129 int vm_get_seg_desc(struct vmctx *ctx, int vcpu, int reg, 141 int vm_inject_exception(struct vmctx *ctx, int vcpu, int vector, 143 int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); 155 int vm_inject_nmi(struct vmctx *ctx, int vcpu); 215 int vcpu_reset(struct vmctx *ctx, int vcpu); 220 int vm_activate_cpu(struct vmctx *ctx, int vcpu); 221 int vm_suspend_cpu(struct vmctx *ctx, int vcpu); 222 int vm_resume_cpu(struct vmctx *ctx, int vcpu); [all …]
|
| H A D | vmmapi.c | 566 vmreg.cpuid = vcpu; in vm_set_register() 581 vmreg.cpuid = vcpu; in vm_get_register() 630 vmrun.cpuid = vcpu; in vm_run() 660 exc.cpuid = vcpu; in vm_inject_exception() 932 pptmsi.vcpu = vcpu; in vm_setup_pptdev_msi() 950 pptmsix.vcpu = vcpu; in vm_setup_pptdev_msix() 1222 gg.vcpuid = vcpu; in vm_gla2gpa() 1243 gg.vcpuid = vcpu; in vm_gla2gpa_nofault() 1389 ac.vcpuid = vcpu; in vm_activate_cpu() 1401 ac.vcpuid = vcpu; in vm_suspend_cpu() [all …]
|
| /freebsd-12.1/sys/amd64/vmm/intel/ |
| H A D | vmx.c | 1316 vm_nmi_clear(vmx->vm, vcpu); in vmx_inject_nmi() 1555 vmxctx = &vmx->ctx[vcpu]; in vmx_emulate_xsetbv() 1629 vmxctx = &vmx->ctx[vcpu]; in vmx_get_guest_reg() 1674 vmxctx = &vmx->ctx[vcpu]; in vmx_set_guest_reg() 2244 vmxctx = &vmx->ctx[vcpu]; in vmx_exit_process() 2479 vmx_inject_nmi(vmx, vcpu); in vmx_exit_process() 2845 vmcs = &vmx->vmcs[vcpu]; in vmx_run() 2846 vmxctx = &vmx->ctx[vcpu]; in vmx_run() 2949 vmx_run_trace(vmx, vcpu); in vmx_run() 3125 vmcs = &vmx->vmcs[vcpu]; in vmx_modify_intr_shadow() [all …]
|
| /freebsd-12.1/sys/amd64/include/ |
| H A D | vmm.h | 224 int vm_get_seg_desc(struct vm *vm, int vcpu, int reg, 226 int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, 230 int vm_inject_nmi(struct vm *vm, int vcpu); 233 int vm_inject_extint(struct vm *vm, int vcpu); 244 int vm_activate_cpu(struct vm *vm, int vcpu); 245 int vm_suspend_cpu(struct vm *vm, int vcpu); 246 int vm_resume_cpu(struct vm *vm, int vcpu); 322 vcpu_is_running(struct vm *vm, int vcpu, int *hostcpu) in vcpu_is_running() argument 329 vcpu_should_yield(struct vm *vm, int vcpu) in vcpu_should_yield() argument 341 void *vcpu_stats(struct vm *vm, int vcpu); [all …]
|
| /freebsd-12.1/sys/dev/xen/timer/ |
| H A D | timer.c | 162 xen_fetch_vcpu_time(struct vcpu_info *vcpu) in xen_fetch_vcpu_time() argument 166 time = (struct pvclock_vcpu_time_info *) &vcpu->time; in xen_fetch_vcpu_time() 289 xentimer_vcpu_start_timer(int vcpu, uint64_t next_time) in xentimer_vcpu_start_timer() argument 296 return (HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, vcpu, &single)); in xentimer_vcpu_start_timer() 300 xentimer_vcpu_stop_timer(int vcpu) in xentimer_vcpu_stop_timer() argument 303 return (HYPERVISOR_vcpu_op(VCPUOP_stop_singleshot_timer, vcpu, NULL)); in xentimer_vcpu_stop_timer() 326 struct vcpu_info *vcpu = DPCPU_GET(vcpu_info); in xentimer_et_start() local 339 next_time = xen_fetch_vcpu_time(vcpu) + first_in_ns; in xentimer_et_start() 525 struct vcpu_info *vcpu = &HYPERVISOR_shared_info->vcpu_info[0]; in xen_delay() local 529 end_ns = xen_fetch_vcpu_time(vcpu); in xen_delay() [all …]
|
| /freebsd-12.1/sys/xen/interface/ |
| H A D | event_channel.h | 142 uint32_t vcpu; member 171 uint32_t vcpu; member 218 uint32_t vcpu; /* VCPU to which this channel is bound. */ member 248 uint32_t vcpu; member 289 uint32_t vcpu; member
|