40 unsigned long in_extents[] = {
pfn_to_mfn(0) };
41 unsigned long pxt =
_u(in_extents);
42 unsigned long exchanged_so_far = idtr.base / 8;
48 .nr_extents = exchanged_so_far + 1,
55 .nr_extents = exchanged_so_far + 1,
60 .nr_exchanged = exchanged_so_far,
68 for ( i = 0; i < 3; ++i )
73 xtf_failure(
"Fail: XENMEM_exchange returned success\n");
75 printk(
"XENMEM_exchange returned %d\n", rc);
77 printk(
"Probably %svulnerable to XSA-212\n", rc == 0 ?
"" :
"not ");
79 unsigned int hi = 0, low = 1;
82 printk(
"Attempting to confirm...\n");
84 asm volatile (
"1: div %%ecx; 2:"
86 :
"+&a" (low),
"+&d" (hi),
"+D" (fault)
93 printk(
"Apparent clobber, but got #DE. Retrying...\n");
99 xtf_error(
" Error: Unexpected fault %#x, %pe\n", fault,
_p(fault));
bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %edi.
static void sidt(desc_ptr *idtr)
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_memory_op(unsigned int cmd, void *arg)
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
unsigned long pfn_to_mfn(unsigned long pfn)
#define _p(v)
Express an abitrary integer v as void *.
#define _u(v)
Express an arbitrary value v as unsigned long.
void xtf_failure(const char *fmt,...)
Report a test failure.
void xtf_error(const char *fmt,...)
Report a test error.
void xtf_success(const char *fmt,...)
Report test success.
struct xen_memory_reservation in
unsigned long * extent_start