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 bool check_nr_entries (unsigned int nr)
 
static bool check_exlog_entry (unsigned int entry, unsigned int cs, unsigned long ip, unsigned int ev, unsigned int ec)
 
static void test_exlog (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 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 152 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:

◆ check_nr_entries()

static bool check_nr_entries ( unsigned int  nr)
static

Definition at line 52 of file main.c.

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

◆ check_exlog_entry()

static bool check_exlog_entry ( unsigned int  entry,
unsigned int  cs,
unsigned long  ip,
unsigned int  ev,
unsigned int  ec 
)
static

Definition at line 66 of file main.c.

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

◆ test_exlog()

static void test_exlog ( void  )
static

Definition at line 92 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 158 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 163 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 187 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 206 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 221 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 230 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 238 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  )
+ Here is the caller graph for this function:

◆ asm()

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

◆ test_custom_idte()

static void test_custom_idte ( void  )
static

Definition at line 273 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 292 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 340 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 368 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 377 of file main.c.

+ Here is the call graph for this function:

◆ asm_checks()

static void asm_checks ( void  )
static

Definition at line 423 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_extable_handler_handler_run

bool test_extable_handler_handler_run
static

Definition at line 229 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 266 of file main.c.