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

XSA-304 More...

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

Go to the source code of this file.

Typedefs

typedef void() stub_t(intpte_t *l2t, const bool *cond)
 

Functions

 asm (".align 4096;" ".skip 4096 - (stub_page_boundary - stub_fn);" "stub_fn:" " movq $" STR((16<< 20)|PF_SYM(PSE, AD, RW, P)) ", 8*8(%rdi);" " invlpg stub_page_boundary + (16 << 20);" " cmpb $0, (%rsi);" " .byte 0x74, 1f - (. + 1);" " movb $0, -1;" "stub_page_boundary:" "1: ret;")
 
void test_main (void)
 To be implemented by each test, as its entry point. More...
 

Variables

const char test_title [] = "XSA-304 PoC"
 The title of the test. More...
 
stub_t stub_fn
 
static intpte_t nl3t [512]
 
static intpte_t nl2t [512]
 
static intpte_t nl1t [512]
 

Detailed Description

XSA-304

Definition in file main.c.

Typedef Documentation

◆ stub_t

typedef void() stub_t(intpte_t *l2t, const bool *cond)

Definition at line 25 of file main.c.

Function Documentation

◆ asm()

asm ( ".align 4096;" ".skip 4096 - (stub_page_boundary - stub_fn);" "stub_fn:" " movq $" STR((16<< 20)|PF_SYM(PSE, AD, RW, P)) "  ,
8 *8(%rdi);" " invlpg stub_page_boundary+(16<< 20);" " cmpb  $0,
(%rsi);" " .byte  0x74,
1f -(.+1);" " movb  $0,
-1;" "stub_page_boundary:" "1:ret;"   
)

◆ 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 85 of file main.c.

+ Here is the call graph for this function:

Variable Documentation

◆ test_title

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

The title of the test.

Definition at line 23 of file main.c.

◆ stub_fn

stub_t stub_fn
extern

◆ nl3t

intpte_t nl3t[512]
static

Definition at line 81 of file main.c.

◆ nl2t

intpte_t nl2t[512]
static

Definition at line 82 of file main.c.

◆ nl1t

intpte_t nl1t[512]
static

Definition at line 83 of file main.c.