33 return xtf_error(
"Error initialising grant table: %d\n", rc);
38 return xtf_error(
"Error getting domid\n");
59 return xtf_error(
"Failed to unmap KB(8)\n");
78 printk(
"Probably not vulnerable to XSA-227\n");
80 printk(
"Attempting to confirm...\n");
88 asm volatile (
"1: mov %[ptr], %[res]; 2:"
92 : [ptr]
"m" (*(
char *)
KB(4)),
99 xtf_success(
"Success: Not vulnerable to XSA-227\n");
108 xtf_error(
"Unexpected fault %#x, %pe\n", fault,
_p(fault));
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
grant_entry_v1_t gnttab_v1[]
int xtf_init_grant_table(unsigned int version)
Initialise XTF's grant infrastructure.
#define __page_aligned_bss
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_update_va_mapping(unsigned long linear, uint64_t npte, enum XEN_UVMF flags)
static long hypercall_grant_table_op(unsigned int cmd, void *args, unsigned int count)
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
int xtf_get_domid(void)
Obtain the current domid.
void * maddr_to_virt(uint64_t maddr)
uint64_t virt_to_maddr(const void *va)
static unsigned long virt_to_gfn(const void *va)
#define _p(v)
Express an abitrary integer v as void *.
#define KB(num)
Express num in Kilobytes.
paddr_t pte_to_paddr(intpte_t pte)
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.
#define PFEC_SYM(...)
Create pagetable error code based on mnemonics.
#define GNTTABOP_map_grant_ref
#define GNTMAP_contains_pte
#define GTF_permit_access
static uint8_t frame[PAGE_SIZE]