arch/x86/events/amd/core.c | 2 ++ 1 file changed, 2 insertions(+)
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
Gitweb: https://git.kernel.org/tip/65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
Author: Sandipan Das <sandipan.das@amd.com>
AuthorDate: Fri, 05 Dec 2025 16:16:49 -08:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
perf/x86/amd: Support PERF_PMU_CAP_MEDIATED_VPMU for AMD host
Apply the PERF_PMU_CAP_MEDIATED_VPMU flag for version 2 and later
implementations of the core PMU. Aside from having Global Control and
Status registers, virtualizing the PMU using the mediated model requires
an interface to set or clear the overflow bits in the Global Status MSRs
while restoring or saving the PMU context of a vCPU.
PerfMonV2-capable hardware has additional MSRs for this purpose, namely
PerfCntrGlobalStatusSet and PerfCntrGlobalStatusClr, thereby making it
suitable for use with mediated vPMU.
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
Signed-off-by: Mingwei Zhang <mizhang@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Xudong Hao <xudong.hao@intel.com>
Link: https://patch.msgid.link/20251206001720.468579-14-seanjc@google.com
---
arch/x86/events/amd/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
index 44656d2..0c92ed5 100644
--- a/arch/x86/events/amd/core.c
+++ b/arch/x86/events/amd/core.c
@@ -1439,6 +1439,8 @@ static int __init amd_core_pmu_init(void)
amd_pmu_global_cntr_mask = x86_pmu.cntr_mask64;
+ x86_get_pmu(smp_processor_id())->capabilities |= PERF_PMU_CAP_MEDIATED_VPMU;
+
/* Update PMC handling functions */
x86_pmu.enable_all = amd_pmu_v2_enable_all;
x86_pmu.disable_all = amd_pmu_v2_disable_all;
On Wed, Dec 17, 2025, tip-bot2 for Sandipan Das wrote:
> The following commit has been merged into the perf/core branch of tip:
>
> Commit-ID: 65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> Gitweb: https://git.kernel.org/tip/65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> Author: Sandipan Das <sandipan.das@amd.com>
> AuthorDate: Fri, 05 Dec 2025 16:16:49 -08:00
> Committer: Peter Zijlstra <peterz@infradead.org>
> CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
Can you provide a stable tag/branch for perf/core as of commit:
01122b89361e ("perf: Use EXPORT_SYMBOL_FOR_KVM() for the mediated APIs")
I'm finally getting around to applying stuff for 6.20.
Thanks!
On Thu, Jan 08, 2026 at 11:55:41AM -0800, Sean Christopherson wrote:
> On Wed, Dec 17, 2025, tip-bot2 for Sandipan Das wrote:
> > The following commit has been merged into the perf/core branch of tip:
> >
> > Commit-ID: 65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > Gitweb: https://git.kernel.org/tip/65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > Author: Sandipan Das <sandipan.das@amd.com>
> > AuthorDate: Fri, 05 Dec 2025 16:16:49 -08:00
> > Committer: Peter Zijlstra <peterz@infradead.org>
> > CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
>
> Can you provide a stable tag/branch for perf/core as of commit:
>
> 01122b89361e ("perf: Use EXPORT_SYMBOL_FOR_KVM() for the mediated APIs")
>
> I'm finally getting around to applying stuff for 6.20.
Oh, sorry, I missed this. Let me try and remember how to do tags.
On Fri, Jan 16, 2026 at 09:44:35AM +0100, Peter Zijlstra wrote:
> On Thu, Jan 08, 2026 at 11:55:41AM -0800, Sean Christopherson wrote:
> > On Wed, Dec 17, 2025, tip-bot2 for Sandipan Das wrote:
> > > The following commit has been merged into the perf/core branch of tip:
> > >
> > > Commit-ID: 65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > > Gitweb: https://git.kernel.org/tip/65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > > Author: Sandipan Das <sandipan.das@amd.com>
> > > AuthorDate: Fri, 05 Dec 2025 16:16:49 -08:00
> > > Committer: Peter Zijlstra <peterz@infradead.org>
> > > CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
> >
> > Can you provide a stable tag/branch for perf/core as of commit:
> >
> > 01122b89361e ("perf: Use EXPORT_SYMBOL_FOR_KVM() for the mediated APIs")
> >
> > I'm finally getting around to applying stuff for 6.20.
>
> Oh, sorry, I missed this. Let me try and remember how to do tags.
I *think* I managed to push a tag: perf-core-kvm-mediated-pmu
to tip. It is however now signed, because for some reason I cannot get
gpg-agent forwarding working today :-(
I hate computers.
On Fri, Jan 16, 2026 at 10:36:18AM +0100, Peter Zijlstra wrote:
> On Fri, Jan 16, 2026 at 09:44:35AM +0100, Peter Zijlstra wrote:
> > On Thu, Jan 08, 2026 at 11:55:41AM -0800, Sean Christopherson wrote:
> > > On Wed, Dec 17, 2025, tip-bot2 for Sandipan Das wrote:
> > > > The following commit has been merged into the perf/core branch of tip:
> > > >
> > > > Commit-ID: 65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > > > Gitweb: https://git.kernel.org/tip/65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > > > Author: Sandipan Das <sandipan.das@amd.com>
> > > > AuthorDate: Fri, 05 Dec 2025 16:16:49 -08:00
> > > > Committer: Peter Zijlstra <peterz@infradead.org>
> > > > CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
> > >
> > > Can you provide a stable tag/branch for perf/core as of commit:
> > >
> > > 01122b89361e ("perf: Use EXPORT_SYMBOL_FOR_KVM() for the mediated APIs")
> > >
> > > I'm finally getting around to applying stuff for 6.20.
> >
> > Oh, sorry, I missed this. Let me try and remember how to do tags.
>
> I *think* I managed to push a tag: perf-core-kvm-mediated-pmu
> to tip. It is however now signed, because for some reason I cannot get
NOT signed, can't type neither apparently..
> gpg-agent forwarding working today :-(
>
> I hate computers.
On Fri, Jan 16, 2026, Peter Zijlstra wrote:
> On Fri, Jan 16, 2026 at 10:36:18AM +0100, Peter Zijlstra wrote:
> > On Fri, Jan 16, 2026 at 09:44:35AM +0100, Peter Zijlstra wrote:
> > > On Thu, Jan 08, 2026 at 11:55:41AM -0800, Sean Christopherson wrote:
> > > > On Wed, Dec 17, 2025, tip-bot2 for Sandipan Das wrote:
> > > > > The following commit has been merged into the perf/core branch of tip:
> > > > >
> > > > > Commit-ID: 65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > > > > Gitweb: https://git.kernel.org/tip/65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > > > > Author: Sandipan Das <sandipan.das@amd.com>
> > > > > AuthorDate: Fri, 05 Dec 2025 16:16:49 -08:00
> > > > > Committer: Peter Zijlstra <peterz@infradead.org>
> > > > > CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
> > > >
> > > > Can you provide a stable tag/branch for perf/core as of commit:
> > > >
> > > > 01122b89361e ("perf: Use EXPORT_SYMBOL_FOR_KVM() for the mediated APIs")
> > > >
> > > > I'm finally getting around to applying stuff for 6.20.
> > >
> > > Oh, sorry, I missed this. Let me try and remember how to do tags.
> >
> > I *think* I managed to push a tag: perf-core-kvm-mediated-pmu
> > to tip. It is however now signed, because for some reason I cannot get
>
> NOT signed, can't type neither apparently..
Unsigned is totally fine, I just wanted to make sure I didn't send a pull request
with stale commits. Thanks much!
> > gpg-agent forwarding working today :-(
LOL, sounds like me trying to do encrypted email.
> > I hate computers.
On Thu, Jan 08, 2026, Sean Christopherson wrote:
> On Wed, Dec 17, 2025, tip-bot2 for Sandipan Das wrote:
> > The following commit has been merged into the perf/core branch of tip:
> >
> > Commit-ID: 65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > Gitweb: https://git.kernel.org/tip/65eb3a9a8a34fa9188e0ab5e657d84ce4fa242a7
> > Author: Sandipan Das <sandipan.das@amd.com>
> > AuthorDate: Fri, 05 Dec 2025 16:16:49 -08:00
> > Committer: Peter Zijlstra <peterz@infradead.org>
> > CommitterDate: Wed, 17 Dec 2025 13:31:07 +01:00
>
> Can you provide a stable tag/branch for perf/core as of commit:
>
> 01122b89361e ("perf: Use EXPORT_SYMBOL_FOR_KVM() for the mediated APIs")
> I'm finally getting around to applying stuff for 6.20.
Ping. Or just pinky-swear that you won't change the hashes. :-)
Note, in case it matters for whatever reason, I've had the KVM side of things in
linux-next since last week, based on the above commit.
© 2016 - 2026 Red Hat, Inc.