From: sashiko-bot@kernel.org
To: "Sean Christopherson" <seanjc@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 1/9] perf/x86/intel: Ensure guest PEBS path doesn't set unwanted PERF_GLOBAL_CTRL bits
Date: Fri, 08 May 2026 23:40:18 +0000 [thread overview]
Message-ID: <20260508234018.F06AEC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260508231353.406465-2-seanjc@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The host PEBS collision check fails to mask non-counter bits, incorrectly disabling guest PEBS for events like Store Latency.
--
Note: The format of this report has been altered due to recitation
restrictions. The original patch code is not quoted directly, and findings are
provided as a free-form summary.
commit 39adc53b360e88595a3be6fc59b18b048d9e9921
Author: Sean Christopherson <seanjc@google.com>
perf/x86/intel: Ensure guest PEBS path doesn't set unwanted PERF_GLOBAL_CTRL bits
This commit masks the pebs counter values being reinstated into the global
control msr for a guest with perf's desired value. This is done to ensure the
hypervisor doesn't unintentionally enable counters.
In intel_guest_get_msrs(), the host pebs collision check evaluates the host
field of the pebs_enable array entry to determine if the host is actively
using pebs. If it is, guest pebs is disabled.
Is it possible for this check to falsely detect a host collision due to
non-counter bits being set?
When a guest configures a store latency pebs event, a backing perf event is
created. In intel_pmu_pebs_enable(), this sets both the counter index bit
and bit 63 in cpuc->pebs_enabled.
Because the host field is calculated as cpuc->pebs_enabled masked against
the inverse of cpuc->intel_ctrl_guest_mask, and the guest mask exclusively
tracks valid counter indices (never including bit 63), bit 63 remains set in
the host field.
Consequently, the check for whether the host is actively using pebs will
evaluate to true even when only the guest is using pebs. This introduces a
regression where guest pebs is completely disabled, silently breaking guest
store latency events.
Should the host pebs usage evaluation also be masked by intel_ctrl to prevent
non-counter bits from triggering a false collision?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260508231353.406465-1-seanjc@google.com?part=1
next prev parent reply other threads:[~2026-05-08 23:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 23:13 [PATCH v3 0/9] perf/x86: Don't write PEBS_ENABLED on KVM transitions Sean Christopherson
2026-05-08 23:13 ` [PATCH v3 1/9] perf/x86/intel: Ensure guest PEBS path doesn't set unwanted PERF_GLOBAL_CTRL bits Sean Christopherson
2026-05-08 23:40 ` sashiko-bot [this message]
2026-05-12 11:30 ` Mi, Dapeng
2026-05-12 4:53 ` Mi, Dapeng
2026-05-08 23:13 ` [PATCH v3 2/9] perf/x86/intel: Don't write PEBS_ENABLED on host<=>guest xfers if CPU has isolation Sean Christopherson
2026-05-12 4:53 ` Mi, Dapeng
2026-05-08 23:13 ` [PATCH v3 3/9] perf/x86/intel: Don't context switch DS_AREA (and PEBS config) if PEBS is unused Sean Christopherson
2026-05-08 23:13 ` [PATCH v3 4/9] perf/x86/intel: Make @data a mandatory param for intel_guest_get_msrs() Sean Christopherson
2026-05-12 12:39 ` Jim Mattson
2026-05-08 23:13 ` [PATCH v3 5/9] perf/x86/intel: Invert names of intel_ctrl_{guest,host}_mask Sean Christopherson
2026-05-12 4:58 ` Mi, Dapeng
2026-05-08 23:13 ` [PATCH v3 6/9] perf/x86: KVM: Have perf define a dedicated struct for getting guest PEBS data Sean Christopherson
2026-05-08 23:13 ` [PATCH v3 7/9] perf/x86/intel: KVM: Handle cross-mapped PEBS PMCs entirely within KVM Sean Christopherson
2026-05-12 4:59 ` Mi, Dapeng
2026-05-08 23:13 ` [PATCH v3 8/9] KVM: VMX: Drop a redundant pmu->global_ctrl check when processing pebs_enable Sean Christopherson
2026-05-12 5:00 ` Mi, Dapeng
2026-05-08 23:13 ` [PATCH v3 9/9] KVM: VMX: Only tell perf to enable PEBS counters for fully enabled PMCs Sean Christopherson
2026-05-12 5:01 ` Mi, Dapeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508234018.F06AEC2BCB0@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko@lists.linux.dev \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox