Lines Matching +full:32 +full:- +full:bit
91 #define MASK(_bits) GENMASK_ULL((_bits) - 1, 0)
142 { MASK(32), PIN_CONTROLS },
143 { MASK(32), CPU_EXEC_CTRL0 },
144 { MASK(32), EXC_BITMAP },
145 { MASK(32), PF_ERROR_MASK },
146 { MASK(32), PF_ERROR_MATCH },
147 { MASK(32), CR3_TARGET_COUNT },
148 { MASK(32), EXI_CONTROLS },
149 { MASK(32), EXI_MSR_ST_CNT },
150 { MASK(32), EXI_MSR_LD_CNT },
151 { MASK(32), ENT_CONTROLS },
152 { MASK(32), ENT_MSR_LD_CNT },
153 { MASK(32), ENT_INTR_INFO },
154 { MASK(32), ENT_INTR_ERROR },
155 { MASK(32), ENT_INST_LEN },
156 { MASK(32), TPR_THRESHOLD },
157 { MASK(32), CPU_EXEC_CTRL1 },
159 { MASK(32), VMX_INST_ERROR },
160 { MASK(32), EXI_REASON },
161 { MASK(32), EXI_INTR_INFO },
162 { MASK(32), EXI_INTR_ERROR },
163 { MASK(32), IDT_VECT_INFO },
164 { MASK(32), IDT_VECT_ERROR },
165 { MASK(32), EXI_INST_LEN },
166 { MASK(32), EXI_INST_INFO },
168 { MASK(32), GUEST_LIMIT_ES },
169 { MASK(32), GUEST_LIMIT_CS },
170 { MASK(32), GUEST_LIMIT_SS },
171 { MASK(32), GUEST_LIMIT_DS },
172 { MASK(32), GUEST_LIMIT_FS },
173 { MASK(32), GUEST_LIMIT_GS },
174 { MASK(32), GUEST_LIMIT_LDTR },
175 { MASK(32), GUEST_LIMIT_TR },
176 { MASK(32), GUEST_LIMIT_GDTR },
177 { MASK(32), GUEST_LIMIT_IDTR },
186 { MASK(32), GUEST_INTR_STATE },
187 { MASK(32), GUEST_ACTV_STATE },
188 { MASK(32), GUEST_SMBASE },
189 { MASK(32), GUEST_SYSENTER_CS },
190 { MASK(32), PREEMPT_TIMER_VALUE },
192 { MASK(32), HOST_SYSENTER_CS },
255 return (f->encoding >> VMCS_FIELD_TYPE_SHIFT) & 0x3; in vmcs_field_type()
273 value |= (f->encoding << 8); in vmcs_field_value()
274 value |= 0xdeadbeefull << 32; in vmcs_field_value()
276 return value & f->mask; in vmcs_field_value()
281 vmcs_write(f->encoding, vmcs_field_value(f, cookie)); in set_vmcs_field()
290 if (f->encoding == VMX_INST_ERROR) { in check_vmcs_field()
291 printf("Skipping volatile field %lx\n", f->encoding); in check_vmcs_field()
295 ret = vmcs_read_safe(f->encoding, &actual); in check_vmcs_field()
302 printf("Skipping read-only field %lx\n", f->encoding); in check_vmcs_field()
307 actual &= f->mask; in check_vmcs_field()
313 f->encoding, (unsigned long) expected, (unsigned long) actual); in check_vmcs_field()
346 for (idx = (1 << 9) - 1; idx >= 0; idx--) { in find_vmcs_max_index()
372 vmcs->hdr.revision_id = basic_msr.revision; in test_vmwrite_vmread()
396 * Execute VMREAD/VMWRITE with a not-PRESENT memory operand, and verify in __test_vmread_vmwrite_pf()
433 vmcs->hdr.revision_id = basic_msr.revision; in test_vmread_vmwrite_pf()
438 * Test with two values to candy-stripe the 5 flags stored/loaded by in test_vmread_vmwrite_pf()
459 vmcs->hdr.revision_id = basic_msr.revision; in test_vmcs_high()
485 vmcs[i]->hdr.revision_id = basic_msr.revision; in test_vmcs_lifecycle()
579 if (current->syscall_handler) in syscall_handler()
580 current->syscall_handler(syscall_no); in syscall_handler()
676 if (result->entered) in print_vmentry_failure_info()
679 if (result->vm_fail) { in print_vmentry_failure_info()
680 printf("VM-Fail on %s: ", result->instr); in print_vmentry_failure_info()
681 switch (result->flags & VMX_ENTRY_FLAGS) { in print_vmentry_failure_info()
683 printf("current-VMCS pointer is not valid.\n"); in print_vmentry_failure_info()
690 printf("unexpected flags %lx!\n", result->flags); in print_vmentry_failure_info()
695 printf("VM-Exit failure on %s (reason=%#x, qual=%#lx): ", in print_vmentry_failure_info()
696 result->instr, result->exit_reason.full, qual); in print_vmentry_failure_info()
698 switch (result->exit_reason.basic) { in print_vmentry_failure_info()
706 printf("machine-check event\n"); in print_vmentry_failure_info()
710 result->exit_reason.basic); in print_vmentry_failure_info()
713 if (!result->exit_reason.failed_vmentry) in print_vmentry_failure_info()
714 printf("\tVMX_ENTRY_FAILURE BIT NOT SET!\n"); in print_vmentry_failure_info()
716 if (result->exit_reason.full & 0x7fff0000) in print_vmentry_failure_info()
734 vmcs[0]->hdr.revision_id = basic_msr.revision; in test_vmclear_flushing()
765 * Note- The tests below do not necessarily have a in test_vmclear()
794 if (current->v2) in guest_main()
797 current->guest_main(); in guest_main()
838 gpa += 1ul << EPT_LEVEL_SHIFT(level - 1); in split_large_ept_entry()
868 for (level = EPT_PAGE_LEVEL; level > pte_level; --level) { in install_ept_entry()
897 /* Map a 1G-size page */
907 /* Map a 2M-size page */
959 for (l = EPT_PAGE_LEVEL; ; --l) { in get_ept_pte()
983 for (l = EPT_PAGE_LEVEL; ; --l) { in clear_ept_ad_pte()
1003 for (l = EPT_PAGE_LEVEL; ; --l) { in clear_ept_ad()
1016 offset_in_page = guest_addr & ((1 << EPT_LEVEL_SHIFT(l)) - 1); in clear_ept_ad()
1033 for (l = EPT_PAGE_LEVEL; ; --l) { in check_ept_ad()
1037 printf("EPT - guest level %d page table is not mapped.\n", l); in check_ept_ad()
1044 report_fail("EPT - guest level %d page table A=%d/D=%d", in check_ept_ad()
1059 report_pass("EPT - guest page table structures A=%d/D=%d", in check_ept_ad()
1064 offset_in_page = guest_addr & ((1 << EPT_LEVEL_SHIFT(l)) - 1); in check_ept_ad()
1068 report_fail("EPT - guest physical address is not mapped"); in check_ept_ad()
1072 "EPT - guest physical address A=%d/D=%d", in check_ept_ad()
1086 for (l = EPT_PAGE_LEVEL; ; --l) { in set_ept_pte()
1099 /* 26.2 CHECKS ON VMX CONTROLS AND HOST-STATE AREA */ in init_vmcs_ctrl()
1115 /* 26.2 CHECKS ON VMX CONTROLS AND HOST-STATE AREA */ in init_vmcs_host()
1237 (*vmcs)->hdr.revision_id = basic_msr.revision; in init_vmcs()
1383 "test FEATURE_CONTROL lock bit"); in test_vmx_feature_control()
1408 unsigned long required1, disallowed1, val, bit; in test_vmxon_bad_cr() local
1422 bit = BIT(i); in test_vmxon_bad_cr()
1427 * gets to VMXON. nVMX tests are 64-bit only, so CR4.PAE is in test_vmxon_bad_cr()
1431 * bit set at all levels. in test_vmxon_bad_cr()
1433 if ((cr_number == 0 && (bit == X86_CR0_PE || bit == X86_CR0_PG)) || in test_vmxon_bad_cr()
1434 (cr_number == 4 && (bit == X86_CR4_PAE || bit == X86_CR4_SMAP || in test_vmxon_bad_cr()
1435 bit == X86_CR4_SMEP || bit == X86_CR4_CET))) in test_vmxon_bad_cr()
1438 if (!(bit & required1) && !(bit & disallowed1)) { in test_vmxon_bad_cr()
1439 if (!write_cr_safe(cr_number, orig_cr ^ bit)) { in test_vmxon_bad_cr()
1440 *flexible_bits |= bit; in test_vmxon_bad_cr()
1448 if (required1 & bit) in test_vmxon_bad_cr()
1449 val = orig_cr & ~bit; in test_vmxon_bad_cr()
1451 val = orig_cr | bit; in test_vmxon_bad_cr()
1461 if ((cr_number == 0 && bit == X86_CR0_PE) || in test_vmxon_bad_cr()
1462 (cr_number == 4 && bit == X86_CR4_VMXE)) in test_vmxon_bad_cr()
1469 "VMXON with CR%d bit %d %s should %s, got '%d'", in test_vmxon_bad_cr()
1470 cr_number, i, (required1 & bit) ? "cleared" : "set", in test_vmxon_bad_cr()
1517 /* and finally a valid region, with valid-but-tweaked cr0/cr4 */ in test_vmxon()
1534 vmcs->hdr.revision_id = basic_msr.revision; in test_vmptrld()
1554 "test vmptrld with vmxon region vm-instruction error"); in test_vmptrld()
1637 fixed0 = -1ull; in test_vmx_caps()
1734 current->exits++; in exit_handler()
1739 ret = current->exit_handler(exit_reason); in exit_handler()
1746 * Tries to enter the guest, populates @result with VM-Fail, VM-Exit, entered,
1774 : [vm_fail]"+m"(result->vm_fail), in vmx_enter_guest()
1775 [vm_fail_flags]"=m"(result->flags) in vmx_enter_guest()
1781 result->vmlaunch = !launched; in vmx_enter_guest()
1782 result->instr = launched ? "vmresume" : "vmlaunch"; in vmx_enter_guest()
1783 result->exit_reason.full = result->vm_fail ? 0xdead : in vmx_enter_guest()
1785 result->entered = !result->vm_fail && in vmx_enter_guest()
1786 !result->exit_reason.failed_vmentry; in vmx_enter_guest()
1803 } else if (current->entry_failure_handler) { in vmx_run()
1804 ret = current->entry_failure_handler(&result); in vmx_run()
1834 step->func(step->data); in run_teardown_step()
1842 if (test->v2) { in test_run()
1844 if (test->init || test->guest_main || test->exit_handler || in test_run()
1845 test->syscall_handler) { in test_run()
1853 if (test->name == NULL) in test_run()
1854 test->name = "(no name)"; in test_run()
1860 init_vmcs(&(test->vmcs)); in test_run()
1861 /* Directly call test->init is ok here, init_vmcs has done in test_run()
1863 if (test->init && test->init(test->vmcs) != VMX_TEST_START) in test_run()
1867 test->exits = 0; in test_run()
1869 regs = test->guest_regs; in test_run()
1873 printf("\nTest suite: %s\n", test->name); in test_run()
1882 if (test->v2) in test_run()
1883 test->v2(); in test_run()
1888 run_teardown_step(&teardown_steps[--teardown_count]); in test_run()
1913 step->func = func; in test_add_teardown()
1914 step->data = data; in test_add_teardown()
1919 assert(current->v2); in __test_set_guest()
1986 if (result->vm_fail) { in __enter_guest()
1991 if (result->exit_reason.failed_vmentry) { in __enter_guest()
1993 result->exit_reason.basic != VMX_FAIL_STATE) in __enter_guest()
1999 check_for_guest_termination(result->exit_reason); in __enter_guest()
2018 report(result.vm_fail, "VM-Fail occurred as expected"); in enter_guest_with_bad_controls()
2020 "FLAGS set correctly on VM-Fail"); in enter_guest_with_bad_controls()
2022 "VM-Inst Error # is %d (VM entry with invalid control field(s))", in enter_guest_with_bad_controls()
2057 if (filter[0] == '-') { in test_wanted()
2085 argc--; in main()
2088 printf("WARNING: vmx not supported, add '-cpu host'\n"); in main()