> > > > +static bool supports_event_mem_inst_retired(void) > > +{ > > + uint32_t eax, ebx, ecx, edx; > > + > > + cpuid(1, &eax, &ebx, &ecx, &edx); > > + assert(x86_family(eax) == 0x6); > > This seems aggressive. Even if Linux no longer runs on Pentium 4, what > about Xeon Phi? > I'll make it a branch. > > @@ -505,6 +826,13 @@ int main(int argc, char *argv[]) > > test_not_member_deny_list(vcpu); > > test_not_member_allow_list(vcpu); > > > > + if (use_intel_pmu() && supports_event_mem_inst_retired()) > > Do we need to verify that 3 or more general purpose counters are available? I'll add a check for that. > > > + vcpu2 = vm_vcpu_add(vm, 2, intel_masked_events_guest_code); > > + else if (use_amd_pmu()) > > Do we need to verify that the CPU is Zen[123]? use_amd_pmu() does that already.