Xen Test Framework
Macros | Functions | Variables
main.c File Reference

XSA-213 More...

#include <xtf.h>
+ Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define IRET_IDENTIFIER   0xdead
 

Functions

void recover_from_iret (void)
 
 asm (".align 16;" "recover_from_iret:" "mov %dr0, %" _ASM_SP ";" "jmp multicall_return;")
 
void iret_entry (void)
 
 asm (".pushsection .text.user;" ".global iret_entry;" "iret_entry:" "int $" STR(X86_VEC_AVAIL) ";" ".popsection;")
 
static long multi_iret_call (multicall_entry_t *multi, size_t nr)
 
void test_main (void)
 To be implemented by each test, as its entry point. More...
 

Variables

const char test_title [] = "XSA-213 PoC"
 The title of the test. More...
 
static const struct xtf_idte idte
 
static multicall_entry_t multi []
 

Detailed Description

XSA-213

Definition in file main.c.

Macro Definition Documentation

◆ IRET_IDENTIFIER

#define IRET_IDENTIFIER   0xdead

Definition at line 27 of file main.c.

Function Documentation

◆ recover_from_iret()

void recover_from_iret ( void  )

◆ asm() [1/2]

asm ( ".align 16;" "recover_from_iret:" "mov %  dr0,
%" _ASM_SP ";" "jmp multicall_return;"   
)

◆ iret_entry()

void iret_entry ( void  )

◆ asm() [2/2]

asm ( ".pushsection .text.user;" ".global iret_entry;" "iret_entry:" "int $" STR(X86_VEC_AVAIL) ";" ".popsection;"  )

◆ multi_iret_call()

static long multi_iret_call ( multicall_entry_t multi,
size_t  nr 
)
static

Definition at line 52 of file main.c.

+ Here is the caller graph for this function:

◆ test_main()

void test_main ( void  )

To be implemented by each test, as its entry point.

Todo:
Implement better command line infrastructure, but this will do for now.

At the time of writing, Xen doesn't correctly handle invlpg while running in shadow mode on AMD Gen1 hardware lacking decode assistance. For this test, we simply care that Xen doesn't crash.

Definition at line 120 of file main.c.

+ Here is the call graph for this function:

Variable Documentation

◆ test_title

const char test_title[] = "XSA-213 PoC"

The title of the test.

Definition at line 25 of file main.c.

◆ idte

const struct xtf_idte idte
static
Initial value:
= {
.cs = __KERN_CS,
.dpl = 3,
}
#define _u(v)
Express an arbitrary value v as unsigned long.
Definition: numbers.h:53
void recover_from_iret(void)

Definition at line 37 of file main.c.

◆ multi

multicall_entry_t multi[]
static
Initial value:
= {
{
},
{
.args = {
(unsigned long)XENVER_version,
(unsigned long)NULL,
},
},
}
#define __HYPERVISOR_xen_version
Definition: xen.h:30
#define __HYPERVISOR_iret
Definition: xen.h:36
#define NULL
Definition: stddef.h:12
#define XENVER_version
Definition: version.h:8

Definition at line 107 of file main.c.