54# define COND(_32, _64) _32
56# define COND(_32, _64) _64
59#define EXINFO_TRAP EXINFO_AVAIL0
74 unsigned long (*
fn[4])(void);
75 unsigned long (*
user_fn[4])(void);
169 xtf_failure(
" Fail (Force%c, Addr%c): expected %pe %s, got %pe %s\n",
197#define TRAP(V) EXINFO_SYM(V, 0) | EXINFO_TRAP
198#define FAULT(V) EXINFO_SYM(V, 0)
199#define FAULT_EC(V, ...) EXINFO_SYM(V, EXC_EC_SYM(__VA_ARGS__))
204 printk(
"Test cpl3: all perms ok\n");
213 printk(
"Test cpl3: p=0\n");
226 printk(
"Test cpl3: dpl=0\n");
243 printk(
"Test cpl0: all perms ok\n");
252 printk(
"Test cpl0: p=0\n");
273 xtf_skip(
"FEP support not detected - some tests will be skipped\n");
bool xtf_has_fep
Boolean indicating whether generic Force Emulation Prefix support is available for the test to use.
void printk(const char *fmt,...)
void test_main(void)
To be implemented by each test, as its entry point.
const char test_title[]
The title of the test.
unsigned int exinfo_t
Packed exception and error code information.
static unsigned long exec_user(unsigned long(*fn)(void))
Declarations of stubs and labels in generated in lowlevel.S.
unsigned long stub_user_into_FA(void)
unsigned long stub_into_F(void)
unsigned long stub_int_0x3_A(void)
unsigned long stub_into_A(void)
unsigned long stub_user_icebp(void)
unsigned long stub_int_0x1(void)
unsigned long stub_user_int_0x3_F(void)
unsigned long stub_user_int_0x1_F(void)
unsigned long stub_int3(void)
unsigned long stub_int_0x1_F(void)
unsigned long stub_user_int3_A(void)
unsigned long stub_int_0x3_FA(void)
unsigned long stub_user_int_0x3_A(void)
unsigned long stub_int_0x1_A(void)
unsigned long stub_icebp_A(void)
unsigned long stub_into(void)
unsigned long stub_user_int_0x1_A(void)
unsigned long stub_user_icebp_A(void)
unsigned long stub_user_int3_FA(void)
unsigned long stub_user_int_0x1_FA(void)
unsigned long stub_icebp(void)
unsigned long stub_int3_FA(void)
unsigned long stub_into_FA(void)
unsigned long stub_user_int3(void)
unsigned long stub_user_icebp_FA(void)
unsigned long stub_int_0x1_FA(void)
unsigned long stub_user_into_F(void)
unsigned long stub_icebp_F(void)
unsigned long stub_user_into(void)
unsigned long stub_int3_A(void)
unsigned long stub_user_int_0x3_FA(void)
unsigned long stub_int_0x3(void)
unsigned long stub_user_icebp_F(void)
unsigned long stub_icebp_FA(void)
unsigned long stub_int3_F(void)
unsigned long stub_user_int_0x1(void)
unsigned long stub_user_into_A(void)
unsigned long stub_int_0x3_F(void)
unsigned long stub_user_int_0x3(void)
unsigned long stub_user_int3_F(void)
#define _p(v)
Express an abitrary integer v as void *.
void xtf_failure(const char *fmt,...)
Report a test failure.
void xtf_skip(const char *fmt,...)
Report a test skip.
void xtf_success(const char *fmt,...)
Report test success.
unsigned long fixup
Fixup address.
unsigned long(* user_fn)(void)
unsigned long(* fn)(void)
const struct insn int_0x3
static void set_idt_entries_dpl(unsigned int dpl)
Modify the descriptor privilege level on the IDT entries under test.
bool ex_record_trap_eax(struct cpu_regs *regs, const struct extable_entry *ex)
void cpl0_tests(void)
Tests run in supervisor mode.
static void set_idt_entries_present(bool present)
Modify the present flag on the IDT entries under test.
const struct insn int_0x1
void cpl3_tests(void)
Tests run in user mode.
void test_insn(enum mode user, const struct insn *insn, exinfo_t exp)