Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame^] | 1 | From c3b11ad7a7e3e154a17f36c6768deab9227e28de Mon Sep 17 00:00:00 2001 |
| 2 | From: Robin Murphy <robin.murphy@arm.com> |
| 3 | Date: Fri, 3 Dec 2021 11:44:52 +0000 |
| 4 | Subject: [PATCH 04/14] perf/arm-cmn: Drop compile-test restriction |
| 5 | |
| 6 | Although CMN is currently (and overwhelmingly likely to remain) deployed |
| 7 | in arm64-only (modulo userspace) systems, the 64-bit "dependency" for |
| 8 | compile-testing was just laziness due to heavy reliance on readq/writeq |
| 9 | accessors. Since we only need one extra include for robustness in that |
| 10 | regard, let's pull that in, widen the compile-test coverage, and fix up |
| 11 | the smattering of type laziness that that brings to light. |
| 12 | |
| 13 | Signed-off-by: Robin Murphy <robin.murphy@arm.com> |
| 14 | Link: https://lore.kernel.org/r/baee9ee0d0bdad8aaeb70f5a4b98d8fd4b1f5786.1638530442.git.robin.murphy@arm.com |
| 15 | Signed-off-by: Will Deacon <will@kernel.org> |
| 16 | |
| 17 | Upstream-Status: Backport [https://lore.kernel.org/r/baee9ee0d0bdad8aaeb70f5a4b98d8fd4b1f5786.1638530442.git.robin.murphy@arm.com] |
| 18 | Signed-off-by: Rupinderjit Singh <rupinderjit.singh@arm.com> |
| 19 | --- |
| 20 | drivers/perf/Kconfig | 2 +- |
| 21 | drivers/perf/arm-cmn.c | 25 +++++++++++++------------ |
| 22 | 2 files changed, 14 insertions(+), 13 deletions(-) |
| 23 | |
| 24 | diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig |
| 25 | index 130327ff0b0e..828a042d6a07 100644 |
| 26 | --- a/drivers/perf/Kconfig |
| 27 | +++ b/drivers/perf/Kconfig |
| 28 | @@ -43,7 +43,7 @@ config ARM_CCN |
| 29 | |
| 30 | config ARM_CMN |
| 31 | tristate "Arm CMN-600 PMU support" |
| 32 | - depends on ARM64 || (COMPILE_TEST && 64BIT) |
| 33 | + depends on ARM64 || COMPILE_TEST |
| 34 | help |
| 35 | Support for PMU events monitoring on the Arm CMN-600 Coherent Mesh |
| 36 | Network interconnect. |
| 37 | diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c |
| 38 | index 2146d1c0103f..e9af79b5f3de 100644 |
| 39 | --- a/drivers/perf/arm-cmn.c |
| 40 | +++ b/drivers/perf/arm-cmn.c |
| 41 | @@ -7,6 +7,7 @@ |
| 42 | #include <linux/bitops.h> |
| 43 | #include <linux/interrupt.h> |
| 44 | #include <linux/io.h> |
| 45 | +#include <linux/io-64-nonatomic-lo-hi.h> |
| 46 | #include <linux/kernel.h> |
| 47 | #include <linux/list.h> |
| 48 | #include <linux/module.h> |
| 49 | @@ -122,11 +123,11 @@ |
| 50 | |
| 51 | |
| 52 | /* Event attributes */ |
| 53 | -#define CMN_CONFIG_TYPE GENMASK(15, 0) |
| 54 | -#define CMN_CONFIG_EVENTID GENMASK(23, 16) |
| 55 | -#define CMN_CONFIG_OCCUPID GENMASK(27, 24) |
| 56 | -#define CMN_CONFIG_BYNODEID BIT(31) |
| 57 | -#define CMN_CONFIG_NODEID GENMASK(47, 32) |
| 58 | +#define CMN_CONFIG_TYPE GENMASK_ULL(15, 0) |
| 59 | +#define CMN_CONFIG_EVENTID GENMASK_ULL(23, 16) |
| 60 | +#define CMN_CONFIG_OCCUPID GENMASK_ULL(27, 24) |
| 61 | +#define CMN_CONFIG_BYNODEID BIT_ULL(31) |
| 62 | +#define CMN_CONFIG_NODEID GENMASK_ULL(47, 32) |
| 63 | |
| 64 | #define CMN_EVENT_TYPE(event) FIELD_GET(CMN_CONFIG_TYPE, (event)->attr.config) |
| 65 | #define CMN_EVENT_EVENTID(event) FIELD_GET(CMN_CONFIG_EVENTID, (event)->attr.config) |
| 66 | @@ -134,13 +135,13 @@ |
| 67 | #define CMN_EVENT_BYNODEID(event) FIELD_GET(CMN_CONFIG_BYNODEID, (event)->attr.config) |
| 68 | #define CMN_EVENT_NODEID(event) FIELD_GET(CMN_CONFIG_NODEID, (event)->attr.config) |
| 69 | |
| 70 | -#define CMN_CONFIG_WP_COMBINE GENMASK(27, 24) |
| 71 | -#define CMN_CONFIG_WP_DEV_SEL BIT(48) |
| 72 | -#define CMN_CONFIG_WP_CHN_SEL GENMASK(50, 49) |
| 73 | -#define CMN_CONFIG_WP_GRP BIT(52) |
| 74 | -#define CMN_CONFIG_WP_EXCLUSIVE BIT(53) |
| 75 | -#define CMN_CONFIG1_WP_VAL GENMASK(63, 0) |
| 76 | -#define CMN_CONFIG2_WP_MASK GENMASK(63, 0) |
| 77 | +#define CMN_CONFIG_WP_COMBINE GENMASK_ULL(27, 24) |
| 78 | +#define CMN_CONFIG_WP_DEV_SEL BIT_ULL(48) |
| 79 | +#define CMN_CONFIG_WP_CHN_SEL GENMASK_ULL(50, 49) |
| 80 | +#define CMN_CONFIG_WP_GRP BIT_ULL(52) |
| 81 | +#define CMN_CONFIG_WP_EXCLUSIVE BIT_ULL(53) |
| 82 | +#define CMN_CONFIG1_WP_VAL GENMASK_ULL(63, 0) |
| 83 | +#define CMN_CONFIG2_WP_MASK GENMASK_ULL(63, 0) |
| 84 | |
| 85 | #define CMN_EVENT_WP_COMBINE(event) FIELD_GET(CMN_CONFIG_WP_COMBINE, (event)->attr.config) |
| 86 | #define CMN_EVENT_WP_DEV_SEL(event) FIELD_GET(CMN_CONFIG_WP_DEV_SEL, (event)->attr.config) |
| 87 | -- |
| 88 | 2.25.1 |
| 89 | |