Lines Matching +full:non +full:- +full:identical

1 // SPDX-License-Identifier: GPL-2.0-only
3 * entry_from_vm86.c - tests kernel entries from vm86 mode
4 * Copyright (c) 2014-2015 Andrew Lutomirski
6 * This exercises a few paths that need to special-case vm86 mode.
58 if (ctx->uc_mcontext.gregs[REG_EFL] & X86_EFLAGS_VM || in sighandler()
59 (ctx->uc_mcontext.gregs[REG_CS] & 3) != 3) { in sighandler()
73 (unsigned long)ctx->uc_mcontext.gregs[REG_EFL], in sighandler()
74 (unsigned short)ctx->uc_mcontext.gregs[REG_CS]); in sighandler()
122 ".size vmcode, . - vmcode\n\t"
141 v86->regs.eip = eip; in do_test()
144 if (ret == -1 && (errno == ENOSYS || errno == EPERM)) { in do_test()
177 if (rettype == -1 || in do_test()
181 …L]\tIncorrect return reason (started at eip = 0x%lx, ended at eip = 0x%lx)\n", eip, v86->regs.eip); in do_test()
202 /* UMIP -- exit with INT3 unless kernel emulation did not trap #GP */ in do_umip_tests()
203 do_test(vm86, vmcode_umip - vmcode, VM86_TRAP, 3, "UMIP tests"); in do_umip_tests()
205 /* Results from displacement-only addressing */ in do_umip_tests()
210 /* Results from register-indirect addressing */ in do_umip_tests()
227 printf("[PASS]\tAll the results from SMSW are identical.\n"); in do_umip_tests()
232 printf("[PASS]\tAll the results from SGDT are identical.\n"); in do_umip_tests()
237 printf("[PASS]\tAll the results from SIDT are identical.\n"); in do_umip_tests()
240 do_test(vm86, vmcode_umip_str - vmcode, VM86_SIGNAL, 0, in do_umip_tests()
245 do_test(vm86, vmcode_umip_sldt - vmcode, VM86_SIGNAL, 0, in do_umip_tests()
255 MAP_ANONYMOUS | MAP_PRIVATE, -1,0); in main()
259 memcpy(addr, vmcode, end_vmcode - vmcode); in main()
275 /* #BR -- should deliver SIG??? */ in main()
276 do_test(&v86, vmcode_bound - vmcode, VM86_INTx, 5, "#BR"); in main()
279 * SYSENTER -- should cause #GP or #UD depending on CPU. in main()
280 * Expected return type -1 means that we shouldn't validate in main()
281 * the vm86 return value. This will avoid problems on non-SEP in main()
285 do_test(&v86, vmcode_sysenter - vmcode, -1, 0, "SYSENTER"); in main()
296 do_test(&v86, vmcode_syscall - vmcode, VM86_SIGNAL, 0, "SYSCALL"); in main()
302 do_test(&v86, vmcode_sti - vmcode, VM86_STI, 0, "STI with VIP set"); in main()
307 do_test(&v86, vmcode_popf_hlt - vmcode, VM86_UNKNOWN, 0, "POPF with VIP set and IF clear"); in main()
312 do_test(&v86, vmcode_popf_hlt - vmcode, VM86_STI, 0, "POPF with VIP and IF set"); in main()
317 do_test(&v86, vmcode_popf_hlt - vmcode, VM86_UNKNOWN, 0, "POPF with VIP clear and IF set"); in main()
321 /* INT3 -- should cause #BP */ in main()
322 do_test(&v86, vmcode_int3 - vmcode, VM86_TRAP, 3, "INT3"); in main()
324 /* INT80 -- should exit with "INTx 0x80" */ in main()
325 v86.regs.eax = (unsigned int)-1; in main()
326 do_test(&v86, vmcode_int80 - vmcode, VM86_INTx, 0x80, "int80"); in main()
328 /* UMIP -- should exit with INTx 0x80 unless UMIP was not disabled */ in main()