From: Robin Murphy <robin.murphy@arm.com> Date: 2021-12-07 18:20:50
Hi all,
Here's another bunch of PMU-related updates I've been accruing lately.
Patch #1 is rebased on Thierry's patch already adding the Cortex-A78
compatible so probably wants to go via Rob to avoid further conflicts.
Thanks,
Robin.
Robin Murphy (5):
dt-bindings: arm: Catch up with Cortex/Neoverse CPUs again
arm64: perf: Simplify registration boilerplate
arm64: perf: Support new DT compatibles
dt-bindings: perf: Convert Arm DSU to schema
dt-bindings: perf: Add compatible for Arm DSU-110
.../devicetree/bindings/arm/arm-dsu-pmu.txt | 27 --------
.../devicetree/bindings/arm/cpus.yaml | 6 ++
.../devicetree/bindings/arm/pmu.yaml | 6 ++
.../devicetree/bindings/perf/arm,dsu-pmu.yaml | 45 ++++++++++++
arch/arm64/kernel/perf_event.c | 68 +++++++++++++------
5 files changed, 104 insertions(+), 48 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/arm/arm-dsu-pmu.txt
create mode 100644 Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml
--
2.28.0.dirty
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Robin Murphy <robin.murphy@arm.com> Date: 2021-12-07 18:20:51
Add bindings for the 2020 and 2021 cohorts of Cortex-A and Neoverse
CPUs, now featuring their Cortex-X cousins as well.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
Documentation/devicetree/bindings/arm/cpus.yaml | 6 ++++++
Documentation/devicetree/bindings/arm/pmu.yaml | 6 ++++++
2 files changed, 12 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2021-12-08 18:12:13
On Tue, 07 Dec 2021 18:20:39 +0000, Robin Murphy wrote:
Add bindings for the 2020 and 2021 cohorts of Cortex-A and Neoverse
CPUs, now featuring their Cortex-X cousins as well.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
Documentation/devicetree/bindings/arm/cpus.yaml | 6 ++++++
Documentation/devicetree/bindings/arm/pmu.yaml | 6 ++++++
2 files changed, 12 insertions(+)
From: Robin Murphy <robin.murphy@arm.com> Date: 2021-12-07 18:20:52
The arm_pmu framework requires map_event to be non-NULL, so let
armv8_pmu_init() treat NULL as a default value for the generic PMUv3
event map and simplify the boilerplate in the callers a bit.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/kernel/perf_event.c | 32 +++++++++++---------------------
1 file changed, 11 insertions(+), 21 deletions(-)
From: Mark Rutland <mark.rutland@arm.com> Date: 2021-12-14 13:38:28
On Tue, Dec 07, 2021 at 06:20:40PM +0000, Robin Murphy wrote:
quoted hunk
The arm_pmu framework requires map_event to be non-NULL, so let
armv8_pmu_init() treat NULL as a default value for the generic PMUv3
event map and simplify the boilerplate in the callers a bit.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/kernel/perf_event.c | 32 +++++++++++---------------------
1 file changed, 11 insertions(+), 21 deletions(-)
From: Robin Murphy <robin.murphy@arm.com> Date: 2021-12-07 18:20:56
Wire up the new DT compatibles so we can present appropriate
PMU names to userspace for the latest and greatest CPUs.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/kernel/perf_event.c | 36 ++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
From: Mark Rutland <mark.rutland@arm.com> Date: 2021-12-07 18:44:14
On Tue, Dec 07, 2021 at 06:20:41PM +0000, Robin Murphy wrote:
quoted hunk
Wire up the new DT compatibles so we can present appropriate
PMU names to userspace for the latest and greatest CPUs.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/kernel/perf_event.c | 36 ++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
@@ -1215,6 +1215,26 @@ static int armv8_a78_pmu_init(struct arm_pmu *cpu_pmu)returnarmv8_pmu_init_nogroups(cpu_pmu,"armv8_cortex_a78",NULL);}+staticintarmv9_a510_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_a510",NULL);+}++staticintarmv9_a710_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_a710",NULL);+}++staticintarmv8_x1_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv8_cortex_x1",NULL);+}++staticintarmv9_x2_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_x2",NULL);+}
I wonder if it'd be better to do something like:
#define PMU_INIT_SIMPLE(name) \
static int name##_pmu_init(struct arm_pmu *cpu_pmu) \
{
return armv8_pmu_init_nogroups(cpu_pmu, #name, NULL); \
}
PMU_INIT_SIMPLE(armv9_cortex_a510)
PMU_INIT_SIMPLE(armv9_cortex_a710)
PMU_INIT_SIMPLE(armv8_xortex_x1)
PMU_INIT_SIMPLE(armv9_xortex_x2)
... and fix up the armv8_pmu_of_device_ids[] table to use the longer init names
that results in?
Otherwise, looks good to me.
Thanks,
Mark.
From: Robin Murphy <robin.murphy@arm.com> Date: 2021-12-07 19:14:36
On 2021-12-07 18:44, Mark Rutland wrote:
On Tue, Dec 07, 2021 at 06:20:41PM +0000, Robin Murphy wrote:
quoted
Wire up the new DT compatibles so we can present appropriate
PMU names to userspace for the latest and greatest CPUs.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/kernel/perf_event.c | 36 ++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
@@ -1215,6 +1215,26 @@ static int armv8_a78_pmu_init(struct arm_pmu *cpu_pmu)returnarmv8_pmu_init_nogroups(cpu_pmu,"armv8_cortex_a78",NULL);}+staticintarmv9_a510_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_a510",NULL);+}++staticintarmv9_a710_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_a710",NULL);+}++staticintarmv8_x1_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv8_cortex_x1",NULL);+}++staticintarmv9_x2_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_x2",NULL);+}
I wonder if it'd be better to do something like:
#define PMU_INIT_SIMPLE(name) \
static int name##_pmu_init(struct arm_pmu *cpu_pmu) \
{
return armv8_pmu_init_nogroups(cpu_pmu, #name, NULL); \
}
PMU_INIT_SIMPLE(armv9_cortex_a510)
PMU_INIT_SIMPLE(armv9_cortex_a710)
PMU_INIT_SIMPLE(armv8_xortex_x1)
PMU_INIT_SIMPLE(armv9_xortex_x2)
... and fix up the armv8_pmu_of_device_ids[] table to use the longer init names
that results in?
Indeed I did ponder doing almost exactly that, but at that point I'd
rather try refactoring a bit deeper to convert most of the arm_pmu init
business to pure data, so I figured I'd chuck in the simple tweak to
mitigate these new additions with minimal churn, then have a go at the
bigger change in its own right.
From: Mark Rutland <mark.rutland@arm.com> Date: 2021-12-14 13:36:23
On Tue, Dec 07, 2021 at 07:14:29PM +0000, Robin Murphy wrote:
On 2021-12-07 18:44, Mark Rutland wrote:
quoted
On Tue, Dec 07, 2021 at 06:20:41PM +0000, Robin Murphy wrote:
quoted
Wire up the new DT compatibles so we can present appropriate
PMU names to userspace for the latest and greatest CPUs.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/kernel/perf_event.c | 36 ++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
@@ -1215,6 +1215,26 @@ static int armv8_a78_pmu_init(struct arm_pmu *cpu_pmu)returnarmv8_pmu_init_nogroups(cpu_pmu,"armv8_cortex_a78",NULL);}+staticintarmv9_a510_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_a510",NULL);+}++staticintarmv9_a710_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_a710",NULL);+}++staticintarmv8_x1_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv8_cortex_x1",NULL);+}++staticintarmv9_x2_pmu_init(structarm_pmu*cpu_pmu)+{+returnarmv8_pmu_init_nogroups(cpu_pmu,"armv9_cortex_x2",NULL);+}
I wonder if it'd be better to do something like:
#define PMU_INIT_SIMPLE(name) \
static int name##_pmu_init(struct arm_pmu *cpu_pmu) \
{
return armv8_pmu_init_nogroups(cpu_pmu, #name, NULL); \
}
PMU_INIT_SIMPLE(armv9_cortex_a510)
PMU_INIT_SIMPLE(armv9_cortex_a710)
PMU_INIT_SIMPLE(armv8_xortex_x1)
PMU_INIT_SIMPLE(armv9_xortex_x2)
... and fix up the armv8_pmu_of_device_ids[] table to use the longer init names
that results in?
Indeed I did ponder doing almost exactly that, but at that point I'd rather
try refactoring a bit deeper to convert most of the arm_pmu init business to
pure data, so I figured I'd chuck in the simple tweak to mitigate these new
additions with minimal churn, then have a go at the bigger change in its own
right.
Sure; that makes sense to me, so for this as-is:
Acked-by: Mark Rutland <mark.rutland@arm.com>
... and I'll leave it to Will to have the final say on whether we want the
"armv9_" prefix or whether we stick with "armv8_" for consistenct, when he
chooses to pick this.
One thing I've just realised is that for the ACPI case, we're stuck with
"armv8_pmuv3_%d" regardless, which I think is fine itself, but we might want to
call that out.
Thanks,
Mark.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
@@ -1,27 +0,0 @@-* ARM DynamIQ Shared Unit (DSU) Performance Monitor Unit (PMU)--ARM DyanmIQ Shared Unit (DSU) integrates one or more CPU cores-with a shared L3 memory system, control logic and external interfaces to-form a multicore cluster. The PMU enables to gather various statistics on-the operations of the DSU. The PMU provides independent 32bit counters that-can count any of the supported events, along with a 64bit cycle counter.-The PMU is accessed via CPU system registers and has no MMIO component.--** DSU PMU required properties:--- compatible : should be one of :-- "arm,dsu-pmu"--- interrupts : Exactly 1 SPI must be listed.--- cpus : List of phandles for the CPUs connected to this DSU instance.---** Example:--dsu-pmu-0 {- compatible = "arm,dsu-pmu";- interrupts = <GIC_SPI 02 IRQ_TYPE_LEVEL_HIGH>;- cpus = <&cpu_0>, <&cpu_1>;-};
@@ -0,0 +1,41 @@+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)+# Copyright 2021 Arm Ltd.+%YAML1.2+---+$id:http://devicetree.org/schemas/perf/arm,dsu-pmu.yaml#+$schema:http://devicetree.org/meta-schemas/core.yaml#++title:ARM DynamIQ Shared Unit (DSU) Performance Monitor Unit (PMU)++maintainers:+-Suzuki K Poulose <suzuki.poulose@arm.com>+-Robin Murphy <robin.murphy@arm.com>++description:+ARM DyanmIQ Shared Unit (DSU) integrates one or more CPU cores with a shared+L3 memory system, control logic and external interfaces to form a multicore+cluster. The PMU enables gathering various statistics on the operation of the+DSU. The PMU provides independent 32-bit counters that can count any of the+supported events, along with a 64-bit cycle counter. The PMU is accessed via+CPU system registers and has no MMIO component.++properties:+compatible:+const:"arm,dsu-pmu"++interrupts:+items:+description:nCLUSTERPMUIRQ interrupt++cpus:+$ref:/schemas/types.yaml#/definitions/phandle-array+minitems:1+maxitems:8+description:List of phandles for the CPUs connected to this DSU instance.++required:+-compatible+-interrupts+-cpus++additionalProperties:false
--
2.28.0.dirty
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Rob Herring <robh@kernel.org> Date: 2021-12-08 13:44:46
On Tue, 07 Dec 2021 18:20:42 +0000, Robin Murphy wrote:
Convert the DSU binding to schema, as one does.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
.../devicetree/bindings/arm/arm-dsu-pmu.txt | 27 ------------
.../devicetree/bindings/perf/arm,dsu-pmu.yaml | 41 +++++++++++++++++++
2 files changed, 41 insertions(+), 27 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/arm/arm-dsu-pmu.txt
create mode 100644 Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml: properties:cpus: 'minitems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml: properties:cpus: 'maxitems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml: ignoring, error in schema: properties: cpus
warning: no schema found in file: ./Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1564818
This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
@@ -1,27 +0,0 @@-* ARM DynamIQ Shared Unit (DSU) Performance Monitor Unit (PMU)--ARM DyanmIQ Shared Unit (DSU) integrates one or more CPU cores-with a shared L3 memory system, control logic and external interfaces to-form a multicore cluster. The PMU enables to gather various statistics on-the operations of the DSU. The PMU provides independent 32bit counters that-can count any of the supported events, along with a 64bit cycle counter.-The PMU is accessed via CPU system registers and has no MMIO component.--** DSU PMU required properties:--- compatible : should be one of :-- "arm,dsu-pmu"--- interrupts : Exactly 1 SPI must be listed.--- cpus : List of phandles for the CPUs connected to this DSU instance.---** Example:--dsu-pmu-0 {- compatible = "arm,dsu-pmu";- interrupts = <GIC_SPI 02 IRQ_TYPE_LEVEL_HIGH>;- cpus = <&cpu_0>, <&cpu_1>;-};
@@ -0,0 +1,41 @@+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)+# Copyright 2021 Arm Ltd.+%YAML1.2+---+$id:http://devicetree.org/schemas/perf/arm,dsu-pmu.yaml#+$schema:http://devicetree.org/meta-schemas/core.yaml#++title:ARM DynamIQ Shared Unit (DSU) Performance Monitor Unit (PMU)++maintainers:+-Suzuki K Poulose <suzuki.poulose@arm.com>+-Robin Murphy <robin.murphy@arm.com>++description:+ARM DyanmIQ Shared Unit (DSU) integrates one or more CPU cores with a shared+L3 memory system, control logic and external interfaces to form a multicore+cluster. The PMU enables gathering various statistics on the operation of the+DSU. The PMU provides independent 32-bit counters that can count any of the+supported events, along with a 64-bit cycle counter. The PMU is accessed via+CPU system registers and has no MMIO component.++properties:+compatible:+const:"arm,dsu-pmu"
From: Robin Murphy <robin.murphy@arm.com> Date: 2021-12-07 18:20:57
DSU-110 is the newest and shiniest for Armv9. Its programmer's model is
largely identical to the previous generation of DSUs, so we can treat it
as compatible, but it does have a a handful of extra IMP-DEF PMU events
to call its own. Thanks to the new notion of core complexes, the maximum
number of supported CPUs goes up as well.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -30,7 +34,7 @@ properties:cpus:$ref:/schemas/types.yaml#/definitions/phandle-arrayminitems:1-maxitems:8+maxitems:12description:List of phandles for the CPUs connected to this DSU instance.required:
--
2.28.0.dirty
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Rob Herring <robh@kernel.org> Date: 2021-12-08 18:21:38
On Tue, Dec 07, 2021 at 06:20:43PM +0000, Robin Murphy wrote:
quoted hunk
DSU-110 is the newest and shiniest for Armv9. Its programmer's model is
largely identical to the previous generation of DSUs, so we can treat it
as compatible, but it does have a a handful of extra IMP-DEF PMU events
to call its own. Thanks to the new notion of core complexes, the maximum
number of supported CPUs goes up as well.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -30,7 +34,7 @@ properties: cpus: $ref: /schemas/types.yaml#/definitions/phandle-array minitems: 1- maxitems: 8+ maxitems: 12 description: List of phandles for the CPUs connected to this DSU instance. required:
From: Robin Murphy <robin.murphy@arm.com> Date: 2021-12-08 21:01:41
On 2021-12-08 18:21, Rob Herring wrote:
On Tue, Dec 07, 2021 at 06:20:43PM +0000, Robin Murphy wrote:
quoted
DSU-110 is the newest and shiniest for Armv9. Its programmer's model is
largely identical to the previous generation of DSUs, so we can treat it
as compatible, but it does have a a handful of extra IMP-DEF PMU events
to call its own. Thanks to the new notion of core complexes, the maximum
number of supported CPUs goes up as well.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
Documentation/devicetree/bindings/perf/arm,dsu-pmu.yaml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Oof, I probably deserved little more than a "go away and test these
patches" for the monumental cock-up on show here - thanks for all the
pointers and apologies for testing your patience. That'll be the danger
of picking commits off an old branch in a hurry despite not remembering
exactly how complete they were, and assuming the "WIP:" must just be
because they still need commit messages writing...
I've stopped being a lazy git and installed the schema tooling locally
now too.
Cheers,
Robin.
quoted
interrupts:
items:
@@ -30,7 +34,7 @@ properties: cpus: $ref: /schemas/types.yaml#/definitions/phandle-array minitems: 1- maxitems: 8+ maxitems: 12 description: List of phandles for the CPUs connected to this DSU instance. required: