30 "mov $" STR(__USER_DS)
", %edx;" 36 "jmp .Ltss_ret_point;" 66 #define LDT_SEL ((LDTE << 3) | X86_SEL_LDT | 3) 69 ldt[
LDTE] =
gdt[__USER_DS >> 3];
73 asm volatile (
"1: mov %[sel], %%fs; 2:" 101 lldt(GDTE_AVAIL1 << 3);
109 asm volatile (
"mov %%esp, %%dr0;" 110 "jmp $%c[vm86_tss_sel], $0;" 112 :: [vm86_tss_sel]
"i" (GDTE_AVAIL0 << 3));
128 xtf_error(
"Error: Unexpected fault %08x\n", fault);
unsigned int exinfo_t
Packed exception and error code information.
static const struct xtf_idte idte
bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %eax.
unsigned long user_ldt_use(void)
static void pack_ldt_desc(user_desc *d, const user_desc *ldt, unsigned int limit)
int xtf_set_idte(unsigned int vector, const struct xtf_idte *idte)
Set up an IDT Entry, in a guest agnostic way.
static void lldt(unsigned int sel)
char zeroptr[]
An array which the linker resolves to 0.
#define _u(v)
Express an arbitrary value v as unsigned long.
#define STR(x)
Stringise an expression, expanding preprocessor tokens.
void xtf_success(const char *fmt,...)
Report test success.
#define X86_TSS_INVALID_IO_BITMAP
user_desc gdt[NR_GDT_ENTRIES]
void xtf_failure(const char *fmt,...)
Report a test failure.
void test_main(void)
To be implemented by each test, as its entry point.
const char test_title[]
The title of the test.
static unsigned long exec_user(unsigned long(*fn)(void))
#define X86_VEC_AVAIL
Available for test use.
uint8_t boot_stack[3 *PAGE_SIZE]
#define _p(v)
Express an abitrary integer v as void *.
#define EXINFO_SYM(exc, ec)
void xtf_error(const char *fmt,...)
Report a test error.
A guest agnostic represention of IDT information.
static void pack_tss_desc(user_desc *d, const env_tss *t)
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.