50 asm volatile (
"1: cli; 2:" 57 asm volatile (
"1: outb %b0, $0x80; 2:" 98 xtf_failure(
"Fail (%s %s): Expected 1 exception, got %u\n",
107 xtf_failure(
"Fail (%s %s): Unable to retrieve exception log\n",
114 xtf_failure(
"Fail (%s %s): Expected #GP[0], got %2u[%04x]\n",
123 xtf_failure(
"Fail (%s %s): Expected no exceptions, got %u\n",
133 void (*set_iopl)(
unsigned int iopl);
134 bool (*should_fault)(
bool user,
unsigned int iopl);
140 unsigned int i, iopl;
144 for ( iopl = 0; iopl <= 3; ++iopl )
150 printk(
" vIOPL %u\n", iopl);
199 panic(
"Bad vIOPL %u\n", iopl);
253 printk(
"Test: PHYSDEVOP_set_iopl\n");
260 return xtf_skip(
"VMASST_TYPE_architectural_iopl not detected\n");
262 printk(
"Test: VMASST_TYPE_architectural_iopl\n");
266 return xtf_error(
"Unknown test to run\n");
#define VMASST_CMD_enable
exlog_entry_t * xtf_exlog_entry(unsigned int idx)
static void stub_cli(void)
Stub CLI instruction with #GP fixup.
static const struct insn insn_sequence[]
Sequence of instructions to run.
static const struct test vmassist
VMASSIT based IOPL interface.
void xtf_exlog_dump_log(void)
static void run_test(const struct test *t)
Test the instruction sequence using a specific iopl interface.
static bool vmassist_should_fault(bool user, unsigned int iopl)
static void vmassist_set_iopl(unsigned int iopl)
static struct expectation expectation
Details about the stub under test.
void panic(const char *fmt,...)
void printk(const char *fmt,...)
#define PHYSDEVOP_set_iopl
unsigned int xtf_exlog_entries(void)
static void check(void)
Check the exception long against the expected details.
static void hypercall_set_iopl(unsigned int iopl)
void xtf_exlog_reset(void)
static long hypercall_physdev_op(unsigned int cmd, void *arg)
void xtf_success(const char *fmt,...)
Report test success.
static bool hypercall_should_fault(bool user, unsigned int iopl)
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.
bool test_wants_user_mappings
Boolean indicating whether the test wants user mappings or not.
static void expect(const char *insn, bool user, bool fault)
Latch details of the stub under test.
void(* set_iopl)(unsigned int iopl)
void xtf_skip(const char *fmt,...)
Report a test skip.
static void stub_outb(void)
Stub OUTB instruction with #GP fixup.
static const struct test hypercall
Hypercall based IOPL interface.
static bool user
Whether to run the stub in user or supervisor mode.
const char test_title[]
The title of the test.
#define VMASST_TYPE_architectural_iopl
void xtf_exlog_stop(void)
void xtf_exlog_start(void)
bool(* should_fault)(bool user, unsigned int iopl)
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
#define _ASM_EXTABLE(fault, fixup)
Create an exception table entry.