Xen Test Framework
vmx.c
Go to the documentation of this file.
1
6#include <xtf/lib.h>
7
8#include <arch/vmx.h>
9
10const char *vmx_insn_err_strerror(unsigned int err)
11{
12#define ERR(x) [VMERR_ ## x] = #x
13 static const char *const strings[] = {
14 ERR(VMCALL_IN_ROOT),
15 ERR(VMCLEAR_BAD_PADDR),
16 ERR(VMCLEAR_WITH_VMXON_PTR),
17 ERR(VMLAUNCH_NONCLEAR_VMCS),
18 ERR(VMRESUME_NONLAUNCHED_VMCS),
19 ERR(VMRESUME_AFTER_VMXOFF),
20 ERR(INVALID_CONTROL_STATE),
21 ERR(INVALID_HOST_STATE),
22 ERR(VMPTRLD_BAD_PADDR),
23 ERR(VMPTRLD_WITH_VMXON_PTR),
24 ERR(VMPTRLD_BAD_REVID),
25 ERR(UNSUPPORTED_VMCS_FIELD),
26 ERR(VMWRITE_READONLY_FIELD),
27 ERR(VMXON_IN_ROOT),
28 ERR(VMENTRY_BAD_EXECUTIVE),
29 ERR(VMENTRY_NONLAUNCHED_EXECUTIVE),
30 ERR(VMENTRY_WITHOUT_VMXON_PTR),
31 ERR(VMCALL_NONCLEAR_VMCS),
32 ERR(VMCALL_BAD_CONTROL_STATE),
33 ERR(VMCALL_BAD_MSEG_REVID),
34 ERR(VMXOFF_UNDER_DUAL),
35 ERR(VMCALL_BAD_SMM_MONITOR),
36 ERR(BAD_EXECUTIVE_STATE),
37 ERR(VMENTRY_MOVSS),
38 ERR(BAD_INV_OPERAND),
39 };
40#undef ERR
41
42 if ( err < ARRAY_SIZE(strings) && strings[err] )
43 return strings[err];
44 else
45 return "<unknown>";
46}
47
48/*
49 * Local variables:
50 * mode: C
51 * c-file-style: "BSD"
52 * c-basic-offset: 4
53 * tab-width: 4
54 * indent-tabs-mode: nil
55 * End:
56 */
#define ARRAY_SIZE(a)
Definition: lib.h:8
const char * vmx_insn_err_strerror(unsigned int err)
Error string for VMX Instruction Errors.
Definition: vmx.c:10
#define ERR(x)
Helpers for VT-x.