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);
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");
bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %eax.
xen_pv_start_info_t * pv_start_info
unsigned long exec_user_efl_or_mask
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.
#define EXINFO_SYM(exc, ec)
unsigned int exinfo_t
Packed exception and error code information.
static long hypercall_physdev_op(unsigned int cmd, void *arg)
static long hypercall_vm_assist(unsigned int cmd, unsigned int type)
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
static unsigned long exec_user(unsigned long(*fn)(void))
static void exec_user_void(void(*fn)(void))
void panic(const char *fmt,...)
#define _p(v)
Express an abitrary integer v as void *.
#define PHYSDEVOP_set_iopl
static unsigned long stub_outb(void)
static bool hypercall_should_fault(enum mode mode, unsigned int iopl)
static unsigned long stub_user_outb(void)
static bool vmassist_should_fault(enum mode mode, unsigned int iopl)
static const struct insn insns[]
static const struct test vmassist
static const struct test hypercall
static void run_test(const struct test *t)
static unsigned long stub_cli(void)
static void hypercall_set_iopl(unsigned int iopl)
static void vmassist_set_iopl(unsigned int iopl)
static unsigned long stub_user_cli(void)
void xtf_failure(const char *fmt,...)
Report a test failure.
void xtf_error(const char *fmt,...)
Report a test error.
void xtf_skip(const char *fmt,...)
Report a test skip.
void xtf_success(const char *fmt,...)
Report test success.
unsigned long(* user_fn)(void)
unsigned long(* fn)(void)
bool(* should_fault)(enum mode, unsigned int iopl)
void(* set_iopl)(unsigned int iopl)
int8_t cmd_line[MAX_GUEST_CMDLINE]
#define VMASST_TYPE_architectural_iopl
#define VMASST_CMD_enable