From: Nick Chan <towinchenmi@gmail.com>
To: Ian Rogers <irogers@google.com>
Cc: Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Janne Grunau <j@jannau.net>,
Alyssa Rosenzweig <alyssa@rosenzweig.io>,
Neal Gompa <neal@gompa.dev>, Sven Peter <sven@kernel.org>,
Marc Zyngier <maz@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, devicetree@vger.kernel.org,
asahi@lists.linux.dev, linux-kernel@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH RESEND v7 00/21] drivers/perf: apple_m1: Add Apple A7-A11, T2 SoC support
Date: Mon, 16 Jun 2025 18:35:16 +0800 [thread overview]
Message-ID: <efa79e01-fb73-4808-8506-677ba45e43a1@gmail.com> (raw)
In-Reply-To: <CAP-5=fXSwgxMc+uh=PBAFh4Zm96tL5RDyKPOJ8Q40O4s=EaArA@mail.gmail.com>
Ian Rogers 於 2025/6/16 下晝5:36 寫道:
> On Sun, Jun 15, 2025 at 6:32 PM Nick Chan <towinchenmi@gmail.com> wrote:
>> This series adds support for the CPU PMU in the older Apple A7-A11, T2
>> SoCs. These PMUs may have a different event layout, less counters, or
>> deliver their interrupts via IRQ instead of a FIQ. Since some of those
>> older SoCs support 32-bit EL0, counting for 32-bit EL0 also need to
>> be enabled by the driver where applicable.
>>
>> Patch 1 adds the DT bindings.
>> Patch 2-7 prepares the driver to allow adding support for those
>> older SoCs.
>> Patch 8-12 adds support for the older SoCs.
>> Patch 13-21 are the DT changes.
>>
>> Signed-off-by: Nick Chan <towinchenmi@gmail.com>
> Hi Nick,
>
> This is substantial work and it looks good to me. Do you know why
> there's been little progress on landing these patches? Buggy Apple ARM
> PMU support in the kernel has led to reworking the perf tool. It seems
> best that we can have the best drivers possible.
I have no idea why the patches are taking so long. As for the buggy part I think only notable bug
has been M2's performance counter length increase from 48 to 64 (which for linux's purposes
is from 47 to 63) being overlooked[1], and I don't think there have been regressions.
It is not so much bugs, but rather lack of features. For the longest time we knew almost nothing
about the PMU events, and it is not until someone managed to extract the event names from
macOS and Apple's Apple Silicon CPU Optimization Guide[2] that we know quite a bit more
about the PMU. The event names are then added when it was determined that it is okay from
a copyright perspective[3] (it's the same as being allowed to use registers names from proprietary
ARM ARM). As for the description the guide does have descriptions, but descriptions are more
doubtful than names from a copyright perspective so I do not know if they could be ever be added
to the userspace perf tool.
[1]: https://lore.kernel.org/all/20230528080205.288446-1-maz@kernel.org/
[2]: https://github.com/cyyself/m1-pmu-gen
[3]: https://lore.kernel.org/all/tencent_C5DA658E64B8D13125210C8D707CD8823F08@qq.com/
Best regards,
Nick Chan
>
> Thanks,
> Ian
>
>> ---
>> Changes in v7:
>> - Fix a W=1 compile warning in apple_pmu_get_event_idx() as appearently using GENMASK()
>> in a function prototype causes a warning in GCC.
>> - Link to v6: https://lore.kernel.org/r/20250407-apple-cpmu-v6-0-ae8c2f225c1f@gmail.com
>>
>> Changes in v6:
>> - Rebased on top of v6.15-rc1 (Conflict with FEAT_PMUv3 support for KVM on Apple Hardware)
>> - Add patch to skip initialization of PMUv3 remap in EL1 even though not strictly needed
>> - Include DT patches
>> - Link to v5: https://lore.kernel.org/r/20250228-apple-cpmu-v5-0-9e124cd28ed4@gmail.com
>>
>> Changes in v5:
>> - Slightly change "drivers/perf: apple_m1: Add Apple A11 Support", to keep things in
>> chronological order.
>> - Link to v4: https://lore.kernel.org/r/20250214-apple-cpmu-v4-0-ffca0e45147e@gmail.com
>>
>> Changes in v4:
>> - Support per-implementation event attr group
>> - Fix Apple A7 event attr groups
>> - Link to v3: https://lore.kernel.org/r/20250213-apple-cpmu-v3-0-be7f8aded81f@gmail.com
>>
>> Changes in v3:
>> - Configure PMC8 and PMC9 for 32-bit EL0
>> - Remove redundant _common suffix from shared functions
>> - Link to v2: https://lore.kernel.org/r/20250213-apple-cpmu-v2-0-87b361932e88@gmail.com
>>
>> Changes in v2:
>> - Remove unused flags parameter from apple_pmu_init_common()
>> - Link to v1: https://lore.kernel.org/r/20250212-apple-cpmu-v1-0-f8c7f2ac1743@gmail.com
>>
>> ---
>> Nick Chan (21):
>> dt-bindings: arm: pmu: Add Apple A7-A11 SoC CPU PMU compatibles
>> drivers/perf: apple_m1: Only init PMUv3 remap when EL2 is available
>> drivers/perf: apple_m1: Support per-implementation event tables
>> drivers/perf: apple_m1: Support a per-implementation number of counters
>> drivers/perf: apple_m1: Support configuring counters for 32-bit EL0
>> drivers/perf: apple_m1: Support per-implementation PMU startup
>> drivers/perf: apple_m1: Support per-implementation event attr group
>> drivers/perf: apple_m1: Add Apple A7 support
>> drivers/perf: apple_m1: Add Apple A8/A8X support
>> drivers/perf: apple_m1: Add A9/A9X support
>> drivers/perf: apple_m1: Add Apple A10/A10X/T2 Support
>> drivers/perf: apple_m1: Add Apple A11 Support
>> arm64: dts: apple: s5l8960x: Add CPU PMU nodes
>> arm64: dts: apple: t7000: Add CPU PMU nodes
>> arm64: dts: apple: t7001: Add CPU PMU nodes
>> arm64: dts: apple: s800-0-3: Add CPU PMU nodes
>> arm64: dts: apple: s8001: Add CPU PMU nodes
>> arm64: dts: apple: t8010: Add CPU PMU nodes
>> arm64: dts: apple: t8011: Add CPU PMU nodes
>> arm64: dts: apple: t8012: Add CPU PMU nodes
>> arm64: dts: apple: t8015: Add CPU PMU nodes
>>
>> Documentation/devicetree/bindings/arm/pmu.yaml | 6 +
>> arch/arm64/boot/dts/apple/s5l8960x.dtsi | 8 +
>> arch/arm64/boot/dts/apple/s800-0-3.dtsi | 8 +
>> arch/arm64/boot/dts/apple/s8001.dtsi | 8 +
>> arch/arm64/boot/dts/apple/t7000.dtsi | 8 +
>> arch/arm64/boot/dts/apple/t7001.dtsi | 9 +
>> arch/arm64/boot/dts/apple/t8010.dtsi | 8 +
>> arch/arm64/boot/dts/apple/t8011.dtsi | 9 +
>> arch/arm64/boot/dts/apple/t8012.dtsi | 8 +
>> arch/arm64/boot/dts/apple/t8015.dtsi | 24 +
>> arch/arm64/include/asm/apple_m1_pmu.h | 3 +
>> drivers/perf/apple_m1_cpu_pmu.c | 807 +++++++++++++++++++++++--
>> 12 files changed, 871 insertions(+), 35 deletions(-)
>> ---
>> base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
>> change-id: 20250211-apple-cpmu-5a5a3da39483
>>
>> Best regards,
>> --
>> Nick Chan <towinchenmi@gmail.com>
>>
>>
next prev parent reply other threads:[~2025-06-16 10:35 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 1:31 [PATCH RESEND v7 00/21] drivers/perf: apple_m1: Add Apple A7-A11, T2 SoC support Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 01/21] dt-bindings: arm: pmu: Add Apple A7-A11 SoC CPU PMU compatibles Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 02/21] drivers/perf: apple_m1: Only init PMUv3 remap when EL2 is available Nick Chan
2025-07-14 15:11 ` Will Deacon
2025-07-14 15:37 ` Nick Chan
2025-07-17 15:16 ` Will Deacon
2025-06-16 1:31 ` [PATCH RESEND v7 03/21] drivers/perf: apple_m1: Support per-implementation event tables Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 04/21] drivers/perf: apple_m1: Support a per-implementation number of counters Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 05/21] drivers/perf: apple_m1: Support configuring counters for 32-bit EL0 Nick Chan
2025-07-14 15:12 ` Will Deacon
2025-06-16 1:31 ` [PATCH RESEND v7 06/21] drivers/perf: apple_m1: Support per-implementation PMU startup Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 07/21] drivers/perf: apple_m1: Support per-implementation event attr group Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 08/21] drivers/perf: apple_m1: Add Apple A7 support Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 09/21] drivers/perf: apple_m1: Add Apple A8/A8X support Nick Chan
2025-06-16 1:31 ` [PATCH RESEND v7 10/21] drivers/perf: apple_m1: Add A9/A9X support Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 11/21] drivers/perf: apple_m1: Add Apple A10/A10X/T2 Support Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 12/21] drivers/perf: apple_m1: Add Apple A11 Support Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 13/21] arm64: dts: apple: s5l8960x: Add CPU PMU nodes Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 14/21] arm64: dts: apple: t7000: " Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 15/21] arm64: dts: apple: t7001: " Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 16/21] arm64: dts: apple: s800-0-3: " Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 17/21] arm64: dts: apple: s8001: " Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 18/21] arm64: dts: apple: t8010: " Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 19/21] arm64: dts: apple: t8011: " Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 20/21] arm64: dts: apple: t8012: " Nick Chan
2025-06-16 1:32 ` [PATCH RESEND v7 21/21] arm64: dts: apple: t8015: " Nick Chan
2025-06-16 9:36 ` [PATCH RESEND v7 00/21] drivers/perf: apple_m1: Add Apple A7-A11, T2 SoC support Ian Rogers
2025-06-16 10:29 ` Will Deacon
2025-06-16 10:44 ` Ian Rogers
2025-06-17 14:16 ` Will Deacon
2025-06-17 16:28 ` Ian Rogers
2025-06-17 16:47 ` Marc Zyngier
2025-06-17 16:53 ` Ian Rogers
2025-06-16 10:35 ` Nick Chan [this message]
2025-07-14 15:12 ` Will Deacon
2025-07-14 15:59 ` Nick Chan
2025-07-17 15:05 ` Mark Rutland
2025-07-17 17:00 ` Nick Chan
2025-07-18 15:01 ` Mark Rutland
2025-07-18 20:45 ` Nick Chan
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=efa79e01-fb73-4808-8506-677ba45e43a1@gmail.com \
--to=towinchenmi@gmail.com \
--cc=alyssa@rosenzweig.io \
--cc=asahi@lists.linux.dev \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=irogers@google.com \
--cc=j@jannau.net \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@linaro.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=maz@kernel.org \
--cc=neal@gompa.dev \
--cc=robh@kernel.org \
--cc=sven@kernel.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).