Re: [PATCH v6 00/44] KVM: x86: Add support for mediated vPMUs

Manali Shukla
2025-12-18T09:19:50Z

On 12/8/2025 9:07 PM, Peter Zijlstra wrote:
> On Fri, Dec 05, 2025 at 04:16:36PM -0800, Sean Christopherson wrote:
>> My hope/plan is that the perf changes will go through the tip tree with a
>> stable tag/branch, and the KVM changes will go the kvm-x86 tree.
>
>> Kan Liang (7):
>> perf: Skip pmu_ctx based on event_type
>> perf: Add generic exclude_guest support
>> perf: Add APIs to create/release mediated guest vPMUs
>> perf: Clean up perf ctx time
>> perf: Add a EVENT_GUEST flag
>> perf: Add APIs to load/put guest mediated PMU context
>> perf/x86/intel: Support PERF_PMU_CAP_MEDIATED_VPMU
>>
>> Mingwei Zhang (3):
>> perf/x86/core: Plumb mediated PMU capability from x86_pmu to
>> x86_pmu_cap
>>
>> Sandipan Das (3):
>> perf/x86/core: Do not set bit width for unavailable counters
>> perf/x86/amd: Support PERF_PMU_CAP_MEDIATED_VPMU for AMD host
>>
>> Sean Christopherson (19):
>> perf: Move security_perf_event_free() call to __free_event()
>> perf/x86/core: Register a new vector for handling mediated guest PMIs
>> perf/x86/core: Add APIs to switch to/from mediated PMI vector (for
>> KVM)
>
> That all looks to be in decent shape; lets go get this merged. There is
> the nit on patch 4 and I think a number of the exports want to be
> EXPORT_SYMBOL_FOR_KVM() instead, but we can do that on top.
>
> I'll queue these patches after rc1.

I have tested this series on AMD EPYC 9745 (Turin, 128-Core Processor)
with 12 hours of perf_fuzzer runs across multiple configurations. No new
failures were observed.

Test Platform:
--------------
Hardware: AMD EPYC 9745 128-Core Processor (Turin)
Test Duration: 12 hours of perf_fuzzer per configuration

Configuration 1: enable_mediated_pmu=Y
---------------------------------------
SVM guests:
-cpu host
-cpu host,-perfmon-v2
-cpu host,-perfctr-core

SEV-ES guest:
-cpu host

SEV-SNP guest:
-cpu host

Configuration 2: enable_mediated_pmu=N
---------------------------------------
SVM guest:
-cpu EPYC-Genoa-v2,+pmu
-cpu EPYC-Genoa-v2,+pmu,-perfmon-v2
-cpu EPYC-Genoa-v2,+pmu,-perfctr-core

SEV-ES guest:
-cpu EPYC-Genoa-v2,+pmu

SEV-SNP guest:
-cpu EPYC-Genoa-v2,+pmu

KVM Unit Tests (KUT):
---------------------
Tested all combinations of:
- enable_mediated_pmu={0,1}
- force_emulation_prefix={0,1}

CPU configurations tested:
-cpu host
-cpu host,-perfmon-v2
-cpu host,-perfctr-core

All KUT tests passed as expected across all combinations.

Tested-by: Manali Shukla <manali.shukla@amd.com>

-Manali