diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 00a6251981d20ec1aa57e203578e94176b1f1a81..9c86e10f11966c289d9d7fc8a64dc600eaae1769 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2117,7 +2117,8 @@ static int x86_pmu_event_init(struct perf_event *event) event->destroy(event); } - if (READ_ONCE(x86_pmu.attr_rdpmc)) + if (READ_ONCE(x86_pmu.attr_rdpmc) && + !(event->hw.flags & PERF_X86_EVENT_FREERUNNING)) event->hw.flags |= PERF_X86_EVENT_RDPMC_ALLOWED; return err;