From: dongsheng As the VM-Exit/VM-Entry overcount issue on Intel Atom platforms, there is no way to validate the precise count for "instructions" and "branches" events on these overcounted Atom platforms. Thus relax the precise count validation on these overcounted platforms. Signed-off-by: dongsheng Signed-off-by: Dapeng Mi Tested-by: Yi Lai Signed-off-by: Sean Christopherson --- x86/pmu.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/x86/pmu.c b/x86/pmu.c index f932ccab..bd16211d 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -229,10 +229,15 @@ static void adjust_events_range(struct pmu_event *gp_events, * occur while running the measured code, e.g. if the host takes IRQs. */ if (pmu.is_intel && this_cpu_has_perf_global_ctrl()) { - gp_events[instruction_idx].min = LOOP_INSNS; - gp_events[instruction_idx].max = LOOP_INSNS; - gp_events[branch_idx].min = LOOP_BRANCHES; - gp_events[branch_idx].max = LOOP_BRANCHES; + if (!pmu.errata.instructions_retired_overcount) { + gp_events[instruction_idx].min = LOOP_INSNS; + gp_events[instruction_idx].max = LOOP_INSNS; + } + + if (!pmu.errata.branches_retired_overcount) { + gp_events[branch_idx].min = LOOP_BRANCHES; + gp_events[branch_idx].max = LOOP_BRANCHES; + } } /* -- 2.52.0.rc2.455.g230fcf2819-goog