Set the PERF_PMU_CAP_VIRTUALIZED_VPMU flag for processors that support X86_FEATURE_PERFCTR_VIRT. Signed-off-by: Sandipan Das --- arch/x86/events/amd/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index 8179fb5f1ee3..0cd2f54778c0 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c @@ -1443,6 +1443,9 @@ static int __init amd_core_pmu_init(void) static_call_update(amd_pmu_test_overflow, amd_pmu_test_overflow_status); } + if (cpu_feature_enabled(X86_FEATURE_PERFCTR_VIRT)) + x86_get_pmu(smp_processor_id())->capabilities |= PERF_PMU_CAP_VIRTUALIZED_VPMU; + /* * AMD Core perfctr has separate MSRs for the NB events, see * the amd/uncore.c driver. -- 2.43.0