From: sashiko-bot@kernel.org
To: Yuhang.chen <yhchen312@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2 2/2] RISC-V: KVM: selftests: Add PMU event filter test
Date: Fri, 07 Aug 2026 05:40:11 +0000 [thread overview]
Message-ID: <20260807054012.7EB641F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260807053227.341700-3-yhchen312@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message falsely claims that the guest programs the 'instructions' SBI PMU event, but the implementation only ever programs the 'cycles' event.
--
--- Patch [2]: [PATCH v2 2/2] RISC-V: KVM: selftests: Add PMU event filter test ---
commit 828aa8f61ee14a213c9f6491df6c9b1b9ddbd337
Author: Yuhang.chen <yhchen312@gmail.com>
RISC-V: KVM: selftests: Add PMU event filter test
This patch adds a selftest to verify KVM_SET_PMU_EVENT_FILTER on RISC-V.
The host applies ALLOW and DENY filters, and asserts that the guest receives
the expected success or failure when configuring PMU counters.
> Add a selftest that exercises KVM_SET_PMU_EVENT_FILTER on RISC-V. The
> guest programs the CPU cycles and instructions SBI PMU events through
> SBI_EXT_PMU_COUNTER_CFG_MATCH while the host installs filters with the
> ALLOW and DENY actions, asserting that disallowed events return
> SBI_ERR_NOT_SUPPORTED and allowed events succeed.
[Severity: Medium]
Is this description accurate?
The commit message states that the guest programs both the CPU cycles and
instructions SBI PMU events.
However, looking at guest_code(), it appears to only ever program EV_CYCLES
via the SBI_EXT_PMU_COUNTER_CFG_MATCH call:
guest_code() {
...
ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_CFG_MATCH,
0, 1, 0, EV_CYCLES, 0, 0);
...
}
An inline comment in the test code also explicitly notes that the
instructions event is never programmed by the guest: "Instructions itself is
never programmed, so host support for it is irrelevant."
Could the commit message be updated to reflect that only the CPU cycles
event is actually programmed by the guest code?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260807053227.341700-1-yhchen312@gmail.com?part=2
prev parent reply other threads:[~2026-08-07 5:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 5:32 [PATCH v2 0/2] RISC-V: KVM: Add PMU event filter support Yuhang.chen
2026-08-07 5:32 ` [PATCH v2 1/2] " Yuhang.chen
2026-08-07 5:55 ` sashiko-bot
2026-08-07 5:32 ` [PATCH v2 2/2] RISC-V: KVM: selftests: Add PMU event filter test Yuhang.chen
2026-08-07 5:40 ` sashiko-bot [this message]
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=20260807054012.7EB641F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yhchen312@gmail.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