[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6-w24T1iH2S_Fux@google.com>
Date: Fri, 14 Feb 2025 13:08:43 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Dapeng Mi <dapeng1.mi@...ux.intel.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Jim Mattson <jmattson@...gle.com>, Mingwei Zhang <mizhang@...gle.com>,
Xiong Zhang <xiong.y.zhang@...el.com>, Zhenyu Wang <zhenyuw@...ux.intel.com>,
Like Xu <like.xu.linux@...il.com>, Jinrong Liang <cloudliang@...cent.com>,
Yongwei Ma <yongwei.ma@...el.com>, Dapeng Mi <dapeng1.mi@...el.com>
Subject: Re: [kvm-unit-tests patch v6 13/18] x86: pmu: Improve instruction and
branches events verification
On Sat, Sep 14, 2024, Dapeng Mi wrote:
> If HW supports GLOBAL_CTRL MSR, enabling and disabling PMCs are moved in
> __precise_count_loop(). Thus, instructions and branches events can be
> verified against a precise count instead of a rough range.
>
> BTW, some intermittent failures on AMD processors using PerfMonV2 is
> seen due to variance in counts. This probably has to do with the way
> instructions leading to a VM-Entry or VM-Exit are accounted when
> counting retired instructions and branches.
AMD counts VMRUN as a branch in guest context.
> + * We see some intermittent failures on AMD processors using PerfMonV2
> + * due to variance in counts. This probably has to do with the way
> + * instructions leading to a VM-Entry or VM-Exit are accounted when
> + * counting retired instructions and branches. Thus only enable the
> + * precise validation for Intel processors.
> + */
> + if (pmu.is_intel && this_cpu_has_perf_global_ctrl()) {
> + /* instructions event */
These comments are useless.
> + gp_events[instruction_idx].min = LOOP_INSTRNS;
> + gp_events[instruction_idx].max = LOOP_INSTRNS;
> + /* branches event */
> + gp_events[branch_idx].min = LOOP_BRANCHES;
> + gp_events[branch_idx].max = LOOP_BRANCHES;
> + }
> +}
Powered by blists - more mailing lists