23 uint32_t xen_first_leaf = ~0, xen_last_leaf = 0;
29 cpuid_fn(leaf, subleaf, &eax, &ebx, &ecx, &edx);
31 printk(
" %08x:%08x -> %08x:%08x:%08x:%08x\n",
32 leaf, subleaf, eax, ebx, ecx, edx);
42 if ( (eax & 0x1f) != 0 )
50 if ( subleaf <= max_l7_subleaf )
56 valid_xstate_leaves = ((
uint64_t)edx) << 32 | eax;
60 }
while ( (subleaf < 63) &&
61 !(valid_xstate_leaves & (1ULL << subleaf)) );
73 xen_first_leaf = leaf;
86 xen_first_leaf = leaf;
97 if ( leaf >= xen_first_leaf && leaf <= xen_last_leaf )
101 switch ( leaf - xen_first_leaf )
117 if ( (leaf > 0) && (leaf < 0x40000000U) && (leaf >
max_leaf) )
120 if ( (leaf > 0x40000000U) && (leaf < 0x40000100U) && (leaf > max_hv_leaf) )
123 if ( (leaf > 0x40000100U) && (leaf < 0x80000000U) && (leaf > max_hv2_leaf) )
130 if ( leaf == 4 || leaf == 7 || leaf == 0xd ||
131 ((leaf >= xen_first_leaf && leaf <= xen_last_leaf) &&
132 ((leaf - xen_first_leaf) == 3 || (leaf - xen_first_leaf) == 4)) )
139 printk(
"Native cpuid:\n");
144 printk(
"Emulated cpuid:\n");
void(* cpuid_count_fn_t)(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
unsigned int max_extd_leaf
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)
void printk(const char *fmt,...)
void test_main(void)
To be implemented by each test, as its entry point.
const char test_title[]
The title of the test.
static void dump_leaves(cpuid_count_fn_t cpuid_fn)
#define XEN_CPUID_SIGNATURE_ECX
#define XEN_CPUID_SIGNATURE_EBX
#define XEN_CPUID_SIGNATURE_EDX
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
void xtf_success(const char *fmt,...)
Report test success.