arm: bcm2835: Add the PMU to the devicetree.
Subsystems (3)
PATCH 1/1 arm: bcm2835: Add the PMU to the devicetree.
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
--- arch/arm/boot/dts/bcm2837.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/bcm2837.dtsi +6 -0
@@ -17,6 +17,12 @@ }; }; + arm-pmu { + compatible = "arm,cortex-a53-pmu", "arm,cortex-a7-pmu"; + interrupt-parent = <&local_intc>; + interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; + }; + timer { compatible = "arm,armv7-timer"; interrupt-parent = <&local_intc>;
Signature · 1 line
2.17.0
Quoted 5 lines · Eric Anholt
arch/arm/boot/dts/bcm2837.dtsi +0
-0
arch/arm/boot/dts/bcm2837.dtsi line 25
Quoted 9 lines
arch/arm/boot/dts/bcm2837.dtsi +6
-0@@ -17,6 +17,12 @@ }; }; + arm-pmu { + compatible = "arm,cortex-a53-pmu", "arm,cortex-a7-pmu"; + interrupt-parent = <&local_intc>; + interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; + }; +
why this and not
arm-pmu {
compatible = "arm,armv8-pmuv3";
interrupt-parent = <&local_intc>;
interrupts = <9>;
};which works, though when I didn't get very far when I submitted the patch to add this last August.
Vince
Quoted 19 lines · Vince Weaver
Quoted 5 lines · Eric Anholt
arch/arm/boot/dts/bcm2837.dtsi +0
-0arch/arm/boot/dts/bcm2837.dtsi line 25
Quoted 9 lines
arch/arm/boot/dts/bcm2837.dtsi +6
-0@@ -17,6 +17,12 @@ }; }; + arm-pmu { + compatible = "arm,cortex-a53-pmu", "arm,cortex-a7-pmu"; + interrupt-parent = <&local_intc>; + interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; + }; +why this and not
Quoted 8 lines
arm-pmu { compatible = "arm,armv8-pmuv3"; interrupt-parent = <&local_intc>; interrupts = <9>; };which works, though when I didn't get very far when I submitted the patch to add this last August.
Is that better than a53? I'm happy to switch to that. The important
part to me is the a7, since basically everyone with this hw is running
arm32.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180517/78df2543/attachment.sig>
Quoted 4 lines · Eric Anholt
Is that better than a53? I'm happy to switch to that. The important part to me is the a7, since basically everyone with this hw is running arm32.
no, on further investigation it looks like a53 is more proper to use than the generic armv8.
Is the armv8 pmu on the cortex-a53 backwards compatible with armv7? I'm dreading having to pull up the various ARM ARMs to look for myself so if it works for you I'm fine with that part too.
The biggest pushback I had with my original patch was no one believing irq 9 was the right one to use.
Vince
Quoted 23 lines
Vince Weaver <[email protected]> hat am 17. Mai 2018 um 16:11 geschrieben:
Quoted 5 lines · Eric Anholt
arch/arm/boot/dts/bcm2837.dtsi +0
-0arch/arm/boot/dts/bcm2837.dtsi line 25
Quoted 9 lines
arch/arm/boot/dts/bcm2837.dtsi +6
-0@@ -17,6 +17,12 @@ }; }; + arm-pmu { + compatible = "arm,cortex-a53-pmu", "arm,cortex-a7-pmu"; + interrupt-parent = <&local_intc>; + interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; + }; +why this and not
Quoted 8 lines
arm-pmu { compatible = "arm,armv8-pmuv3"; interrupt-parent = <&local_intc>; interrupts = <9>; };which works, though when I didn't get very far when I submitted the patch to add this last August.
Eric's variant is more specific so we better chose this. The init code diverse between the general arm,armv8-pmuv3 and arm,cortex-a53-pmu.
Quoted 7 lines
Vince
_______________________________________________
linux-rpi-kernel mailing list
linux-rpi-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel
Quoted 8 lines
Eric Anholt <[email protected]> hat am 17. Mai 2018 um 15:17 geschrieben:
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
Signed-off-by Eric Anholt <[email protected]>
Quoted 6 lines · Stefan Wahren
Quoted 6 lines
Eric Anholt <[email protected]> hat am 17. Mai 2018 um 15:17 geschrieben:
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
so how closely did you look at the a53/a7 differences? I see some major differences, especially with the CPU_CYCLES event (0xff vs 0x11).
The proper fix here might be to add a cortex-a53 PMU entry to the armv7 code rather than trying to treat it as a cortex-a7.
Vince
Hi,
[added Peter, Ingo and Arnaldo]
Quoted 9 lines
Vince Weaver <[email protected]> hat am 17. Mai 2018 um 18:34 geschrieben:
Quoted 4 lines · Stefan Wahren
Quoted 4 lines
Eric Anholt <[email protected]> hat am 17. Mai 2018 um 15:17 geschrieben:
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
so how closely did you look at the a53/a7 differences? I see some major differences, especially with the
CPU_CYCLESevent (0xffvs0x11).The proper fix here might be to add a cortex-a53 PMU entry to the armv7 code rather than trying to treat it as a cortex-a7.
we like to use the PMU of BCM2837 SoC (4x A53 cores) under arm32 and arm64.
What is the right way (tm) to the define the DT compatibles? Does the arm32 PMU driver need patching for proper A53 support?
Stefan
Quoted 2 lines
Vince
Quoted 10 lines · Stefan Wahren
Quoted 10 lines
Vince Weaver <[email protected]> hat am 17. Mai 2018 um 18:34 geschrieben:
Quoted 4 lines · Stefan Wahren
Quoted 4 lines
Eric Anholt <[email protected]> hat am 17. Mai 2018 um 15:17 geschrieben:
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
so how closely did you look at the a53/a7 differences? I see some major differences, especially with the
CPU_CYCLESevent (0xffvs0x11).
Quoted 7 lines
Quoted 2 lines
The proper fix here might be to add a cortex-a53 PMU entry to the armv7 code rather than trying to treat it as a cortex-a7.
we like to use the PMU of BCM2837 SoC (4x A53 cores) under arm32 and arm64.
What is the right way (tm) to the define the DT compatibles? Does the arm32 PMU driver need patching for proper A53 support?
I'm completely clueless on all of this; Mark might have ideas.
Quoted 14 lines · Peter Zijlstra
Quoted 13 lines · Stefan Wahren
Quoted 12 lines
Vince Weaver <[email protected]> hat am 17. Mai 2018 um 18:34 geschrieben:
Quoted 4 lines · Stefan Wahren
Quoted 4 lines
Eric Anholt <[email protected]> hat am 17. Mai 2018 um 15:17 geschrieben:
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
so how closely did you look at the a53/a7 differences? I see some major differences, especially with the
CPU_CYCLESevent (0xffvs0x11).The proper fix here might be to add a cortex-a53 PMU entry to the armv7 code rather than trying to treat it as a cortex-a7.
Quoted 6 lines
Quoted 4 lines
we like to use the PMU of BCM2837 SoC (4x A53 cores) under arm32 and arm64.
What is the right way (tm) to the define the DT compatibles? Does the arm32 PMU driver need patching for proper A53 support?
I'm completely clueless on all of this; Mark might have ideas.
Spending more time looking at it the only obvious differences are the previously mentioned CYCLES difference, as well as the cortex-a7 has 18 events in the perf_cache_map but cortex-a53 only has 3. Plus probably support for the various other features of the armv8v3 pmu that the a7 knows nothing about.
Is it hard to get lines in the DT changed once they are there? If we go with cortex-a7 now, would it be possible to later drop that if proper cortex-a53 support is added to the armv7 pmu driver? Or would that lead to all kinds of back-compatability mess?
Vince
Quoted 4 lines · Vince Weaver
On Thu, 17 May 2018, Peter Zijlstra wrote:
with cortex-a7 now, would it be possible to later drop that if proper cortex-a53 support is added to the armv7 pmu driver? Or would that lead to all kinds of back-compatability mess?
For what it's worth, the pi-foundation kernel bcm2710 device tree file does:
arm-pmu {
#ifdef RPI364
compatible = "arm,armv8-pmuv3", "arm,cortex-a7-pmu";
#else
compatible = "arm,cortex-a7-pmu";
#endif
interrupt-parent = <&local_intc>;
interrupts = <9>;
};Which is probably where I was getting the arm,armv8-pmuv3 from in my original patch.
Vince
Quoted 21 lines · Vince Weaver
Quoted 4 lines · Vince Weaver
On Thu, 17 May 2018, Peter Zijlstra wrote:
with cortex-a7 now, would it be possible to later drop that if proper cortex-a53 support is added to the armv7 pmu driver? Or would that lead to all kinds of back-compatability mess?For what it's worth, the pi-foundation kernel bcm2710 device tree file does:
arm-pmu { #ifdef RPI364 compatible = "arm,armv8-pmuv3", "arm,cortex-a7-pmu"; #else compatible = "arm,cortex-a7-pmu"; #endif interrupt-parent = <&local_intc>; interrupts = <9>; };
Quoted 2 lines
Which is probably where I was getting the arm,armv8-pmuv3 from in my original patch.
I thought somehow that Marc Z. had unified arch/arm/kernel/perf_event_v7.c and arch/arm64/kernel/perf_event.c into a common driver entry point under drivers/perf/arm_pmu.c but I don't see it and after about 15 minutes looking at it, it does not look as trivial as I though to separate out those files so the ARMv8 PMU description can be moved into a generic location for instance.
FWIW, Broadcom STB chips, even when 64-bit capable or often used with an 32-bit ARM kernel, so having the ARMv8 PMUs work under a 32-bit ARM kernel would be great. The downstream solution we have sued thus far is to find the closest compatible string to represent those, which is not great...
Signature · 1 line
Florian
Quoted 8 lines · Florian Fainelli
Quoted 7 lines · Vince Weaver
Quoted 4 lines · Vince Weaver
On Thu, 17 May 2018, Peter Zijlstra wrote:
with cortex-a7 now, would it be possible to later drop that if proper cortex-a53 support is added to the armv7 pmu driver? Or would that lead to all kinds of back-compatability mess?
Quoted 6 lines
Quoted 6 lines
For what it's worth, the pi-foundation kernel bcm2710 device tree file does:
arm-pmu { #ifdef RPI364 compatible = "arm,armv8-pmuv3", "arm,cortex-a7-pmu";
Hahaha. Funny that. Not. That's really silly. The DT *must* describe the HW, and having contradictory information is not helping. This is going to lead to all kind of miscounted events (to take the above example) A7 and A53 are significantly different, and thus will count events differently....
Quoted 11 lines
Quoted 10 lines
#else compatible = "arm,cortex-a7-pmu"; #endif interrupt-parent = <&local_intc>; interrupts = <9>; };Which is probably where I was getting the arm,armv8-pmuv3 from in my original patch.
Quoted 6 lines
I thought somehow that Marc Z. had unified
arch/arm/kernel/perf_event_v7.candarch/arm64/kernel/perf_event.cinto a common driver entry point underdrivers/perf/arm_pmu.cbut I don't see it and after about 15 minutes looking at it, it does not look as trivial as I though to separate out those files so the ARMv8 PMU description can be moved into a generic location for instance.
I have a pretty simple series[1] which I used to profile 32bit guests on an arm64 KVM host. Nobody really cared about it because running a 32bit kernel on 64bit HW is a bit odd, to say the least, and I'm probably the only one actually running 32bit VMs.
Quoted 5 lines
FWIW, Broadcom STB chips, even when 64-bit capable or often used with an 32-bit ARM kernel, so having the ARMv8 PMUs work under a 32-bit ARM kernel would be great. The downstream solution we have sued thus far is to find the closest compatible string to represent those, which is not great...
Ah, so you're *really* doing that? I'm not going to ask why, I'm scared of the answer... ;-)
Anyway, I can repost that series if that will prevent people from having that kind of silly hacks.
Thanks,
M.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm/pmuv3-32bit
Signature · 1 line
Jazz is not dead. It just smells funny...
Hi Marc,
Quoted 12 lines
Marc Zyngier <[email protected]> hat am 18. Mai 2018 um 10:07 geschrieben:
I have a pretty simple series[1] which I used to profile 32bit guests on an arm64 KVM host. Nobody really cared about it because running a 32bit kernel on 64bit HW is a bit odd, to say the least, and I'm probably the only one actually running 32bit VMs.
Quoted 5 lines
FWIW, Broadcom STB chips, even when 64-bit capable or often used with an 32-bit ARM kernel, so having the ARMv8 PMUs work under a 32-bit ARM kernel would be great. The downstream solution we have sued thus far is to find the closest compatible string to represent those, which is not great...
Quoted 5 lines
Ah, so you're *really* doing that? I'm not going to ask why, I'm scared of the answer... ;-)
Anyway, I can repost that series if that will prevent people from having that kind of silly hacks.
yes please. But there is a minor nit: some patches introduce new files without SPDX tags.
Thanks
Stefan
Quoted 9 lines
Thanks,
M.[1]
https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm/pmuv3-32bitSignature · 1 line
Jazz is not dead. It just smells funny...
Quoted 14 lines · Stefan Wahren
Hi Marc,
Quoted 12 lines
Marc Zyngier <[email protected]> hat am 18. Mai 2018 um 10:07 geschrieben:
I have a pretty simple series[1] which I used to profile 32bit guests on an arm64 KVM host. Nobody really cared about it because running a 32bit kernel on 64bit HW is a bit odd, to say the least, and I'm probably the only one actually running 32bit VMs.
Quoted 5 lines
FWIW, Broadcom STB chips, even when 64-bit capable or often used with an 32-bit ARM kernel, so having the ARMv8 PMUs work under a 32-bit ARM kernel would be great. The downstream solution we have sued thus far is to find the closest compatible string to represent those, which is not great...
Quoted 7 lines
Quoted 5 lines
Ah, so you're *really* doing that? I'm not going to ask why, I'm scared of the answer... ;-)
Anyway, I can repost that series if that will prevent people from having that kind of silly hacks.
yes please. But there is a minor nit: some patches introduce new files without SPDX tags.
I'm shocked! ;-)
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Quoted 11 lines · Vince Weaver
Quoted 6 lines · Stefan Wahren
Quoted 6 lines
Eric Anholt <[email protected]> hat am 17. Mai 2018 um 15:17 geschrieben:
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
so how closely did you look at the a53/a7 differences? I see some major differences, especially with the
CPU_CYCLESevent (0xffvs0x11).
I'm a bit lost in the code, but it seemed like the 0xff was a
placeholder for a bit of special behavior, but that the cpu_cycles -> ARMV7_PERFCTR_CLOCK_CYCLES mapping got you that same value in the end.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180517/24fefc2e/attachment-0001.sig>
Quoted 4 lines · Eric Anholt
The a53 and a7 counters seem to match up, so we advertise a7 so that arm32 can probe.
Signed-off-by Eric Anholt <[email protected]>
We've carried the same/equiv patch in Fedora for a while with no issues.
Peter
Quoted 29 lines
--- arch/arm/boot/dts/bcm2837.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm/boot/dts/bcm2837.dtsi +6
-1@@ -17,6 +17,12 @@ }; }; + arm-pmu { + compatible = "arm,cortex-a53-pmu", "arm,cortex-a7-pmu"; + interrupt-parent = <&local_intc>; + interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; + }; + timer { compatible = "arm,armv7-timer"; interrupt-parent = <&local_intc>; --2.17.0
_______________________________________________
linux-rpi-kernel mailing list
linux-rpi-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel