38 cpuid_fn(0, 0, &
max_leaf, &ebx, &ecx, &edx);
40 if ( ebx == 0x756e6547u &&
45 else if ( ebx == 0x68747541u &&
55 cpuid_fn(1, 0, &eax, &tmp,
67 if ( x86_family == 0xf )
68 x86_family += (eax >> 20) & 0xff;
85 cpuid_fn(0x80000001, 0, &tmp, &tmp,
89 cpuid_fn(0x80000007, 0, &tmp, &tmp, &tmp,
92 cpuid_fn(0x80000008, 0, &addr,
117 cpuid(base, &eax, &ebx, &ecx, &edx);
122 ((eax - base) >= 2) )
130 panic(
"Unable to locate Xen CPUID leaves\n");
132 cpuid(base + 2, &eax, &ebx, &ecx, &edx);
143 panic(
"Hypercall page not initialised correctly\n");
173 cons_evtchn = raw_evtchn;
196 panic(
"Failed to get XenStore PFN: %d\n", rc);
200 panic(
"Failed to get XenStore evtchn: %d\n", rc);
203 xb_port = raw_evtchn;
231 panic(
"Failed to map shared_info: %d\n", rc);
236 asm volatile(
"rep; outsb" 237 :
"+S" (buf),
"+c" (len)
304 printk(
"FEP unavailable, but needed by test. (Is Xen support\n");
305 return xtf_skip(
"compiled in, and booted with 'hvm_fep'?)\n");
uint8_t boot_stack[3 *PAGE_SIZE]
xen_pvh_start_info_t * pvh_start_info
void init_pv_console(xencons_interface_t *ring, evtchn_port_t port)
static void wrmsr(uint32_t idx, uint64_t val)
Thin wrapper around an wrmsr instruction.
static void setup_pv_console(void)
#define _ASM_XEN_FEP
Xen Forced Emulation Prefix.
void * mfn_to_virt(unsigned long mfn)
static void init_hypercalls(void)
static evtchn_port_t xb_port
#define XEN_CPUID_SIGNATURE_EBX
void sort_extable(void)
Sort the exception table.
uint32_t x86_features[FSCAPINTS]
static void collect_cpuid(cpuid_count_fn_t cpuid_fn)
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
Macros for creating constants using mnemonics.
static long hypercall_update_va_mapping(unsigned long linear, uint64_t npte, enum XEN_UVMF flags)
static void setup_xenbus(void)
x86 segment descriptor infrastructure.
#define __page_aligned_bss
#define HVM_PARAM_CONSOLE_PFN
static xenbus_interface_t * xb_ring
#define XEN_CPUID_FIRST_LEAF
static void cpuid_count(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
void panic(const char *fmt,...)
enum x86_vendor x86_vendor
uint8_t user_stack[PAGE_SIZE]
#define _u(v)
Express an arbitrary value v as unsigned long.
static void pv_cpuid_count(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
unsigned long shared_info
void printk(const char *fmt,...)
bool test_needs_fep
Boolean indicating whether the test is entirely predicated on the available of the Force Emulation Pr...
bool xtf_has_fep
Boolean indicating whether generic Force Emulation Prefix support is available for the test to use...
void register_console_callback(cons_output_cb fn)
static void * pfn_to_virt(unsigned long pfn)
#define PF_SYM(...)
Create pagetable entry flags based on mnemonics.
static void cpuid(uint32_t leaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
void init_xenbus(xenbus_interface_t *ring, evtchn_port_t port)
#define XENMEM_add_to_physmap
uint8_t hypercall_page[PAGE_SIZE]
void arch_init_traps(void)
unsigned int x86_stepping
static int hvm_get_param(unsigned int idx, uint64_t *value)
static unsigned long virt_to_gfn(const void *va)
#define XEN_CPUID_SIGNATURE_ECX
#define HVM_PARAM_STORE_EVTCHN
void xtf_skip(const char *fmt,...)
Report a test skip.
const char environment_description[]
#define XEN_CPUID_SIGNATURE_EDX
static void xen_console_write(const char *buf, size_t len)
#define XENMAPSPACE_shared_info
static bool is_initdomain(void)
static void hypercall_console_write(const char *buf, unsigned long count)
union xen_pv_start_info::@48 console
unsigned int max_extd_leaf
struct xen_pv_start_info::@48::@49 domU
#define HVM_PARAM_STORE_PFN
static void map_shared_info(void)
void(* cpuid_count_fn_t)(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
xen_pv_start_info_t * pv_start_info
#define _ASM_EXTABLE(fault, fixup)
Create an exception table entry.
#define __user_page_aligned_bss
static void qemu_console_write(const char *buf, size_t len)
static long hypercall_memory_op(unsigned int cmd, void *arg)
#define HVM_PARAM_CONSOLE_EVTCHN
API for reporting test status.