38    printk(
"Testing read through NULL segment:\n");
 
   41                  "1: mov %%fs:0, %[dst]; 2:" 
   51        xtf_failure(
"  Fail: Access via NULL segment didn't fault\n");
 
   55        printk(
"  Success: Got #GP fault\n");
 
   59        xtf_error(
"  Error: Unexpected fault %#x, %pe\n", fault, 
_p(fault));
 
   63    printk(
"Testing stale LDT:\n");
 
   65    user_desc ldt[1] = { 
gdt[__KERN_DS >> 3] };
 
   73                  "1: mov %[sel], %%fs; 2:" 
   83        xtf_failure(
"  Fail: Loaded selector from stale LDT\n");
 
   87        printk(
"  Success: Got #GP fault\n");
 
   91        xtf_error(
"  Error: Unexpected fault %#x, %pe\n", fault, 
_p(fault));
 
#define _ASM_XEN_FEP
Xen Forced Emulation Prefix.
bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %edi.
bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %eax.
static void write_fs(unsigned int fs)
static void lldt(unsigned int sel)
void test_main(void)
To be implemented by each test, as its entry point.
const char test_title[]
The title of the test.
void printk(const char *fmt,...)
user_desc gdt[NR_GDT_ENTRIES]
static void pack_ldt_desc(user_desc *d, const user_desc *ldt, unsigned int limit)
#define EXINFO_SYM(exc, ec)
unsigned int exinfo_t
Packed exception and error code information.
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
#define _p(v)
Express an abitrary integer v as void *.
void xtf_failure(const char *fmt,...)
Report a test failure.
void xtf_error(const char *fmt,...)
Report a test error.
void xtf_success(const char *fmt,...)
Report test success.
#define SEL_EC_SYM(sel,...)
Create a selector based error code using X86_EC_ mnemonics.
bool test_needs_fep
Boolean indicating whether the test is entirely predicated on the available of the Force Emulation Pr...