On Fri, Jul 08, 2022, Yang Weijiang wrote: > Use new helper to check whether pmu is available and Perfmon/Debug > capbilities are supported before read MSR_IA32_PERF_CAPABILITIES to > avoid test failure. The issue can be captured when enable_pmu=0. > > Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx> > Signed-off-by: Yang Weijiang <weijiang.yang@xxxxxxxxx> > > --- > > v5: > Use new helpers to check pmu availability and get pmu version.[Sean] > > lib/x86/processor.h | 1 + > x86/pmu_lbr.c | 31 ++++++++++++------------------- What about x86/pmu.c? It has pretty much all the same issues. > @@ -74,19 +62,24 @@ int main(int ac, char **av) > return 0; > } > > - perf_cap = rdmsr(MSR_IA32_PERF_CAPABILITIES); > - eax.full = id.a; > - > - if (!eax.split.version_id) { > + if (!cpu_has_pmu()) { > printf("No pmu is detected!\n"); Please opportunistically switch these to report_skip() (and drop the \n), or fix them in patch 1 too. Either way is fine. And obviously use report_skip() for the new PDCM check.