Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/bhyverun.c
Show First 20 Lines • Show All 922 Lines • ▼ Show 20 Lines | #endif | ||||
gdb_cpu_suspend(*pvcpu); | gdb_cpu_suspend(*pvcpu); | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
checkpoint_cpu_resume(*pvcpu); | checkpoint_cpu_resume(*pvcpu); | ||||
#endif | #endif | ||||
return (VMEXIT_CONTINUE); | return (VMEXIT_CONTINUE); | ||||
} | } | ||||
static int | static int | ||||
vmexit_db(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) | |||||
{ | |||||
#ifdef BHYVE_SNAPSHOT | |||||
checkpoint_cpu_suspend(*pvcpu); | |||||
#endif | |||||
gdb_cpu_debug(*pvcpu, vmexit); | |||||
#ifdef BHYVE_SNAPSHOT | |||||
checkpoint_cpu_resume(*pvcpu); | |||||
#endif | |||||
return (VMEXIT_CONTINUE); | |||||
} | |||||
static int | |||||
vmexit_breakpoint(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) | vmexit_breakpoint(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) | ||||
{ | { | ||||
gdb_cpu_breakpoint(*pvcpu, vmexit); | gdb_cpu_breakpoint(*pvcpu, vmexit); | ||||
return (VMEXIT_CONTINUE); | return (VMEXIT_CONTINUE); | ||||
} | } | ||||
static vmexit_handler_t handler[VM_EXITCODE_MAX] = { | static vmexit_handler_t handler[VM_EXITCODE_MAX] = { | ||||
[VM_EXITCODE_INOUT] = vmexit_inout, | [VM_EXITCODE_INOUT] = vmexit_inout, | ||||
[VM_EXITCODE_INOUT_STR] = vmexit_inout, | [VM_EXITCODE_INOUT_STR] = vmexit_inout, | ||||
[VM_EXITCODE_VMX] = vmexit_vmx, | [VM_EXITCODE_VMX] = vmexit_vmx, | ||||
[VM_EXITCODE_SVM] = vmexit_svm, | [VM_EXITCODE_SVM] = vmexit_svm, | ||||
[VM_EXITCODE_BOGUS] = vmexit_bogus, | [VM_EXITCODE_BOGUS] = vmexit_bogus, | ||||
[VM_EXITCODE_REQIDLE] = vmexit_reqidle, | [VM_EXITCODE_REQIDLE] = vmexit_reqidle, | ||||
[VM_EXITCODE_RDMSR] = vmexit_rdmsr, | [VM_EXITCODE_RDMSR] = vmexit_rdmsr, | ||||
[VM_EXITCODE_WRMSR] = vmexit_wrmsr, | [VM_EXITCODE_WRMSR] = vmexit_wrmsr, | ||||
[VM_EXITCODE_MTRAP] = vmexit_mtrap, | [VM_EXITCODE_MTRAP] = vmexit_mtrap, | ||||
[VM_EXITCODE_INST_EMUL] = vmexit_inst_emul, | [VM_EXITCODE_INST_EMUL] = vmexit_inst_emul, | ||||
[VM_EXITCODE_SPINUP_AP] = vmexit_spinup_ap, | [VM_EXITCODE_SPINUP_AP] = vmexit_spinup_ap, | ||||
[VM_EXITCODE_SUSPENDED] = vmexit_suspend, | [VM_EXITCODE_SUSPENDED] = vmexit_suspend, | ||||
[VM_EXITCODE_TASK_SWITCH] = vmexit_task_switch, | [VM_EXITCODE_TASK_SWITCH] = vmexit_task_switch, | ||||
[VM_EXITCODE_DEBUG] = vmexit_debug, | [VM_EXITCODE_DEBUG] = vmexit_debug, | ||||
[VM_EXITCODE_BPT] = vmexit_breakpoint, | [VM_EXITCODE_BPT] = vmexit_breakpoint, | ||||
[VM_EXITCODE_DB] = vmexit_db, | |||||
}; | }; | ||||
static void | static void | ||||
vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip) | vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip) | ||||
{ | { | ||||
int error, rc; | int error, rc; | ||||
enum vm_exitcode exitcode; | enum vm_exitcode exitcode; | ||||
cpuset_t active_cpus; | cpuset_t active_cpus; | ||||
▲ Show 20 Lines • Show All 651 Lines • Show Last 20 Lines |