47 unsigned long fault = 0;
59 unsigned long fault = 0;
71 unsigned long fault = 0;
73 asm (
"1: outb %b0, $0x80; 2:" 83 unsigned long fault = 0;
85 asm (
"1: outb %b0, $0x80; 2:" 95 unsigned long (*
fn)(void);
104 void (*set_iopl)(
unsigned int iopl);
105 bool (*should_fault)(
enum mode,
unsigned int iopl);
110 for (
unsigned int iopl = 0; iopl <= 3; ++iopl )
116 printk(
" vIOPL %u\n", iopl);
129 xtf_failure(
"Fail: kern %s, expected %pe, got %pe\n",
137 xtf_failure(
"Fail: user %s, expected %pe, got %pe\n",
169 panic(
"Bad vIOPL %u\n", iopl);
218 if ( !
strcmp(cmdline,
"hypercall") )
220 printk(
"Test: PHYSDEVOP_set_iopl\n");
223 else if ( !
strcmp(cmdline,
"vmassist") )
227 return xtf_skip(
"VMASST_TYPE_architectural_iopl not detected\n");
229 printk(
"Test: VMASST_TYPE_architectural_iopl\n");
233 return xtf_error(
"Unknown test to run\n");
unsigned long(* user_fn)(void)
unsigned int exinfo_t
Packed exception and error code information.
#define VMASST_CMD_enable
static const struct test vmassist
bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %eax.
static void run_test(const struct test *t)
static unsigned long stub_user_cli(void)
static unsigned long stub_user_outb(void)
static void vmassist_set_iopl(unsigned int iopl)
bool(* should_fault)(enum mode, unsigned int iopl)
void panic(const char *fmt,...)
void printk(const char *fmt,...)
#define PHYSDEVOP_set_iopl
static void hypercall_set_iopl(unsigned int iopl)
static long hypercall_physdev_op(unsigned int cmd, void *arg)
void xtf_success(const char *fmt,...)
Report test success.
unsigned long exec_user_efl_or_mask
static long hypercall_vm_assist(unsigned int cmd, unsigned int type)
static void exec_user_void(void(*fn)(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.
static const struct insn insns[]
void(* set_iopl)(unsigned int iopl)
static unsigned long stub_outb(void)
void xtf_skip(const char *fmt,...)
Report a test skip.
static const struct test hypercall
const char test_title[]
The title of the test.
static bool vmassist_should_fault(enum mode mode, unsigned int iopl)
static bool hypercall_should_fault(enum mode mode, unsigned int iopl)
#define VMASST_TYPE_architectural_iopl
static unsigned long exec_user(unsigned long(*fn)(void))
#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.
int8_t cmd_line[MAX_GUEST_CMDLINE]
xen_pv_start_info_t * pv_start_info
unsigned long(* fn)(void)
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
static unsigned long stub_cli(void)