49 unsigned int slot = 1;
71 return xtf_error(
"Error: Can't remap l1t1 as R/O\n");
74 return xtf_error(
"Error: Can't remap l1t2 as R/O\n");
77 return xtf_error(
"Error: Can't remap l2t1 as R/O\n");
80 return xtf_error(
"Error: Can't remap l2t2 as R/O\n");
95 return xtf_error(
"Error: Can't pin l2t*[]\n");
102 for (
int i = 0; i < 15; ++i )
122 return xtf_error(
"Error: Can't reset mapping state: %d\n", rc);
124 unsigned long addr = slot << L3_PT_SHIFT;
171 return xtf_error(
"Error: multicall failed: %d\n", rc);
178 return xtf_failure(
"Fail: Xen retained stale linear pt mapping\n");
181 xtf_success(
"Success: Probably not vulnerable to XSA-286\n");
xen_pv_start_info_t * pv_start_info
#define __page_aligned_bss
void test_main(void)
To be implemented by each test, as its entry point.
const char test_title[]
The title of the test.
static long hypercall_mmuext_op(const mmuext_op_t ops[], unsigned int count, unsigned int *done, unsigned int foreigndom)
static long hypercall_multicall(struct multicall_entry *list, unsigned int nr)
static long hypercall_mmu_update(const mmu_update_t reqs[], unsigned int count, unsigned int *done, unsigned int foreigndom)
static long hypercall_update_va_mapping(unsigned long linear, uint64_t npte, enum XEN_UVMF flags)
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
void * maddr_to_virt(uint64_t maddr)
unsigned long pfn_to_mfn(unsigned long pfn)
unsigned long virt_to_mfn(const void *va)
uint64_t virt_to_maddr(const void *va)
#define _p(v)
Express an abitrary integer v as void *.
#define _u(v)
Express an arbitrary value v as unsigned long.
intpte_t pte_from_gfn(unsigned long gfn, uint64_t flags)
intpte_t pte_from_virt(const void *va, uint64_t flags)
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 PF_SYM(...)
Create pagetable entry flags based on mnemonics.
#define __HYPERVISOR_update_va_mapping
#define MMUEXT_PIN_L2_TABLE
#define __HYPERVISOR_mmu_update
static multicall_entry_t multi[]
static intpte_t l2t1[L2_PT_ENTRIES]
static intpte_t l1t2[L1_PT_ENTRIES]
static intpte_t l1t1[L1_PT_ENTRIES]
static intpte_t l2t2[L2_PT_ENTRIES]