Lines Matching refs:error
485 int error, fd, map_size; in dump_msr_bitmap() local
488 error = -1; in dump_msr_bitmap()
513 error = 0; in dump_msr_bitmap()
520 return (error); in dump_msr_bitmap()
658 int error = 0; in get_all_registers() local
660 if (!error && (get_efer || get_all)) { in get_all_registers()
661 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_EFER, &efer); in get_all_registers()
662 if (error == 0) in get_all_registers()
666 if (!error && (get_cr0 || get_all)) { in get_all_registers()
667 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_CR0, &cr0); in get_all_registers()
668 if (error == 0) in get_all_registers()
672 if (!error && (get_cr2 || get_all)) { in get_all_registers()
673 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_CR2, &cr2); in get_all_registers()
674 if (error == 0) in get_all_registers()
678 if (!error && (get_cr3 || get_all)) { in get_all_registers()
679 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_CR3, &cr3); in get_all_registers()
680 if (error == 0) in get_all_registers()
684 if (!error && (get_cr4 || get_all)) { in get_all_registers()
685 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_CR4, &cr4); in get_all_registers()
686 if (error == 0) in get_all_registers()
690 if (!error && (get_dr0 || get_all)) { in get_all_registers()
691 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR0, &dr0); in get_all_registers()
692 if (error == 0) in get_all_registers()
696 if (!error && (get_dr1 || get_all)) { in get_all_registers()
697 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR1, &dr1); in get_all_registers()
698 if (error == 0) in get_all_registers()
702 if (!error && (get_dr2 || get_all)) { in get_all_registers()
703 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR2, &dr2); in get_all_registers()
704 if (error == 0) in get_all_registers()
708 if (!error && (get_dr3 || get_all)) { in get_all_registers()
709 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR3, &dr3); in get_all_registers()
710 if (error == 0) in get_all_registers()
714 if (!error && (get_dr6 || get_all)) { in get_all_registers()
715 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR6, &dr6); in get_all_registers()
716 if (error == 0) in get_all_registers()
720 if (!error && (get_dr7 || get_all)) { in get_all_registers()
721 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR7, &dr7); in get_all_registers()
722 if (error == 0) in get_all_registers()
726 if (!error && (get_rsp || get_all)) { in get_all_registers()
727 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RSP, &rsp); in get_all_registers()
728 if (error == 0) in get_all_registers()
732 if (!error && (get_rip || get_all)) { in get_all_registers()
733 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); in get_all_registers()
734 if (error == 0) in get_all_registers()
738 if (!error && (get_rax || get_all)) { in get_all_registers()
739 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RAX, &rax); in get_all_registers()
740 if (error == 0) in get_all_registers()
744 if (!error && (get_rbx || get_all)) { in get_all_registers()
745 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RBX, &rbx); in get_all_registers()
746 if (error == 0) in get_all_registers()
750 if (!error && (get_rcx || get_all)) { in get_all_registers()
751 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RCX, &rcx); in get_all_registers()
752 if (error == 0) in get_all_registers()
756 if (!error && (get_rdx || get_all)) { in get_all_registers()
757 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RDX, &rdx); in get_all_registers()
758 if (error == 0) in get_all_registers()
762 if (!error && (get_rsi || get_all)) { in get_all_registers()
763 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RSI, &rsi); in get_all_registers()
764 if (error == 0) in get_all_registers()
768 if (!error && (get_rdi || get_all)) { in get_all_registers()
769 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RDI, &rdi); in get_all_registers()
770 if (error == 0) in get_all_registers()
774 if (!error && (get_rbp || get_all)) { in get_all_registers()
775 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RBP, &rbp); in get_all_registers()
776 if (error == 0) in get_all_registers()
780 if (!error && (get_r8 || get_all)) { in get_all_registers()
781 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R8, &r8); in get_all_registers()
782 if (error == 0) in get_all_registers()
786 if (!error && (get_r9 || get_all)) { in get_all_registers()
787 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R9, &r9); in get_all_registers()
788 if (error == 0) in get_all_registers()
792 if (!error && (get_r10 || get_all)) { in get_all_registers()
793 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R10, &r10); in get_all_registers()
794 if (error == 0) in get_all_registers()
798 if (!error && (get_r11 || get_all)) { in get_all_registers()
799 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R11, &r11); in get_all_registers()
800 if (error == 0) in get_all_registers()
804 if (!error && (get_r12 || get_all)) { in get_all_registers()
805 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R12, &r12); in get_all_registers()
806 if (error == 0) in get_all_registers()
810 if (!error && (get_r13 || get_all)) { in get_all_registers()
811 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R13, &r13); in get_all_registers()
812 if (error == 0) in get_all_registers()
816 if (!error && (get_r14 || get_all)) { in get_all_registers()
817 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R14, &r14); in get_all_registers()
818 if (error == 0) in get_all_registers()
822 if (!error && (get_r15 || get_all)) { in get_all_registers()
823 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_R15, &r15); in get_all_registers()
824 if (error == 0) in get_all_registers()
828 if (!error && (get_rflags || get_all)) { in get_all_registers()
829 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RFLAGS, in get_all_registers()
831 if (error == 0) in get_all_registers()
835 return (error); in get_all_registers()
842 int error = 0; in get_all_segments() local
844 if (!error && (get_desc_ds || get_all)) { in get_all_segments()
845 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_DS, in get_all_segments()
847 if (error == 0) { in get_all_segments()
853 if (!error && (get_desc_es || get_all)) { in get_all_segments()
854 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_ES, in get_all_segments()
856 if (error == 0) { in get_all_segments()
862 if (!error && (get_desc_fs || get_all)) { in get_all_segments()
863 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_FS, in get_all_segments()
865 if (error == 0) { in get_all_segments()
871 if (!error && (get_desc_gs || get_all)) { in get_all_segments()
872 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_GS, in get_all_segments()
874 if (error == 0) { in get_all_segments()
880 if (!error && (get_desc_ss || get_all)) { in get_all_segments()
881 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_SS, in get_all_segments()
883 if (error == 0) { in get_all_segments()
889 if (!error && (get_desc_cs || get_all)) { in get_all_segments()
890 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_CS, in get_all_segments()
892 if (error == 0) { in get_all_segments()
898 if (!error && (get_desc_tr || get_all)) { in get_all_segments()
899 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_TR, in get_all_segments()
901 if (error == 0) { in get_all_segments()
907 if (!error && (get_desc_ldtr || get_all)) { in get_all_segments()
908 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_LDTR, in get_all_segments()
910 if (error == 0) { in get_all_segments()
916 if (!error && (get_desc_gdtr || get_all)) { in get_all_segments()
917 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_GDTR, in get_all_segments()
919 if (error == 0) { in get_all_segments()
925 if (!error && (get_desc_idtr || get_all)) { in get_all_segments()
926 error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_IDTR, in get_all_segments()
928 if (error == 0) { in get_all_segments()
934 if (!error && (get_cs || get_all)) { in get_all_segments()
935 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_CS, &cs); in get_all_segments()
936 if (error == 0) in get_all_segments()
940 if (!error && (get_ds || get_all)) { in get_all_segments()
941 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DS, &ds); in get_all_segments()
942 if (error == 0) in get_all_segments()
946 if (!error && (get_es || get_all)) { in get_all_segments()
947 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_ES, &es); in get_all_segments()
948 if (error == 0) in get_all_segments()
952 if (!error && (get_fs || get_all)) { in get_all_segments()
953 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_FS, &fs); in get_all_segments()
954 if (error == 0) in get_all_segments()
958 if (!error && (get_gs || get_all)) { in get_all_segments()
959 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_GS, &gs); in get_all_segments()
960 if (error == 0) in get_all_segments()
964 if (!error && (get_ss || get_all)) { in get_all_segments()
965 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_SS, &ss); in get_all_segments()
966 if (error == 0) in get_all_segments()
970 if (!error && (get_tr || get_all)) { in get_all_segments()
971 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_TR, &tr); in get_all_segments()
972 if (error == 0) in get_all_segments()
976 if (!error && (get_ldtr || get_all)) { in get_all_segments()
977 error = vm_get_register(ctx, vcpu, VM_REG_GUEST_LDTR, &ldtr); in get_all_segments()
978 if (error == 0) in get_all_segments()
982 return (error); in get_all_segments()
989 int error = 0; in get_misc_vmcs() local
991 if (!error && (get_cr0_mask || get_all)) { in get_misc_vmcs()
993 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR0_MASK, &cr0mask); in get_misc_vmcs()
994 if (error == 0) in get_misc_vmcs()
998 if (!error && (get_cr0_shadow || get_all)) { in get_misc_vmcs()
1000 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR0_SHADOW, in get_misc_vmcs()
1002 if (error == 0) in get_misc_vmcs()
1006 if (!error && (get_cr4_mask || get_all)) { in get_misc_vmcs()
1008 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR4_MASK, &cr4mask); in get_misc_vmcs()
1009 if (error == 0) in get_misc_vmcs()
1013 if (!error && (get_cr4_shadow || get_all)) { in get_misc_vmcs()
1015 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR4_SHADOW, in get_misc_vmcs()
1017 if (error == 0) in get_misc_vmcs()
1021 if (!error && (get_cr3_targets || get_all)) { in get_misc_vmcs()
1023 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR3_TARGET_COUNT, in get_misc_vmcs()
1025 if (error == 0) { in get_misc_vmcs()
1030 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR3_TARGET0, in get_misc_vmcs()
1032 if (error == 0) { in get_misc_vmcs()
1037 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR3_TARGET1, in get_misc_vmcs()
1039 if (error == 0) { in get_misc_vmcs()
1044 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR3_TARGET2, in get_misc_vmcs()
1046 if (error == 0) { in get_misc_vmcs()
1051 error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR3_TARGET3, in get_misc_vmcs()
1053 if (error == 0) { in get_misc_vmcs()
1059 if (!error && (get_pinbased_ctls || get_all)) { in get_misc_vmcs()
1060 error = vm_get_vmcs_field(ctx, vcpu, VMCS_PIN_BASED_CTLS, &ctl); in get_misc_vmcs()
1061 if (error == 0) in get_misc_vmcs()
1065 if (!error && (get_procbased_ctls || get_all)) { in get_misc_vmcs()
1066 error = vm_get_vmcs_field(ctx, vcpu, in get_misc_vmcs()
1068 if (error == 0) in get_misc_vmcs()
1072 if (!error && (get_procbased_ctls2 || get_all)) { in get_misc_vmcs()
1073 error = vm_get_vmcs_field(ctx, vcpu, in get_misc_vmcs()
1075 if (error == 0) in get_misc_vmcs()
1079 if (!error && (get_vmcs_gla || get_all)) { in get_misc_vmcs()
1080 error = vm_get_vmcs_field(ctx, vcpu, in get_misc_vmcs()
1082 if (error == 0) in get_misc_vmcs()
1086 if (!error && (get_vmcs_gpa || get_all)) { in get_misc_vmcs()
1087 error = vm_get_vmcs_field(ctx, vcpu, in get_misc_vmcs()
1089 if (error == 0) in get_misc_vmcs()
1093 if (!error && (get_vmcs_entry_interruption_info || in get_misc_vmcs()
1095 error = vm_get_vmcs_field(ctx, vcpu, VMCS_ENTRY_INTR_INFO,&u64); in get_misc_vmcs()
1096 if (error == 0) { in get_misc_vmcs()
1102 if (!error && (get_tpr_threshold || get_all)) { in get_misc_vmcs()
1104 error = vm_get_vmcs_field(ctx, vcpu, VMCS_TPR_THRESHOLD, in get_misc_vmcs()
1106 if (error == 0) in get_misc_vmcs()
1110 if (!error && (get_inst_err || get_all)) { in get_misc_vmcs()
1112 error = vm_get_vmcs_field(ctx, vcpu, VMCS_INSTRUCTION_ERROR, in get_misc_vmcs()
1114 if (error == 0) { in get_misc_vmcs()
1120 if (!error && (get_exit_ctls || get_all)) { in get_misc_vmcs()
1121 error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_CTLS, &ctl); in get_misc_vmcs()
1122 if (error == 0) in get_misc_vmcs()
1126 if (!error && (get_entry_ctls || get_all)) { in get_misc_vmcs()
1127 error = vm_get_vmcs_field(ctx, vcpu, VMCS_ENTRY_CTLS, &ctl); in get_misc_vmcs()
1128 if (error == 0) in get_misc_vmcs()
1132 if (!error && (get_host_pat || get_all)) { in get_misc_vmcs()
1133 error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_IA32_PAT, &pat); in get_misc_vmcs()
1134 if (error == 0) in get_misc_vmcs()
1138 if (!error && (get_host_cr0 || get_all)) { in get_misc_vmcs()
1139 error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_CR0, &cr0); in get_misc_vmcs()
1140 if (error == 0) in get_misc_vmcs()
1144 if (!error && (get_host_cr3 || get_all)) { in get_misc_vmcs()
1145 error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_CR3, &cr3); in get_misc_vmcs()
1146 if (error == 0) in get_misc_vmcs()
1150 if (!error && (get_host_cr4 || get_all)) { in get_misc_vmcs()
1151 error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_CR4, &cr4); in get_misc_vmcs()
1152 if (error == 0) in get_misc_vmcs()
1156 if (!error && (get_host_rip || get_all)) { in get_misc_vmcs()
1157 error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_RIP, &rip); in get_misc_vmcs()
1158 if (error == 0) in get_misc_vmcs()
1162 if (!error && (get_host_rsp || get_all)) { in get_misc_vmcs()
1163 error = vm_get_vmcs_field(ctx, vcpu, VMCS_HOST_RSP, &rsp); in get_misc_vmcs()
1164 if (error == 0) in get_misc_vmcs()
1168 if (!error && (get_vmcs_link || get_all)) { in get_misc_vmcs()
1169 error = vm_get_vmcs_field(ctx, vcpu, VMCS_LINK_POINTER, &addr); in get_misc_vmcs()
1170 if (error == 0) in get_misc_vmcs()
1174 if (!error && (get_vmcs_exit_interruption_info || get_all)) { in get_misc_vmcs()
1175 error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_INTR_INFO, &u64); in get_misc_vmcs()
1176 if (error == 0) { in get_misc_vmcs()
1182 if (!error && (get_vmcs_exit_interruption_error || get_all)) { in get_misc_vmcs()
1183 error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_INTR_ERRCODE, in get_misc_vmcs()
1185 if (error == 0) { in get_misc_vmcs()
1191 if (!error && (get_vmcs_interruptibility || get_all)) { in get_misc_vmcs()
1192 error = vm_get_vmcs_field(ctx, vcpu, in get_misc_vmcs()
1194 if (error == 0) { in get_misc_vmcs()
1200 if (!error && (get_vmcs_exit_inst_length || get_all)) { in get_misc_vmcs()
1201 error = vm_get_vmcs_field(ctx, vcpu, in get_misc_vmcs()
1203 if (error == 0) in get_misc_vmcs()
1208 if (!error && (get_vmcs_exit_qualification || get_all)) { in get_misc_vmcs()
1209 error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_QUALIFICATION, in get_misc_vmcs()
1211 if (error == 0) in get_misc_vmcs()
1216 return (error); in get_misc_vmcs()
1223 int error = 0; in get_misc_vmcb() local
1225 if (!error && (get_vmcb_intercept || get_all)) { in get_misc_vmcb()
1226 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_CR_INTERCEPT, 4, in get_misc_vmcb()
1228 if (error == 0) in get_misc_vmcb()
1231 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_DR_INTERCEPT, 4, in get_misc_vmcb()
1233 if (error == 0) in get_misc_vmcb()
1236 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_EXC_INTERCEPT, 4, in get_misc_vmcb()
1238 if (error == 0) in get_misc_vmcb()
1241 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_INST1_INTERCEPT, in get_misc_vmcb()
1243 if (error == 0) in get_misc_vmcb()
1246 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_INST2_INTERCEPT, in get_misc_vmcb()
1248 if (error == 0) in get_misc_vmcb()
1252 if (!error && (get_vmcb_tlb_ctrl || get_all)) { in get_misc_vmcb()
1253 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_TLB_CTRL, in get_misc_vmcb()
1255 if (error == 0) in get_misc_vmcb()
1259 if (!error && (get_vmcb_exit_details || get_all)) { in get_misc_vmcb()
1260 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_EXITINFO1, in get_misc_vmcb()
1262 if (error == 0) in get_misc_vmcb()
1264 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_EXITINFO2, in get_misc_vmcb()
1266 if (error == 0) in get_misc_vmcb()
1268 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_EXITINTINFO, in get_misc_vmcb()
1270 if (error == 0) in get_misc_vmcb()
1274 if (!error && (get_vmcb_virq || get_all)) { in get_misc_vmcb()
1275 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_VIRQ, in get_misc_vmcb()
1277 if (error == 0) in get_misc_vmcb()
1281 if (!error && (get_apic_access_addr || get_all)) { in get_misc_vmcb()
1282 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_AVIC_BAR, 8, in get_misc_vmcb()
1284 if (error == 0) in get_misc_vmcb()
1288 if (!error && (get_virtual_apic_addr || get_all)) { in get_misc_vmcb()
1289 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_AVIC_PAGE, 8, in get_misc_vmcb()
1291 if (error == 0) in get_misc_vmcb()
1295 if (!error && (get_avic_table || get_all)) { in get_misc_vmcb()
1296 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_AVIC_LT, 8, in get_misc_vmcb()
1298 if (error == 0) in get_misc_vmcb()
1301 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_AVIC_PT, 8, in get_misc_vmcb()
1303 if (error == 0) in get_misc_vmcb()
1308 return (error); in get_misc_vmcb()
1589 int error, flags, prot, segid, delim; in show_memmap() local
1596 error = vm_mmap_getnext(ctx, &gpa, &segid, &segoff, &maplen, in show_memmap()
1598 if (error) in show_memmap()
1599 return (errno == ENOENT ? 0 : error); in show_memmap()
1601 error = vm_get_memseg(ctx, segid, &seglen, name, sizeof(name)); in show_memmap()
1602 if (error) in show_memmap()
1603 return (error); in show_memmap()
1636 int error, segid; in show_memseg() local
1642 error = vm_get_memseg(ctx, segid, &seglen, name, sizeof(name)); in show_memseg()
1643 if (error) in show_memseg()
1644 return (errno == EINVAL ? 0 : error); in show_memseg()
1662 int error, ch, vcpu, ptenum; in main() local
1842 error = 0; in main()
1844 if (!error && create) in main()
1845 error = vm_create(vmname); in main()
1847 if (!error) { in main()
1855 if (!error && memsize) in main()
1856 error = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); in main()
1858 if (!error && set_efer) in main()
1859 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_EFER, efer); in main()
1861 if (!error && set_cr0) in main()
1862 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR0, cr0); in main()
1864 if (!error && set_cr2) in main()
1865 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR2, cr2); in main()
1867 if (!error && set_cr3) in main()
1868 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR3, cr3); in main()
1870 if (!error && set_cr4) in main()
1871 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR4, cr4); in main()
1873 if (!error && set_dr0) in main()
1874 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR0, dr0); in main()
1876 if (!error && set_dr1) in main()
1877 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR1, dr1); in main()
1879 if (!error && set_dr2) in main()
1880 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR2, dr2); in main()
1882 if (!error && set_dr3) in main()
1883 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR3, dr3); in main()
1885 if (!error && set_dr6) in main()
1886 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR6, dr6); in main()
1888 if (!error && set_dr7) in main()
1889 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR7, dr7); in main()
1891 if (!error && set_rsp) in main()
1892 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RSP, rsp); in main()
1894 if (!error && set_rip) in main()
1895 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RIP, rip); in main()
1897 if (!error && set_rax) in main()
1898 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, rax); in main()
1900 if (!error && set_rflags) { in main()
1901 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RFLAGS, in main()
1905 if (!error && set_desc_ds) { in main()
1906 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_DS, in main()
1910 if (!error && set_desc_es) { in main()
1911 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_ES, in main()
1915 if (!error && set_desc_ss) { in main()
1916 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_SS, in main()
1920 if (!error && set_desc_cs) { in main()
1921 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_CS, in main()
1925 if (!error && set_desc_fs) { in main()
1926 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_FS, in main()
1930 if (!error && set_desc_gs) { in main()
1931 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_GS, in main()
1935 if (!error && set_desc_tr) { in main()
1936 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_TR, in main()
1940 if (!error && set_desc_ldtr) { in main()
1941 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_LDTR, in main()
1945 if (!error && set_desc_gdtr) { in main()
1946 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_GDTR, in main()
1950 if (!error && set_desc_idtr) { in main()
1951 error = vm_set_desc(ctx, vcpu, VM_REG_GUEST_IDTR, in main()
1955 if (!error && set_cs) in main()
1956 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CS, cs); in main()
1958 if (!error && set_ds) in main()
1959 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DS, ds); in main()
1961 if (!error && set_es) in main()
1962 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_ES, es); in main()
1964 if (!error && set_fs) in main()
1965 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_FS, fs); in main()
1967 if (!error && set_gs) in main()
1968 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_GS, gs); in main()
1970 if (!error && set_ss) in main()
1971 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_SS, ss); in main()
1973 if (!error && set_tr) in main()
1974 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_TR, tr); in main()
1976 if (!error && set_ldtr) in main()
1977 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_LDTR, ldtr); in main()
1979 if (!error && set_x2apic_state) in main()
1980 error = vm_set_x2apic_state(ctx, vcpu, x2apic_state); in main()
1982 if (!error && unassign_pptdev) in main()
1983 error = vm_unassign_pptdev(ctx, bus, slot, func); in main()
1985 if (!error && inject_nmi) { in main()
1986 error = vm_inject_nmi(ctx, vcpu); in main()
1989 if (!error && assert_lapic_lvt != -1) { in main()
1990 error = vm_lapic_local_irq(ctx, vcpu, assert_lapic_lvt); in main()
1993 if (!error && (get_memseg || get_all)) in main()
1994 error = show_memseg(ctx); in main()
1996 if (!error && (get_memmap || get_all)) in main()
1997 error = show_memmap(ctx); in main()
1999 if (!error) in main()
2000 error = get_all_registers(ctx, vcpu); in main()
2002 if (!error) in main()
2003 error = get_all_segments(ctx, vcpu); in main()
2005 if (!error) { in main()
2007 error = get_misc_vmcs(ctx, vcpu); in main()
2009 error = get_misc_vmcb(ctx, vcpu); in main()
2012 if (!error && (get_x2apic_state || get_all)) { in main()
2013 error = vm_get_x2apic_state(ctx, vcpu, &x2apic_state); in main()
2014 if (error == 0) in main()
2018 if (!error && (get_eptp || get_all)) { in main()
2020 error = vm_get_vmcs_field(ctx, vcpu, VMCS_EPTP, &eptp); in main()
2022 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_NPT_BASE, in main()
2024 if (error == 0) in main()
2029 if (!error && (get_exception_bitmap || get_all)) { in main()
2031 error = vm_get_vmcs_field(ctx, vcpu, in main()
2034 error = vm_get_vmcb_field(ctx, vcpu, in main()
2037 if (error == 0) in main()
2041 if (!error && (get_io_bitmap || get_all)) { in main()
2043 error = vm_get_vmcs_field(ctx, vcpu, VMCS_IO_BITMAP_A, in main()
2045 if (error == 0) in main()
2047 error = vm_get_vmcs_field(ctx, vcpu, VMCS_IO_BITMAP_B, in main()
2049 if (error == 0) in main()
2052 error = vm_get_vmcb_field(ctx, vcpu, in main()
2054 if (error == 0) in main()
2059 if (!error && (get_tsc_offset || get_all)) { in main()
2062 error = vm_get_vmcs_field(ctx, vcpu, VMCS_TSC_OFFSET, in main()
2065 error = vm_get_vmcb_field(ctx, vcpu, in main()
2068 if (error == 0) in main()
2072 if (!error && (get_msr_bitmap_address || get_all)) { in main()
2074 error = vm_get_vmcs_field(ctx, vcpu, VMCS_MSR_BITMAP, in main()
2077 error = vm_get_vmcb_field(ctx, vcpu, in main()
2079 if (error == 0) in main()
2083 if (!error && (get_msr_bitmap || get_all)) { in main()
2085 error = vm_get_vmcs_field(ctx, vcpu, in main()
2088 error = vm_get_vmcb_field(ctx, vcpu, in main()
2093 if (error == 0) in main()
2094 error = dump_msr_bitmap(vcpu, addr, cpu_intel); in main()
2097 if (!error && (get_vpid_asid || get_all)) { in main()
2100 error = vm_get_vmcs_field(ctx, vcpu, VMCS_VPID, &vpid); in main()
2102 error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_ASID, in main()
2104 if (error == 0) in main()
2109 if (!error && (get_guest_pat || get_all)) { in main()
2111 error = vm_get_vmcs_field(ctx, vcpu, in main()
2114 error = vm_get_vmcb_field(ctx, vcpu, in main()
2116 if (error == 0) in main()
2120 if (!error && (get_guest_sysenter || get_all)) { in main()
2122 error = vm_get_vmcs_field(ctx, vcpu, in main()
2126 error = vm_get_vmcb_field(ctx, vcpu, in main()
2130 if (error == 0) in main()
2133 error = vm_get_vmcs_field(ctx, vcpu, in main()
2137 error = vm_get_vmcb_field(ctx, vcpu, in main()
2141 if (error == 0) in main()
2144 error = vm_get_vmcs_field(ctx, vcpu, in main()
2148 error = vm_get_vmcb_field(ctx, vcpu, in main()
2151 if (error == 0) in main()
2155 if (!error && (get_exit_reason || get_all)) { in main()
2157 error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_REASON, in main()
2160 error = vm_get_vmcb_field(ctx, vcpu, in main()
2163 if (error == 0) in main()
2167 if (!error && setcap) { in main()
2170 error = vm_set_capability(ctx, vcpu, captype, capval); in main()
2171 if (error != 0 && errno == ENOENT) in main()
2175 if (!error && get_gpa_pmap) { in main()
2176 error = vm_get_gpa_pmap(ctx, gpa_pmap, pteval, &ptenum); in main()
2177 if (error == 0) { in main()
2186 if (!error && set_rtc_nvram) in main()
2187 error = vm_rtc_write(ctx, rtc_nvram_offset, rtc_nvram_value); in main()
2189 if (!error && (get_rtc_nvram || get_all)) { in main()
2190 error = vm_rtc_read(ctx, rtc_nvram_offset, &rtc_nvram_value); in main()
2191 if (error == 0) { in main()
2197 if (!error && set_rtc_time) in main()
2198 error = vm_rtc_settime(ctx, rtc_secs); in main()
2200 if (!error && (get_rtc_time || get_all)) { in main()
2201 error = vm_rtc_gettime(ctx, &rtc_secs); in main()
2202 if (error == 0) { in main()
2211 if (!error && (getcap || get_all)) { in main()
2222 error = vm_get_capability(ctx, vcpu, captype, &val); in main()
2223 if (error == 0) { in main()
2228 error = 0; in main()
2237 if (!error && (get_active_cpus || get_all)) { in main()
2238 error = vm_active_cpus(ctx, &cpus); in main()
2239 if (!error) in main()
2243 if (!error && (get_suspended_cpus || get_all)) { in main()
2244 error = vm_suspended_cpus(ctx, &cpus); in main()
2245 if (!error) in main()
2249 if (!error && (get_intinfo || get_all)) { in main()
2250 error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); in main()
2251 if (!error) { in main()
2257 if (!error && (get_stats || get_all)) { in main()
2273 if (!error && (get_cpu_topology || get_all)) { in main()
2281 if (!error && run) { in main()
2282 error = vm_run(ctx, vcpu, &vmexit); in main()
2283 if (error == 0) in main()
2286 printf("vm_run error %d\n", error); in main()
2289 if (!error && force_reset) in main()
2290 error = vm_suspend(ctx, VM_SUSPEND_RESET); in main()
2292 if (!error && force_poweroff) in main()
2293 error = vm_suspend(ctx, VM_SUSPEND_POWEROFF); in main()
2295 if (error) in main()
2298 if (!error && destroy) in main()
2302 exit(error); in main()