33 asm volatile (
"1: vmclear %[ptr]; 2:" 47 asm volatile (
"1: vmptrld %[ptr]; 2:" 61 asm volatile (
"1: vmptrst %[ptr]; 2:" 63 :
"+D" (ex), [ptr]
"=m" (addr)
74 asm volatile (
"1: vmread %[field], %[value]; 2:" 76 :
"+D" (ex), [value]
"=rm" (tmp)
87 asm volatile (
"1: vmwrite %[value], %[field]; 2:" 90 : [field]
"r" (0l), [value]
"rm" (0l),
100 asm volatile (
"1: vmlaunch; 2:" 112 asm volatile (
"1: vmresume; 2:" 124 asm volatile (
"1: vmxoff; 2:" 137 asm volatile (
"1: vmxon %[ptr]; 2:" 149 struct {
uint64_t eptp, rsvd; } desc;
151 asm volatile (
"1: invept %[desc], %[type]; 2:" 154 : [type]
"r" (0l), [desc]
"m" (desc),
163 struct {
uint64_t vpid, linear; } desc;
165 asm volatile (
"1: invvpid %[desc], %[type]; 2:" 168 : [type]
"r" (0l), [desc]
"m" (desc),
174 static const struct test {
203 xtf_error(
"Error: CR4.VMXE found unexpectedly set\n");
218 xtf_failure(
"Fail: CR4.VMXE settable without feature\n");
220 xtf_success(
"Success: Probably not vulnerable to XSA-278\n");
unsigned int exinfo_t
Packed exception and error code information.
static exinfo_t stub_vmxon(void)
static exinfo_t stub_vmclear(void)
bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %edi.
static exinfo_t stub_invept(void)
static exinfo_t stub_vmptrld(void)
void xtf_success(const char *fmt,...)
Report test success.
static exinfo_t stub_vmread(void)
static exinfo_t stub_vmxoff(void)
void xtf_failure(const char *fmt,...)
Report a test failure.
void test_main(void)
To be implemented by each test, as its entry point.
static unsigned long read_cr4(void)
static exinfo_t stub_vmwrite(void)
const char test_title[]
The title of the test.
static void write_cr4(unsigned long cr4)
static bool write_cr4_safe(unsigned long cr4)
static exinfo_t stub_vmptrst(void)
#define _p(v)
Express an abitrary integer v as void *.
#define EXINFO_SYM(exc, ec)
void xtf_error(const char *fmt,...)
Report a test error.
static const struct test tests[]
static exinfo_t stub_vmresume(void)
unsigned long(* fn)(unsigned long)
static exinfo_t stub_vmlaunch(void)
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
static exinfo_t stub_invvpid(void)