linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] perf/core: Assert PERF_EVENT_FLAG_ARCH is followed
@ 2022-08-29  6:55 Anshuman Khandual
  2022-08-29  6:55 ` [PATCH 1/3] perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags Anshuman Khandual
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anshuman Khandual @ 2022-08-29  6:55 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, peterz; +Cc: Anshuman Khandual

This series ensures that PERF_EVENT_FLAG_ARCH mask is followed correctly,
while defining all the platform specific hardware event flags. But after
adding these checks, there are couple of build failures on x86 platform
like the following.

BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & PERF_X86_EVENT_AMD_BRS)
BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & PERF_X86_EVENT_PEBS_LAT_HYBRID)

This happens because both these flags PERF_X86_EVENT_AMD_BRS (0x10000) and
PERF_X86_EVENT_PEBS_LAT_HYBRID (0x20000) falls outside PERF_EVENT_FLAG_ARCH
(0x0000ffff). Given that x86 platform is already using up all available bit
positions, should this platform flags mask be extended to (0x000fffff) ?

This seires applies on v6.0-rc3.

Anshuman Khandual (3):
  perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags
  arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH
  x86/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH

 arch/arm64/kernel/perf_event.c  |  1 +
 arch/x86/events/amd/core.c      |  2 ++
 arch/x86/events/core.c          | 16 ++++++++++++++++
 drivers/perf/apple_m1_cpu_pmu.c |  1 +
 drivers/perf/arm_spe_pmu.c      |  1 +
 kernel/events/core.c            |  1 +
 6 files changed, 22 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-05  4:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29  6:55 [PATCH 0/3] perf/core: Assert PERF_EVENT_FLAG_ARCH is followed Anshuman Khandual
2022-08-29  6:55 ` [PATCH 1/3] perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags Anshuman Khandual
2022-08-29  6:55 ` [PATCH 2/3] arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH Anshuman Khandual
2022-08-29  6:55 ` [PATCH 3/3] x86/perf: " Anshuman Khandual
2022-08-30 10:00   ` James Clark
2022-09-05  4:05     ` Anshuman Khandual

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).