linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	peterz@infradead.org
Cc: Anshuman Khandual <anshuman.khandual@arm.com>,
	Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH
Date: Mon, 29 Aug 2022 12:25:06 +0530	[thread overview]
Message-ID: <20220829065507.177781-3-anshuman.khandual@arm.com> (raw)
In-Reply-To: <20220829065507.177781-1-anshuman.khandual@arm.com>

Ensure all platform specific event flags are within PERF_EVENT_FLAG_ARCH.

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-perf-users@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/arm64/kernel/perf_event.c  | 1 +
 drivers/perf/apple_m1_cpu_pmu.c | 1 +
 drivers/perf/arm_spe_pmu.c      | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index cb69ff1e6138..cf9cedb07f92 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1390,6 +1390,7 @@ static struct platform_driver armv8_pmu_driver = {
 
 static int __init armv8_pmu_driver_init(void)
 {
+	BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & ARMPMU_EVT_64BIT);
 	if (acpi_disabled)
 		return platform_driver_register(&armv8_pmu_driver);
 	else
diff --git a/drivers/perf/apple_m1_cpu_pmu.c b/drivers/perf/apple_m1_cpu_pmu.c
index 979a7c2b4f56..9ec8c694d0f2 100644
--- a/drivers/perf/apple_m1_cpu_pmu.c
+++ b/drivers/perf/apple_m1_cpu_pmu.c
@@ -568,6 +568,7 @@ MODULE_DEVICE_TABLE(of, m1_pmu_of_device_ids);
 
 static int m1_pmu_device_probe(struct platform_device *pdev)
 {
+	BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & ARMPMU_EVT_47BIT);
 	return arm_pmu_device_probe(pdev, m1_pmu_of_device_ids, NULL);
 }
 
diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index b65a7d9640e1..74344abf4b11 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -1276,6 +1276,7 @@ static int __init arm_spe_pmu_init(void)
 	if (ret)
 		cpuhp_remove_multi_state(arm_spe_pmu_online);
 
+	BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & SPE_PMU_HW_FLAGS_CX);
 	return ret;
 }
 
-- 
2.25.1


  parent reply	other threads:[~2022-08-29  6:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Anshuman Khandual [this message]
2022-08-29  6:55 ` [PATCH 3/3] x86/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH Anshuman Khandual
2022-08-30 10:00   ` James Clark
2022-09-05  4:05     ` Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220829065507.177781-3-anshuman.khandual@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=catalin.marinas@arm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).