subleaf
static inline void __cpuid_read(u32 leaf, u32 subleaf, u32 *regs)
regs[CPUID_ECX] = subleaf;
#define cpuid_subleaf(leaf, subleaf, regs) { \
__cpuid_read(leaf, subleaf, (u32 *)(regs)); \
static inline void __cpuid_read_reg(u32 leaf, u32 subleaf,
__cpuid_read(leaf, subleaf, regs);
#define cpuid_subleaf_reg(leaf, subleaf, regidx, reg) { \
__cpuid_read_reg(leaf, subleaf, regidx, (u32 *)(reg)); \
u32 eax, ebx, ecx, edx, subleaf;
subleaf = (r->rid == RDT_RESOURCE_SMBA) ? 2 : 1;
cpuid_count(0x80000020, subleaf, &eax, &ebx, &ecx, &edx);
u32 subleaf;
for (subleaf = 0, last_dom = 0; topo_subleaf(tscan, leaf, subleaf, &last_dom); subleaf++);
if (!subleaf)
static inline bool topo_subleaf(struct topo_scan *tscan, u32 leaf, u32 subleaf,
cpuid_subleaf(leaf, subleaf, &sl);
leaf, subleaf, sl.type);
leaf, subleaf, tscan->c->topo.initial_apicid, sl.x2apic_id);
#define cpuid_count(leaf, subleaf, a, b, c, d) \
__cpuid_count(leaf, subleaf, a, b, c, d)
static void leaf_print_raw(struct subleaf *leaf)
static bool cpuid_store(struct cpuid_range *range, u32 f, int subleaf,
struct subleaf *leaf;
func->leafs = malloc(sizeof(struct subleaf));
leaf->sub = subleaf;
for (u32 subleaf = 1; subleaf < max_subleaf; subleaf++) {
cpuid_count(f, subleaf, eax, ebx, ecx, edx);
allzero = cpuid_store(range, f, subleaf, eax, ebx, ecx, edx);
struct subleaf *leaf;
static void show_reg_header(bool has_entries, u32 leaf, u32 subleaf, const char *reg_name)
printf("CPUID_0x%x_%s[0x%x]:\n", leaf, reg_name, subleaf);
static void show_leaf(struct subleaf *leaf)
struct subleaf *leafs;
struct cpuid_result subleaf[INTEL_PT_SUBLEAF_CNT];
caps->subleaf[i] = r;
.subleaf = {
m = mask.subleaf[i].reg[j];
reg = m & caps->subleaf[i].reg[j];
reg0 = m & caps0->subleaf[i].reg[j];
reg = m & caps->subleaf[1].eax;
reg0 = m & caps0->subleaf[1].eax;