/illumos-gate/usr/src/test/bhyve-tests/tests/inst_emul/ |
H A D | exit_consistent.c | 35 struct vm_exit *vexit) in run_until_unhandled() argument 39 test_run_vcpu(vcpu, ventry, vexit); in run_until_unhandled() 50 test_fail_vmexit(vexit); in run_until_unhandled() 58 struct vm_exit *vexit, uint64_t expected_rip) in repeat_consistent_exit() argument 61 if (vm_run(vcpu, ventry, vexit) != 0) { in repeat_consistent_exit() 64 if (vexit->rip != expected_rip) { in repeat_consistent_exit() 89 struct vm_exit vexit = { 0 }; in main() local 95 run_until_unhandled(vcpu, &ventry, &vexit); in main() 96 if (vexit.exitcode != VM_EXITCODE_RDMSR) { in main() 97 test_fail_vmexit(&vexit); in main() [all …]
|
H A D | inout.c | 42 advance_test_state(const struct vm_exit *vexit, struct vm_entry *ventry, in advance_test_state() argument 57 if (vexit->exitcode != VM_EXITCODE_INOUT) { in advance_test_state() 62 vexit_match_inout(vexit, true, 0x55aa, 1, NULL); in advance_test_state() 67 ventry_fulfill_inout(vexit, ventry, 0xee); in advance_test_state() 69 if (vexit->exitcode != VM_EXITCODE_INST_EMUL) { in advance_test_state() 74 vexit->u.inst_emul.num_valid >= 2 && in advance_test_state() 75 vexit->u.inst_emul.inst[0] == 0xf3 && in advance_test_state() 76 vexit->u.inst_emul.inst[1] == 0x6c; in advance_test_state() 81 int err = vm_set_register(vcpu, 0, vexit->rip + 2); in advance_test_state() 94 if (vexit->exitcode != VM_EXITCODE_INOUT) { in advance_test_state() [all …]
|
H A D | imul.c | 37 handle_test_mmio(const struct vm_exit *vexit, struct vm_entry *ventry) in handle_test_mmio() argument 40 if (vexit->u.mmio.read == 0) { in handle_test_mmio() 45 if (vexit->u.mmio.gpa < MMIO_TEST_BASE || in handle_test_mmio() 46 vexit->u.mmio.gpa >= MMIO_TEST_END) { in handle_test_mmio() 57 const uint16_t addr = vexit->u.mmio.gpa; in handle_test_mmio() 59 switch (vexit->u.mmio.bytes) { in handle_test_mmio() 75 ventry_fulfill_mmio(vexit, ventry, val); in handle_test_mmio() 99 struct vm_exit vexit = { 0 }; in main() local 103 test_run_vcpu(vcpu, &ventry, &vexit); in main() 108 if (!handle_test_mmio(&vexit, &ventry)) { in main() [all …]
|
H A D | wrmsr.c | 53 struct vm_exit vexit = { 0 }; in main() local 59 test_run_vcpu(vcpu, &ventry, &vexit); in main() 65 if (vexit.exitcode != VM_EXITCODE_WRMSR) { in main() 66 test_fail_vmexit(&vexit); in main() 68 if (vexit.u.msr.code != expected_code) { in main() 70 vexit.u.msr.code, expected_code); in main() 72 if (vexit.u.msr.wval != expected_wval) { in main() 74 vexit.u.msr.wval, expected_wval); in main() 82 test_fail_vmexit(&vexit); in main()
|
H A D | exit_paging.c | 54 struct vm_exit vexit = { 0 }; in main() local 61 test_run_vcpu(vcpu, &ventry, &vexit); in main() 66 if (vexit.exitcode != VM_EXITCODE_PAGING) { in main() 67 test_fail_vmexit(&vexit); in main() 69 if (vexit.u.paging.gpa != expected_gpa) { in main() 71 vexit.u.paging.gpa, expected_gpa); in main() 73 if (vexit.u.paging.fault_type != expected_ftype) { in main() 75 vexit.u.paging.fault_type, expected_ftype); in main() 81 test_fail_vmexit(&vexit); in main()
|
H A D | suspend_info.c | 55 struct vm_exit vexit = { 0 }; in vcpu0_thread() local 60 test_run_vcpu(vcpu, &ventry, &vexit); in vcpu0_thread() 65 if (vexit.exitcode != VM_EXITCODE_SUSPENDED) { in vcpu0_thread() 66 test_fail_vmexit(&vexit); in vcpu0_thread() 68 *vtc->howp = vexit.u.suspended.how; in vcpu0_thread() 69 *vtc->sourcep = vexit.u.suspended.source; in vcpu0_thread() 72 test_fail_vmexit(&vexit); in vcpu0_thread() 185 struct vm_exit vexit = { 0 }; in test_emitted_triplefault() local 188 test_run_vcpu(vcpu1, &ventry, &vexit); in test_emitted_triplefault() 194 if (vexit.exitcode != VM_EXITCODE_SUSPENDED) { in test_emitted_triplefault() [all …]
|
H A D | rdmsr.c | 53 struct vm_exit vexit = { 0 }; in main() local 58 test_run_vcpu(vcpu, &ventry, &vexit); in main() 64 if (vexit.exitcode != VM_EXITCODE_RDMSR) { in main() 65 test_fail_vmexit(&vexit); in main() 67 if (vexit.u.msr.code != expected_code) { in main() 69 vexit.u.msr.code, expected_code); in main() 77 test_fail_vmexit(&vexit); in main()
|
H A D | triple_fault.c | 53 struct vm_exit vexit = { 0 }; in main() local 58 test_run_vcpu(vcpu, &ventry, &vexit); in main() 64 if (vexit.exitcode != VM_EXITCODE_SUSPENDED) { in main() 65 test_fail_vmexit(&vexit); in main() 67 if (vexit.u.suspended.how != expected_how) { in main() 69 vexit.u.suspended.how, expected_how); in main() 77 test_fail_vmexit(&vexit); in main()
|
H A D | cpuid.c | 142 struct vm_exit vexit = { 0 }; in main() local 146 test_run_vcpu(vcpu, &ventry, &vexit); in main() 154 test_fail_msg("failed result %rip: %x", vexit.rip); in main() 158 if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, in main() 170 ventry_fulfill_inout(&vexit, &ventry, 0); in main() 172 test_fail_vmexit(&vexit); in main() 178 test_fail_vmexit(&vexit); in main()
|
H A D | cpuid_guest_state.c | 161 struct vm_exit vexit = { 0 }; in main() local 181 kind = test_run_vcpu(vcpu, &ventry, &vexit); in main() 196 phases[i].name, vexit.rip); in main() 201 if (!vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, in main() 203 test_fail_vmexit(&vexit); in main() 207 test_fail_vmexit(&vexit); in main() 213 test_fail_vmexit(&vexit); in main() 251 ventry_fulfill_inout(&vexit, &ventry, 0); in main()
|
H A D | vcpu_barrier.c | 47 struct vm_exit vexit = { 0 }; in vcpu0_thread() local 50 int err = vm_run(vcpu, &ventry, &vexit); in vcpu0_thread() 54 switch (vexit.exitcode) { in vcpu0_thread() 59 test_fail_vmexit(&vexit); in vcpu0_thread()
|
/illumos-gate/usr/src/test/bhyve-tests/tests/common/ |
H A D | in_guest.c | 190 test_fail_vmexit(const struct vm_exit *vexit) in test_fail_vmexit() argument 194 switch (vexit->exitcode) { in test_fail_vmexit() 196 (void) fprintf(stderr, hdr_fmt, "IN/OUT", vexit->rip); in test_fail_vmexit() 202 vexit->u.inout.eax, in test_fail_vmexit() 203 vexit->u.inout.port, in test_fail_vmexit() 204 vexit->u.inout.bytes, in test_fail_vmexit() 205 vexit->u.inout.flags); in test_fail_vmexit() 208 (void) fprintf(stderr, hdr_fmt, "RDMSR", vexit->rip); in test_fail_vmexit() 209 (void) fprintf(stderr, "\tcode: %08x\n", vexit->u.msr.code); in test_fail_vmexit() 212 (void) fprintf(stderr, hdr_fmt, "WRMSR", vexit->rip); in test_fail_vmexit() [all …]
|
/illumos-gate/usr/src/test/bhyve-tests/tests/kdev/ |
H A D | vlapic_freq_periodic.c | 98 struct vm_entry *ventry, struct vm_exit *vexit) in run_test() argument 109 test_run_vcpu(vcpu, ventry, vexit); in run_test() 113 test_fail_vmexit(vexit); in run_test() 117 if (vexit_match_inout(vexit, true, IOP_TEST_PARAM0, 2, NULL)) { in run_test() 118 ventry_fulfill_inout(vexit, ventry, divisor); in run_test() 122 if (vexit_match_inout(vexit, true, IOP_TEST_PARAM1, 2, NULL)) { in run_test() 123 ventry_fulfill_inout(vexit, ventry, loops); in run_test() 128 if (vexit_match_inout(vexit, false, IOP_TEST_VALUE, 4, &v)) { in run_test() 131 ventry_fulfill_inout(vexit, ventry, 0); in run_test() 153 test_fail_vmexit(vexit); in run_test() [all …]
|
H A D | vlapic_freq.c | 93 struct vm_exit *vexit) in test_for_divisor() argument 104 test_run_vcpu(vcpu, ventry, vexit); in test_for_divisor() 108 test_fail_vmexit(vexit); in test_for_divisor() 112 if (vexit_match_inout(vexit, true, IOP_TEST_PARAM, 4, NULL)) { in test_for_divisor() 113 ventry_fulfill_inout(vexit, ventry, divisor); in test_for_divisor() 118 if (vexit_match_inout(vexit, false, IOP_TEST_VALUE, 4, &v)) { in test_for_divisor() 121 ventry_fulfill_inout(vexit, ventry, 0); in test_for_divisor() 143 test_fail_vmexit(vexit); in test_for_divisor() 168 struct vm_exit vexit = { 0 }; in main() local 170 test_for_divisor(vcpu, 2, &ventry, &vexit); in main() [all …]
|
H A D | vlapic_mmio_access.c | 79 struct vm_exit vexit = { 0 }; in main() local 83 test_run_vcpu(vcpu, &ventry, &vexit); in main() 103 if (vexit.exitcode == VM_EXITCODE_VMX && in main() 104 (vexit.u.vmx.exit_reason == 44 || in main() 105 vexit.u.vmx.exit_reason == 56)) { in main() 107 test_fail_vmexit(&vexit); in main() 115 test_fail_vmexit(&vexit); in main() 118 test_fail_vmexit(&vexit); in main()
|
H A D | wrmsr_tsc.c | 52 struct vm_entry ventry = { 0 }; struct vm_exit vexit = { 0 }; in main() local 58 test_run_vcpu(vcpu, &ventry, &vexit); in main() 63 test_fail_vmexit(&vexit); in main() 67 if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, in main() 73 ventry_fulfill_inout(&vexit, &ventry, 0); in main() 95 test_fail_vmexit(&vexit); in main()
|
H A D | rdmsr_tsc.c | 52 struct vm_entry ventry = { 0 }; struct vm_exit vexit = { 0 }; in main() local 58 test_run_vcpu(vcpu, &ventry, &vexit); in main() 63 test_fail_vmexit(&vexit); in main() 67 if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, in main() 73 ventry_fulfill_inout(&vexit, &ventry, 0); in main() 96 test_fail_vmexit(&vexit); in main()
|
H A D | guest_tsc_adjust.c | 82 struct vm_exit vexit = { 0 }; in main() local 89 test_run_vcpu(vcpu, &ventry, &vexit); in main() 94 test_fail_vmexit(&vexit); in main() 98 if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, in main() 104 ventry_fulfill_inout(&vexit, &ventry, 0); in main() 122 test_fail_vmexit(&vexit); in main()
|
H A D | vpmtmr_freq.c | 108 struct vm_exit vexit = { 0 }; in main() local 118 test_run_vcpu(vcpu, &ventry, &vexit); in main() 122 test_fail_vmexit(&vexit); in main() 126 if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, &v)) { in main() 128 readings[nread].value = vexit.u.inout.eax; in main() 130 ventry_fulfill_inout(&vexit, &ventry, 0); in main() 151 test_fail_vmexit(&vexit); in main()
|
H A D | vatpit_freq.c | 98 struct vm_exit vexit = { 0 }; in main() local 112 test_run_vcpu(vcpu, &ventry, &vexit); in main() 116 test_fail_vmexit(&vexit); in main() 120 if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 2, &v)) { in main() 124 ventry_fulfill_inout(&vexit, &ventry, 0); in main() 145 test_fail_vmexit(&vexit); in main()
|
H A D | tsc_freq_ctrl.c | 129 struct vm_exit vexit = { 0 }; in do_freq_test() local 145 test_run_vcpu(vcpu, &ventry, &vexit); in do_freq_test() 150 test_fail_vmexit(&vexit); in do_freq_test() 154 if (vexit_match_inout(&vexit, true, IOP_TEST_VALUE, 4, in do_freq_test() 157 ventry_fulfill_inout(&vexit, &ventry, guest_ticks); in do_freq_test() 159 } else if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, in do_freq_test() 169 ventry_fulfill_inout(&vexit, &ventry, 0); in do_freq_test() 181 ventry_fulfill_inout(&vexit, &ventry, 0); in do_freq_test() 184 test_fail_vmexit(&vexit); in do_freq_test()
|
H A D | vhpet_freq.c | 103 struct vm_exit vexit = { 0 }; in main() local 113 test_run_vcpu(vcpu, &ventry, &vexit); in main() 117 test_fail_vmexit(&vexit); in main() 121 if (vexit_match_inout(&vexit, false, IOP_TEST_VALUE, 4, &v)) { in main() 125 ventry_fulfill_inout(&vexit, &ventry, 0); in main() 146 test_fail_vmexit(&vexit); in main()
|
H A D | vlapic_msr_access.c | 59 struct vm_exit vexit = { 0 }; in main() local 63 test_run_vcpu(vcpu, &ventry, &vexit); in main() 75 test_fail_vmexit(&vexit); in main()
|
H A D | vrtc_ops.c | 86 struct vm_exit vexit = { 0 }; in main() local 90 test_run_vcpu(vcpu, &ventry, &vexit); in main() 109 test_fail_vmexit(&vexit); in main()
|
/illumos-gate/usr/src/test/bhyve-tests/tests/perf/ |
H A D | entry_exit.c | 101 handle_exit(struct vmctx *ctx, const struct vm_exit *vexit, in handle_exit() argument 106 if (vexit_match_inout(vexit, true, IOP_TEST_PARAM0, 4, NULL)) { in handle_exit() 107 ventry_fulfill_inout(vexit, ventry, opt_repeat_count); in handle_exit() 110 if (vexit_match_inout(vexit, false, IOP_TEST_VALUE, 4, &outval)) { in handle_exit() 111 ventry_fulfill_inout(vexit, ventry, 0); in handle_exit() 118 test_fail_vmexit(vexit); in handle_exit() 198 struct vm_exit vexit = { 0 }; in main() local 202 test_run_vcpu(vcpu, &ventry, &vexit); in main() 207 handle_exit(ctx, &vexit, &ventry); in main() 222 test_fail_vmexit(&vexit); in main()
|