51 const char test_title[] =
"Software interrupt emulation";
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);
162 for (
unsigned int i = 0; i <
ARRAY_SIZE(insn->
fn); ++i )
169 xtf_failure(
" Fail (Force%c, Addr%c): expected %pe %s, got %pe %s\n",
173 _p(got), got & EXINFO_TRAP ?
"trap" :
"fault");
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");
unsigned long stub_user_into_FA(void)
unsigned long(* user_fn)(void)
unsigned long stub_user_int3(void)
unsigned int exinfo_t
Packed exception and error code information.
unsigned long stub_user_icebp_FA(void)
void cpl3_tests(void)
Tests run in user mode.
const struct insn int_0x1
unsigned long fixup
Fixup address.
unsigned long stub_user_int_0x3_F(void)
const struct insn int_0x3
unsigned long stub_user_into_F(void)
unsigned long stub_into_FA(void)
static void set_idt_entries_dpl(unsigned int dpl)
Modify the descriptor privilege level on the IDT entries under test.
unsigned long stub_user_int3_F(void)
unsigned long stub_into(void)
unsigned long stub_int_0x1_A(void)
unsigned long stub_user_int3_FA(void)
unsigned long stub_user_int_0x3_FA(void)
unsigned long stub_into_F(void)
unsigned long stub_user_int3_A(void)
unsigned long stub_user_int_0x1_A(void)
unsigned long stub_user_icebp(void)
unsigned long stub_int_0x1_F(void)
void printk(const char *fmt,...)
bool xtf_has_fep
Boolean indicating whether generic Force Emulation Prefix support is available for the test to use...
unsigned long stub_user_int_0x3_A(void)
unsigned long stub_user_int_0x3(void)
Declarations of stubs and labels in generated in lowlevel.S.
unsigned long stub_int3_FA(void)
unsigned long stub_icebp(void)
unsigned long stub_int3_A(void)
void xtf_success(const char *fmt,...)
Report test success.
unsigned long stub_int_0x3(void)
unsigned long stub_user_int_0x1_F(void)
unsigned long stub_int3_F(void)
unsigned long stub_int_0x1(void)
void test_main(void)
To be implemented by each test, as its entry point.
void xtf_failure(const char *fmt,...)
Report a test failure.
unsigned long stub_user_into(void)
unsigned long stub_user_into_A(void)
bool ex_record_trap_eax(struct cpu_regs *regs, const struct extable_entry *ex)
void xtf_skip(const char *fmt,...)
Report a test skip.
unsigned long stub_int_0x3_FA(void)
unsigned long stub_int_0x1_FA(void)
unsigned long stub_int_0x3_A(void)
const char test_title[]
The title of the test.
void cpl0_tests(void)
Tests run in supervisor mode.
unsigned long stub_icebp_A(void)
unsigned long stub_user_int_0x1(void)
unsigned long stub_icebp_FA(void)
static unsigned long exec_user(unsigned long(*fn)(void))
static void set_idt_entries_present(bool present)
Modify the present flag on the IDT entries under test.
unsigned long stub_user_icebp_A(void)
unsigned long stub_int3(void)
#define _p(v)
Express an abitrary integer v as void *.
unsigned long stub_icebp_F(void)
unsigned long stub_int_0x3_F(void)
unsigned long stub_into_A(void)
void test_insn(enum mode user, const struct insn *insn, exinfo_t exp)
unsigned long(* fn)(void)
unsigned long stub_user_icebp_F(void)
unsigned long stub_user_int_0x1_FA(void)