Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyvectl/bhyvectl.c
Show First 20 Lines • Show All 842 Lines • ▼ Show 20 Lines | get_all_registers(struct vmctx *ctx, int vcpu) | ||||
} | } | ||||
if (!error && (get_rflags || get_all)) { | if (!error && (get_rflags || get_all)) { | ||||
error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RFLAGS, | error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RFLAGS, | ||||
&rflags); | &rflags); | ||||
if (error == 0) | if (error == 0) | ||||
printf("rflags[%d]\t0x%016lx\n", vcpu, rflags); | printf("rflags[%d]\t0x%016lx\n", vcpu, rflags); | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
get_all_segments(struct vmctx *ctx, int vcpu) | get_all_segments(struct vmctx *ctx, int vcpu) | ||||
{ | { | ||||
uint64_t cs, ds, es, fs, gs, ss, tr, ldtr; | uint64_t cs, ds, es, fs, gs, ss, tr, ldtr; | ||||
int error = 0; | int error = 0; | ||||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | get_misc_vmcs(struct vmctx *ctx, int vcpu) | ||||
if (!error && (get_vmcs_entry_interruption_info || | if (!error && (get_vmcs_entry_interruption_info || | ||||
get_all)) { | get_all)) { | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_ENTRY_INTR_INFO,&u64); | error = vm_get_vmcs_field(ctx, vcpu, VMCS_ENTRY_INTR_INFO,&u64); | ||||
if (error == 0) { | if (error == 0) { | ||||
printf("entry_interruption_info[%d]\t0x%016lx\n", | printf("entry_interruption_info[%d]\t0x%016lx\n", | ||||
vcpu, u64); | vcpu, u64); | ||||
} | } | ||||
} | } | ||||
if (!error && (get_tpr_threshold || get_all)) { | if (!error && (get_tpr_threshold || get_all)) { | ||||
uint64_t threshold; | uint64_t threshold; | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_TPR_THRESHOLD, | error = vm_get_vmcs_field(ctx, vcpu, VMCS_TPR_THRESHOLD, | ||||
&threshold); | &threshold); | ||||
if (error == 0) | if (error == 0) | ||||
printf("tpr_threshold[%d]\t0x%016lx\n", vcpu, threshold); | printf("tpr_threshold[%d]\t0x%016lx\n", vcpu, threshold); | ||||
} | } | ||||
if (!error && (get_inst_err || get_all)) { | if (!error && (get_inst_err || get_all)) { | ||||
uint64_t insterr; | uint64_t insterr; | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_INSTRUCTION_ERROR, | error = vm_get_vmcs_field(ctx, vcpu, VMCS_INSTRUCTION_ERROR, | ||||
&insterr); | &insterr); | ||||
if (error == 0) { | if (error == 0) { | ||||
printf("instruction_error[%d]\t0x%016lx\n", | printf("instruction_error[%d]\t0x%016lx\n", | ||||
vcpu, insterr); | vcpu, insterr); | ||||
} | } | ||||
} | } | ||||
if (!error && (get_exit_ctls || get_all)) { | if (!error && (get_exit_ctls || get_all)) { | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_CTLS, &ctl); | error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_CTLS, &ctl); | ||||
if (error == 0) | if (error == 0) | ||||
printf("exit_ctls[%d]\t\t0x%016lx\n", vcpu, ctl); | printf("exit_ctls[%d]\t\t0x%016lx\n", vcpu, ctl); | ||||
} | } | ||||
if (!error && (get_entry_ctls || get_all)) { | if (!error && (get_entry_ctls || get_all)) { | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_ENTRY_CTLS, &ctl); | error = vm_get_vmcs_field(ctx, vcpu, VMCS_ENTRY_CTLS, &ctl); | ||||
Show All 31 Lines | if (error == 0) | ||||
printf("host_rip[%d]\t\t0x%016lx\n", vcpu, rip); | printf("host_rip[%d]\t\t0x%016lx\n", vcpu, rip); | ||||
} | } | ||||
if (!error && (get_host_rsp || get_all)) { | if (!error && (get_host_rsp || get_all)) { | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_RSP, &rsp); | error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_RSP, &rsp); | ||||
if (error == 0) | if (error == 0) | ||||
printf("host_rsp[%d]\t\t0x%016lx\n", vcpu, rsp); | printf("host_rsp[%d]\t\t0x%016lx\n", vcpu, rsp); | ||||
} | } | ||||
if (!error && (get_vmcs_link || get_all)) { | if (!error && (get_vmcs_link || get_all)) { | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_LINK_POINTER, &addr); | error = vm_get_vmcs_field(ctx, vcpu, VMCS_LINK_POINTER, &addr); | ||||
if (error == 0) | if (error == 0) | ||||
printf("vmcs_pointer[%d]\t0x%016lx\n", vcpu, addr); | printf("vmcs_pointer[%d]\t0x%016lx\n", vcpu, addr); | ||||
} | } | ||||
if (!error && (get_vmcs_exit_interruption_info || get_all)) { | if (!error && (get_vmcs_exit_interruption_info || get_all)) { | ||||
error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_INTR_INFO, &u64); | error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_INTR_INFO, &u64); | ||||
▲ Show 20 Lines • Show All 1,156 Lines • Show Last 20 Lines |