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

Selftest - Sanity tests for the XTF environment. More...

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

Go to the source code of this file.

Enumerations

enum  { USER_not_seen , USER_seen , USER_bad_cs }
 

Functions

static void test_xenstore (void)
 
static void test_extable (void)
 
static unsigned long test_exec_user_cpl3 (void)
 
static void test_exec_user (void)
 
static void test_NULL_unmapped (void)
 
bool do_unhandled_exception (struct cpu_regs *regs)
 May be implemented by a guest to provide custom exception handling. More...
 
static void test_unhandled_exception_hook (void)
 
static bool test_extable_handler_handler (struct cpu_regs *regs, const struct extable_entry *ex)
 
static void test_extable_handler (void)
 
void test_idte_handler (void)
 
 asm ("test_idte_handler:;" "mov $0x1e51c0de, %eax;" "jmp HYPERCALL_iret;")
 
static void test_custom_idte (void)
 
static void test_driver_init (void)
 
static void test_vsnprintf_crlf_one (const char *fmt,...)
 
static void test_vsnprintf_crlf (void)
 
void test_main (void)
 To be implemented by each test, as its entry point. More...
 
static void asm_checks (void)
 

Variables

const char test_title [] = "XTF Selftests"
 The title of the test. More...
 
bool has_xenstore = true
 
static volatile bool test_hook_active
 
static bool test_extable_handler_handler_run
 
static const struct xtf_idte idte
 

Detailed Description

Selftest - Sanity tests for the XTF environment.

Definition in file main.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
USER_not_seen 
USER_seen 
USER_bad_cs 

Definition at line 52 of file main.c.

Function Documentation

◆ test_xenstore()

static void test_xenstore ( void  )
static

Definition at line 17 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_extable()

static void test_extable ( void  )
static

Definition at line 40 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_exec_user_cpl3()

static unsigned long test_exec_user_cpl3 ( void  )
static

Definition at line 58 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_exec_user()

static void test_exec_user ( void  )
static

Definition at line 63 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_NULL_unmapped()

static void test_NULL_unmapped ( void  )
static

Definition at line 87 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_unhandled_exception()

bool do_unhandled_exception ( struct cpu_regs *  regs)

May be implemented by a guest to provide custom exception handling.

Definition at line 105 of file main.c.

+ Here is the call graph for this function:

◆ test_unhandled_exception_hook()

static void test_unhandled_exception_hook ( void  )
static

Definition at line 123 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_extable_handler_handler()

static bool test_extable_handler_handler ( struct cpu_regs *  regs,
const struct extable_entry ex 
)
static

Definition at line 134 of file main.c.

+ Here is the caller graph for this function:

◆ test_extable_handler()

static void test_extable_handler ( void  )
static

Definition at line 142 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_idte_handler()

void test_idte_handler ( void  )

◆ asm()

asm ( "test_idte_handler:;" "mov  $0x1e51c0de,
%eax;" "jmp HYPERCALL_iret;"   
)

◆ test_custom_idte()

static void test_custom_idte ( void  )
static

Definition at line 177 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_driver_init()

static void test_driver_init ( void  )
static

Definition at line 196 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_vsnprintf_crlf_one()

static void test_vsnprintf_crlf_one ( const char *  fmt,
  ... 
)
static

Definition at line 244 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_vsnprintf_crlf()

static void test_vsnprintf_crlf ( void  )
static

Definition at line 272 of file main.c.

+ Here is the call graph for this function:
+ 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.

Definition at line 281 of file main.c.

+ Here is the call graph for this function:

◆ asm_checks()

static void asm_checks ( void  )
static

Definition at line 326 of file main.c.

+ Here is the call graph for this function:

Variable Documentation

◆ test_title

const char test_title[] = "XTF Selftests"

The title of the test.

Definition at line 14 of file main.c.

◆ has_xenstore

bool has_xenstore = true

Definition at line 15 of file main.c.

◆ test_hook_active

volatile bool test_hook_active
static

Definition at line 104 of file main.c.

◆ test_extable_handler_handler_run

bool test_extable_handler_handler_run
static

Definition at line 133 of file main.c.

◆ idte

const struct xtf_idte idte
static
Initial value:
= {
.dpl = IS_DEFINED(CONFIG_PV) ? 1 : 0,
.cs = __KERN_CS,
}
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
Definition: macro_magic.h:67
#define _u(v)
Express an arbitrary value v as unsigned long.
Definition: numbers.h:53
void test_idte_handler(void)

Definition at line 170 of file main.c.