From: sashiko-bot@kernel.org
To: "Sandipan Das" <sandipan.das@amd.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/8] KVM: x86/pmu: Add PMU ops for vendor state sync
Date: Mon, 10 Aug 2026 10:29:05 +0000 [thread overview]
Message-ID: <20260810102906.4AF001F000E9@smtp.kernel.org> (raw)
In-Reply-To: <97458b49f1ba443345e13868db0115fd0249b5aa.1786345201.git.sandipan.das@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly introduced PMU ops (get_vendor_state, set_vendor_state) are never invoked by KVM nor implemented by any vendor PMU, rendering them dead code.
--
--- Patch [2]: [PATCH 2/8] KVM: x86/pmu: Add PMU ops for vendor state sync ---
commit 2b7ba0292c6d4a2eb66eaca07b256dee5f7af75a
Author: Sandipan Das <sandipan.das@amd.com>
KVM: x86/pmu: Add PMU ops for vendor state sync
This commit introduces new PMU operations get_vendor_state and set_vendor_state
to KVM's PMU architecture to allow synchronizing guest PMU state with a vendor
save area. It updates the capabilities initialization to nullify these operations
if the mediated PMU is not enabled.
> diff --git a/arch/x86/kvm/pmu.h b/arch/x86/kvm/pmu.h
> index f60856c48462b..2b1a8d6433734 100644
> --- a/arch/x86/kvm/pmu.h
> +++ b/arch/x86/kvm/pmu.h
> @@ -42,6 +42,8 @@ struct kvm_pmu_ops {
> void (*mediated_load)(struct kvm_vcpu *vcpu);
> void (*mediated_put)(struct kvm_vcpu *vcpu);
> void (*write_global_ctrl)(u64 global_ctrl);
> + int (*get_vendor_state)(struct kvm_vcpu *vcpu, u32 msr);
> + int (*set_vendor_state)(struct kvm_vcpu *vcpu, u32 msr);
[Severity: Low]
Are these new PMU operations actually invoked anywhere in KVM or implemented by
any vendor PMU in this patch? It appears they might be dead code, as there are
no callers or vendor implementations (e.g., for AMD or Intel) provided, despite
the commit message mentioning opportunistically synchronizing the state.
>
> const u64 EVENTSEL_EVENT;
> const int MAX_NR_GP_COUNTERS;
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1786345201.git.sandipan.das@amd.com?part=2
next prev parent reply other threads:[~2026-08-10 10:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 10:14 [PATCH 0/8] KVM: Add support for hardware-switched mediated PMU Sandipan Das
2026-08-10 10:14 ` [PATCH 1/8] KVM: x86/pmu: Add mediated PMU capability flags Sandipan Das
2026-08-10 10:29 ` sashiko-bot
2026-08-10 10:14 ` [PATCH 2/8] KVM: x86/pmu: Add PMU ops for vendor state sync Sandipan Das
2026-08-10 10:29 ` sashiko-bot [this message]
2026-08-10 10:14 ` [PATCH 3/8] KVM: x86/pmu: Add support for hardware-switched PMU Sandipan Das
2026-08-10 10:36 ` sashiko-bot
2026-08-10 10:14 ` [PATCH 4/8] x86/cpufeatures: Add PerfCtrVirt feature bit Sandipan Das
2026-08-10 10:24 ` sashiko-bot
2026-08-10 10:14 ` [PATCH 5/8] KVM: SVM: Add VMCB fields for PMC virtualization Sandipan Das
2026-08-10 10:14 ` [PATCH 6/8] KVM: SVM: Add support for hardware-switched PMU Sandipan Das
2026-08-10 10:57 ` sashiko-bot
2026-08-10 10:14 ` [PATCH 7/8] KVM: nSVM: " Sandipan Das
2026-08-10 10:54 ` sashiko-bot
2026-08-10 10:14 ` [PATCH 8/8] KVM: SEV: Disallow the use of " Sandipan Das
2026-08-10 10:40 ` sashiko-bot
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=20260810102906.4AF001F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=sandipan.das@amd.com \
--cc=sashiko-reviews@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).