36 unsigned int tmp, eax, ebx, ecx, edx, addr = 0;
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,
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);
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");
#define _ASM_XEN_FEP
Xen Forced Emulation Prefix.
void(* cpuid_count_fn_t)(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
static void cpuid_count(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
static void pv_cpuid_count(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
static void cpuid(uint32_t leaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
xen_pv_start_info_t * pv_start_info
static void map_shared_info(void)
static void qemu_console_write(const char *buf, size_t len)
static void xen_console_write(const char *buf, size_t len)
static void collect_cpuid(cpuid_count_fn_t cpuid_fn)
uint32_t x86_features[FSCAPINTS]
bool xtf_has_fep
Boolean indicating whether generic Force Emulation Prefix support is available for the test to use.
static void setup_pv_console(void)
uint8_t user_stack[PAGE_SIZE]
unsigned int x86_stepping
const char environment_description[]
static bool is_initdomain(void)
static void setup_xenbus(void)
enum x86_vendor x86_vendor
uint8_t boot_stack[3 *PAGE_SIZE]
static void init_hypercalls(void)
unsigned int max_extd_leaf
bool test_needs_fep
Boolean indicating whether the test is entirely predicated on the available of the Force Emulation Pr...
void sort_extable(void)
Sort the exception table.
#define __page_aligned_bss
#define __user_page_aligned_bss
void printk(const char *fmt,...)
void register_console_callback(cons_output_cb fn)
void init_pv_console(xencons_interface_t *ring, evtchn_port_t port)
x86 segment descriptor infrastructure.
void arch_init_traps(void)
xen_pvh_start_info_t * pvh_start_info
static int hvm_get_param(unsigned int idx, uint64_t *value)
static long hypercall_update_va_mapping(unsigned long linear, uint64_t npte, enum XEN_UVMF flags)
static void hypercall_console_write(const char *buf, unsigned long count)
static long hypercall_memory_op(unsigned int cmd, void *arg)
uint8_t hypercall_page[PAGE_SIZE]
#define XEN_CPUID_SIGNATURE_ECX
#define XEN_CPUID_SIGNATURE_EBX
#define XEN_CPUID_SIGNATURE_EDX
#define XEN_CPUID_FIRST_LEAF
#define _ASM_EXTABLE(fault, fixup)
Create an exception table entry.
void panic(const char *fmt,...)
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
#define XENMEM_add_to_physmap
#define XENMAPSPACE_shared_info
void * mfn_to_virt(unsigned long mfn)
static void * pfn_to_virt(unsigned long pfn)
static unsigned long virt_to_gfn(const void *va)
static void wrmsr(uint32_t idx, uint64_t val)
Thin wrapper around an wrmsr instruction.
#define _u(v)
Express an arbitrary value v as unsigned long.
#define HVM_PARAM_CONSOLE_EVTCHN
#define HVM_PARAM_STORE_EVTCHN
#define HVM_PARAM_CONSOLE_PFN
#define HVM_PARAM_STORE_PFN
void xtf_skip(const char *fmt,...)
Report a test skip.
API for reporting test status.
struct xen_pv_start_info::@48::@49 domU
unsigned long shared_info
union xen_pv_start_info::@48 console
Macros for creating constants using mnemonics.
#define PF_SYM(...)
Create pagetable entry flags based on mnemonics.
void init_xenbus(xenbus_interface_t *ring, evtchn_port_t port)
static xenbus_interface_t * xb_ring
static evtchn_port_t xb_port