92 while ( !ret && start < end )
107 panic(
"Failed to set trap table: %d\n", rc);
133 for (
unsigned int i = 0; i <
ARRAY_SIZE(cb); ++i )
137 panic(
"Failed to register callback[%u]: %d\n", i, rc);
149 panic(
"Unable to remap gdt[] as read-only\n");
151 unsigned long gdt_frames[] = {
158 panic(
"Failed to set gdt: %d\n", rc);
163 panic(
"Failed to set kernel stack: %d\n", rc);
185 panic(
"Failed to set user %%cr3: %d\n", rc);
187#elif defined(__i386__)
189 extern const char __start_user_text[], __end_user_text[];
190 extern const char __start_user_data[], __end_user_data[];
191 extern const char __start_user_bss[], __end_user_bss[];
206 panic(
"Failed to unmap page at NULL: %d\n", rc);
223 "i" (0x800000000badc0deUL)
230 asm volatile(
"1: hlt;"
static void write_ds(unsigned int ds)
static unsigned long read_cr3(void)
static void write_fs(unsigned int fs)
static void write_es(unsigned int es)
static void write_gs(unsigned int gs)
uint8_t boot_stack[3 *PAGE_SIZE]
#define CALLBACKTYPE_syscall32
#define CALLBACKF_mask_events
#define CALLBACKTYPE_sysenter
#define CALLBACKTYPE_event
#define CALLBACKTYPE_syscall
user_desc gdt[NR_GDT_ENTRIES]
void entry_ret_to_kernel(void)
void arch_init_traps(void)
void arch_crash_hard(void)
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_mmuext_op(const mmuext_op_t ops[], unsigned int count, unsigned int *done, unsigned int foreigndom)
static long hypercall_stack_switch(const unsigned int ss, const void *sp)
static long hypercall_set_gdt(const unsigned long *mfns, unsigned int entries)
static int hypercall_register_callback(const xen_callback_register_t *arg)
static long hypercall_update_va_mapping(unsigned long linear, uint64_t npte, enum XEN_UVMF flags)
static long hypercall_set_trap_table(const struct xen_trap_info *ti)
x86 IDT vector infrastructure.
#define X86_VEC_RET2KERN
Return to kernel mode.
#define BUILD_BUG_ON(cond)
void panic(const char *fmt,...)
unsigned long virt_to_mfn(const void *va)
#define _u(v)
Express an arbitrary value v as unsigned long.
intpte_t pte_from_virt(const void *va, uint64_t flags)
struct xen_trap_info pv_default_trap_info[]
static int remap_linear_range(const void *start, const void *end, uint64_t flags)
static int remap_linear(const void *linear, uint64_t flags)
void entry_SYSENTER(void)
static void init_callbacks(void)
xen_pv_start_info_t * pv_start_info
static const struct xtf_idte idte
A guest agnostic represention of IDT information.
Macros for creating constants using mnemonics.
#define PF_SYM(...)
Create pagetable entry flags based on mnemonics.
#define INIT_XEN_CALLBACK(_cs, _ip)
#define MMUEXT_NEW_USER_BASEPTR