Re: [kvm-unit-tests patch v6 17/18] x86: pmu: Adjust lower boundary of branch-misses event
From: Sean Christopherson
Date: Fri Feb 14 2025 - 16:10:03 EST
On Sat, Sep 14, 2024, Dapeng Mi wrote:
> @@ -205,6 +208,17 @@ static void adjust_events_range(struct pmu_event *gp_events,
> gp_events[branch_idx].min = LOOP_BRANCHES;
> gp_events[branch_idx].max = LOOP_BRANCHES;
> }
> +
> + /*
> + * For CPUs without IBPB support, no way to force to trigger a
> + * branch miss and the measured branch misses is possible to be
> + * 0. Thus overwrite the lower boundary of branch misses event
> + * to 0 to avoid false positive.
> + */
> + if (!has_ibpb()) {
> + /* branch misses event */
This comment is worse than useless, because it necessitates curly braces.
> + gp_events[branch_miss_idx].min = 0;
> + }
> }