From: Rob Herring <robh@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>
Cc: Mark Brown <broonie@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev,
linux-perf-users@vger.kernel.org,
James Clark <james.clark@arm.com>
Subject: [PATCH v4 5/8] perf: arm_spe: Use new PMSIDR_EL1 register enums
Date: Mon, 09 Jan 2023 13:26:21 -0600 [thread overview]
Message-ID: <20220825-arm-spe-v8-7-v4-5-327f860daf28@kernel.org> (raw)
In-Reply-To: <20220825-arm-spe-v8-7-v4-0-327f860daf28@kernel.org>
Now that the SPE register definitions include enums for some PMSIDR_EL1
fields, use them in the driver in place of magic values.
Signed-off-by: Rob Herring <robh@kernel.org>
---
v4:
- Rebase on v6.2-rc1
v3: New patch
---
drivers/perf/arm_spe_pmu.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index 9b4bd72087ea..af6d3867c3e7 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -1006,32 +1006,32 @@ static void __arm_spe_pmu_dev_probe(void *info)
/* This field has a spaced out encoding, so just use a look-up */
fld = FIELD_GET(PMSIDR_EL1_INTERVAL, reg);
switch (fld) {
- case 0:
+ case PMSIDR_EL1_INTERVAL_256:
spe_pmu->min_period = 256;
break;
- case 2:
+ case PMSIDR_EL1_INTERVAL_512:
spe_pmu->min_period = 512;
break;
- case 3:
+ case PMSIDR_EL1_INTERVAL_768:
spe_pmu->min_period = 768;
break;
- case 4:
+ case PMSIDR_EL1_INTERVAL_1024:
spe_pmu->min_period = 1024;
break;
- case 5:
+ case PMSIDR_EL1_INTERVAL_1536:
spe_pmu->min_period = 1536;
break;
- case 6:
+ case PMSIDR_EL1_INTERVAL_2048:
spe_pmu->min_period = 2048;
break;
- case 7:
+ case PMSIDR_EL1_INTERVAL_3072:
spe_pmu->min_period = 3072;
break;
default:
dev_warn(dev, "unknown PMSIDR_EL1.Interval [%d]; assuming 8\n",
fld);
fallthrough;
- case 8:
+ case PMSIDR_EL1_INTERVAL_4096:
spe_pmu->min_period = 4096;
}
@@ -1050,10 +1050,10 @@ static void __arm_spe_pmu_dev_probe(void *info)
dev_warn(dev, "unknown PMSIDR_EL1.CountSize [%d]; assuming 2\n",
fld);
fallthrough;
- case 2:
+ case PMSIDR_EL1_COUNTSIZE_12_BIT_SAT:
spe_pmu->counter_sz = 12;
break;
- case 3:
+ case PMSIDR_EL1_COUNTSIZE_16_BIT_SAT:
spe_pmu->counter_sz = 16;
}
--
2.39.0
next prev parent reply other threads:[~2023-01-09 19:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 19:26 [PATCH v4 0/8] perf: Arm SPEv1.2 support Rob Herring
2023-01-09 19:26 ` [PATCH v4 1/8] perf: arm_spe: Use feature numbering for PMSEVFR_EL1 defines Rob Herring
2023-01-10 6:48 ` Anshuman Khandual
2023-01-09 19:26 ` [PATCH v4 2/8] arm64: Drop SYS_ from SPE register defines Rob Herring
2023-01-10 7:54 ` Anshuman Khandual
2023-01-09 19:26 ` [PATCH v4 3/8] arm64/sysreg: Convert SPE registers to automatic generation Rob Herring
2023-01-09 19:33 ` Mark Brown
2023-01-09 20:18 ` Rob Herring
2023-01-09 20:40 ` Mark Brown
2023-01-10 8:05 ` Anshuman Khandual
2023-01-09 19:26 ` [PATCH v4 4/8] perf: arm_spe: Drop BIT() and use FIELD_GET/PREP accessors Rob Herring
2023-01-10 8:36 ` Anshuman Khandual
2023-01-09 19:26 ` Rob Herring [this message]
2023-01-10 8:46 ` [PATCH v4 5/8] perf: arm_spe: Use new PMSIDR_EL1 register enums Anshuman Khandual
2023-01-09 19:26 ` [PATCH v4 6/8] perf: arm_spe: Support new SPEv1.2/v8.7 'not taken' event Rob Herring
2023-01-10 8:54 ` Anshuman Khandual
2023-01-09 19:26 ` [PATCH v4 7/8] perf: Add perf_event_attr::config3 Rob Herring
2023-02-04 10:36 ` Peter Zijlstra
2023-01-09 19:26 ` [PATCH v4 8/8] perf: arm_spe: Add support for SPEv1.2 inverted event filtering Rob Herring
2023-01-19 19:08 ` [PATCH v4 0/8] perf: Arm SPEv1.2 support Will Deacon
2023-02-07 12:39 ` Will Deacon
2023-02-07 12:42 ` Will Deacon
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=20220825-arm-spe-v8-7-v4-5-327f860daf28@kernel.org \
--to=robh@kernel.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexandru.elisei@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.clark@arm.com \
--cc=james.morse@arm.com \
--cc=jolsa@kernel.org \
--cc=kvmarm@lists.linux.dev \
--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=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=peterz@infradead.org \
--cc=suzuki.poulose@arm.com \
--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).