Xen Test Framework
main.c
Go to the documentation of this file.
1 
16 #include <xtf.h>
17 
18 const char test_title[] = "XSA-203 PoC";
19 
20 bool test_needs_fep = true;
21 
22 void test_main(void)
23 {
24  asm volatile (_ASM_XEN_FEP
25  "1:"
26  ".byte 0x0f, 0x01, 0xd4;" /* VMFUNC */
27  "2:"
28  _ASM_EXTABLE(1b, 2b) /* Ignore #UD on older versions. */
29  :: "a" (0));
30 
31  /* If Xen is alive, it didn't fall over the NULL function pointer. */
32  xtf_success("Success: Not vulnerable to XSA-203\n");
33 }
34 
35 /*
36  * Local variables:
37  * mode: C
38  * c-file-style: "BSD"
39  * c-basic-offset: 4
40  * tab-width: 4
41  * indent-tabs-mode: nil
42  * End:
43  */
#define _ASM_XEN_FEP
Xen Forced Emulation Prefix.
Definition: xen.h:150
void xtf_success(const char *fmt,...)
Report test success.
Definition: report.c:38
void test_main(void)
To be implemented by each test, as its entry point.
Definition: main.c:137
bool test_needs_fep
Boolean indicating whether the test is entirely predicated on the available of the Force Emulation Pr...
Definition: main.c:34
const char test_title[]
The title of the test.
Definition: main.c:14
#define _ASM_EXTABLE(fault, fixup)
Create an exception table entry.
Definition: extable.h:50