17 unsigned int high = ex & ~0xffffff;
21 unsigned int low = ex & 0xffffff;
39 char gotstr[48], expstr[48];
48 " Expected 0x%08x: %s\n"
50 func, exp, expstr, got, gotstr);
70 asm (
"vmread %[field], %[value]"
80 bool fail_valid =
false, fail_invalid =
false;
82 asm volatile (
"1: vmxon %[paddr];"
88 ASM_FLAG_OUT(
"=@ccc", [fail_invalid]
"+rm") (fail_invalid),
90 : [paddr]
"m" (paddr),
95 else if ( fail_invalid )
97 else if ( fail_valid )
106 bool fail_valid =
false, fail_invalid =
false;
108 asm volatile (
"1: vmptrld %[paddr];"
114 ASM_FLAG_OUT(
"=@ccc", [fail_invalid]
"+rm") (fail_invalid),
116 : [paddr]
"m" (paddr),
121 else if ( fail_invalid )
123 else if ( fail_valid )
132 bool fail_valid =
false, fail_invalid =
false;
134 asm volatile (
"1: vmxon %[paddr];"
140 ASM_FLAG_OUT(
"=@ccc", [fail_invalid]
"+rm") (fail_invalid),
142 : [paddr]
"m" (paddr),
147 else if ( fail_invalid )
149 else if ( fail_valid )
bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %edi.
static unsigned int str(void)
#define ASM_FLAG_OUT(yes, no)
unsigned int exinfo_t
Packed exception and error code information.
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
static uint64_t rdmsr(uint32_t idx)
Thin wrapper around an rdmsr instruction.
#define _p(v)
Express an abitrary integer v as void *.
void xtf_failure(const char *fmt,...)
Report a test failure.
int snprintf(char *buf, size_t size, const char *fmt,...)
static void decode_test_exinfo(char *str, size_t n, exinfo_t ex)
void check(const char *func, exinfo_t got, exinfo_t exp)
Compare an expectation against what really happenend, printing human-readable information in case of ...
uint32_t vmcs_revid
Hardware VMCS Revision ID.
static exinfo_t get_vmx_insn_err(void)
void vmx_collect_data(void)
Collect real information about the VT-x environment, for use by test.
exinfo_t stub_vmxon_user(uint64_t paddr)
exinfo_t stub_vmptrld(uint64_t paddr)
exinfo_t stub_vmxon(uint64_t paddr)
const char * vmx_insn_err_strerror(unsigned int err)
Error string for VMX Instruction Errors.