64 if ( regs->entry_vector ==
X86_EXC_GP && regs->error_code == 0 )
66 extern char _fault[]
asm(
".Lstub_fault");
67 extern char _fixup[]
asm(
".Lstub_fixup");
68 const size_t delta = _fixup - _fault;
84 if ( CONFIG_PAGING_LEVELS > 0 )
125 panic(
"Failed to populate_physmap() at %#lx\n", extent);
134 extern char insn_buf_start[]
asm(
"insn_stub_start");
135 extern char insn_buf_end[]
asm(
"insn_stub_end");
136 memcpy(
stub, insn_buf_start, insn_buf_end - insn_buf_start);
172 asm volatile (
"call *%[ptr];"
181 xtf_failure(
"Fail: Instruction stub wasn't executed correctly\n");
191 GDTE_SYM(0, 0xfffff, COMMON, CODE, DPL0, R));
193 asm volatile (
"push $%c[cs16];"
201 "ljmpl $%c[cs], $.Ldone;"
208 [cs]
"i" (__KERN_CS),
213 xtf_failure(
"Fail: 16bit code wasn't executed correctly\n");
#define _ASM_XEN_FEP
Xen Forced Emulation Prefix.
static void write_ss(unsigned int ss)
static void invlpg(const void *va)
static void update_desc(user_desc *ptr, const user_desc new)
Helper to update a live LDT/GDT entry.
#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.
user_desc gdt[NR_GDT_ENTRIES]
int xtf_set_idte(unsigned int vector, const struct xtf_idte *idte)
Set up an IDT Entry, in a guest agnostic way.
static long hypercall_memory_op(unsigned int cmd, void *arg)
#define X86_VEC_AVAIL
Available for test use.
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler)
Create an exception table entry with custom handler.
void panic(const char *fmt,...)
#define STR(x)
Stringise an expression, expanding preprocessor tokens.
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
#define XENMEM_populate_physmap
#define _p(v)
Express an abitrary integer v as void *.
#define _u(v)
Express an arbitrary value v as unsigned long.
#define GB(num)
Express num in Gigabytes.
intpte_t pte_from_gfn(unsigned long gfn, uint64_t flags)
intpte_t pte_from_virt(const void *va, uint64_t flags)
void xtf_failure(const char *fmt,...)
Report a test failure.
void xtf_success(const char *fmt,...)
Report test success.
unsigned long * extent_start
A guest agnostic represention of IDT information.
#define GDTE_SYM(base, limit,...)
As INIT_GDTE_SYM(), but creates a user_desc object.
#define PF_SYM(...)
Create pagetable entry flags based on mnemonics.
bool test_needs_fep
Boolean indicating whether the test is entirely predicated on the available of the Force Emulation Pr...
static bool ex_fault(struct cpu_regs *regs, const struct extable_entry *ex)
static const struct xtf_idte idte
void test_int_handler(void)
static intpte_t nl2t[L2_PT_ENTRIES]
static intpte_t nl1t[L1_PT_ENTRIES]