linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/10] perf/amd/ibs: Fix sample period computations
@ 2024-12-10  9:34 Ravi Bangoria
  2024-12-10  9:34 ` [PATCH v3 01/10] perf/amd/ibs: Remove IBS_{FETCH|OP}_CONFIG_MASK macros Ravi Bangoria
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: Ravi Bangoria @ 2024-12-10  9:34 UTC (permalink / raw)
  To: peterz, mingo, namhyung
  Cc: ravi.bangoria, acme, eranian, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang, tglx, bp, dave.hansen,
	x86, hpa, linux-perf-users, linux-kernel, santosh.shukla,
	ananth.narayan, sandipan.das

IBS Fetch and IBS Op PMUs have constraints on supported sample period
values. The IBS hw behavior could be undefined if they are not followed.
Currently, IBS driver does not honor them correctly and thus a malicious
event could cause issues to the system. Fortunately, the IBS hw is very
resilient so far and IBS PMUs are restricted to root only, so the attack
vector is minimal. In any case, these are genuine bugs and must be fixed.

There were some conflicts with Namhyung's IBS patches[1] which are now
in the tip tree, so rebased the series on tip/perf/core (02c56362a7d3).

v2: https://lore.kernel.org/r/20241206051713.991-1-ravi.bangoria@amd.com
v2->v3:
 - No code changes
 - s/pmu/PMU/g
 - Include unit test example in the commit description

[1]: https://lore.kernel.org/r/20241203180441.1634709-1-namhyung@kernel.org

Ravi Bangoria (10):
  perf/amd/ibs: Remove IBS_{FETCH|OP}_CONFIG_MASK macros
  perf/amd/ibs: Remove pointless sample period check
  perf/amd/ibs: Fix ->config to sample period calculation for OP PMU
  perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt
  perf/amd/ibs: Don't allow freq mode event creation through ->config
    interface
  perf/amd/ibs: Add PMU specific minimum period
  perf/amd/ibs: Add ->check_period() callback
  perf/core: Introduce pmu->adjust_period() callback
  perf test: Introduce DEFINE_SUITE_EXCLUSIVE()
  perf test amd ibs: Add sample period unit test

 arch/x86/events/amd/ibs.c                  |  96 ++-
 arch/x86/include/asm/perf_event.h          |   1 +
 include/linux/perf_event.h                 |   5 +
 kernel/events/core.c                       |  12 +-
 tools/perf/arch/x86/include/arch-tests.h   |   1 +
 tools/perf/arch/x86/tests/Build            |   1 +
 tools/perf/arch/x86/tests/amd-ibs-period.c | 953 +++++++++++++++++++++
 tools/perf/arch/x86/tests/arch-tests.c     |   2 +
 tools/perf/tests/tests.h                   |  10 +
 9 files changed, 1055 insertions(+), 26 deletions(-)
 create mode 100644 tools/perf/arch/x86/tests/amd-ibs-period.c

-- 
2.43.0


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

end of thread, other threads:[~2025-01-08 11:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-10  9:34 [PATCH v3 00/10] perf/amd/ibs: Fix sample period computations Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 01/10] perf/amd/ibs: Remove IBS_{FETCH|OP}_CONFIG_MASK macros Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 02/10] perf/amd/ibs: Remove pointless sample period check Ravi Bangoria
2024-12-18 13:35   ` Peter Zijlstra
2024-12-10  9:34 ` [PATCH v3 03/10] perf/amd/ibs: Fix ->config to sample period calculation for OP PMU Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 04/10] perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 05/10] perf/amd/ibs: Don't allow freq mode event creation through ->config interface Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 06/10] perf/amd/ibs: Add PMU specific minimum period Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 07/10] perf/amd/ibs: Add ->check_period() callback Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 08/10] perf/core: Introduce pmu->adjust_period() callback Ravi Bangoria
2024-12-18 13:52   ` Peter Zijlstra
2025-01-08 11:16     ` Ravi Bangoria
2024-12-10  9:34 ` [PATCH v3 09/10] perf test: Introduce DEFINE_SUITE_EXCLUSIVE() Ravi Bangoria
2024-12-13 19:55   ` Arnaldo Carvalho de Melo
2024-12-10  9:34 ` [PATCH v3 10/10] perf test amd ibs: Add sample period unit test Ravi Bangoria
2024-12-16  6:42 ` [PATCH v3 00/10] perf/amd/ibs: Fix sample period computations Ravi Bangoria

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