From: Nick Chan <towinchenmi@gmail.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>, 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: Sat, 19 Jul 2025 04:45:58 +0800 [thread overview]
Message-ID: <2b69fbd1-067e-4ff4-8ea4-88e32763209a@gmail.com> (raw)
In-Reply-To: <aHph5u4-b6mfggPv@J2N7QTR9R3>
Mark Rutland 於 2025/7/18 夜晚11:01 寫道:
> On Fri, Jul 18, 2025 at 01:00:45AM +0800, Nick Chan wrote:
>> On 17/7/2025 23:05, Mark Rutland wrote:
>>> On Mon, Jul 14, 2025 at 11:59:36PM +0800, Nick Chan wrote:
>>>> Will Deacon 於 2025/7/14 夜晚11:12 寫道:
>>>>> On Mon, Jun 16, 2025 at 09:31:49AM +0800, Nick Chan wrote:
>>>>>> Patch 8-12 adds support for the older SoCs.
>>>>> ... but I'm not sure if anybody actually cares about these older SoCs
>>>>> and, even if they do, what the state of the rest of Linux is on those
>>>>> parts. I recall horror stories about the OS being quietly migrated
>>>>> between CPUs with incompatible features, at which point I think we have
>>>>> to question whether we actually care about supporting this hardware.
>>>> The "horror" story you mentioned is about Apple A10/A10X/T2, which
>>>> has a big little switcher integrated into the cpufreq block, so when the
>>>> cpufreq driver switch between states in the same way as on other
>>>> SoCs, on these SoCs that would silently cause a CPU migration. There
>>>> is only one incompatible feature that I am aware of which is 32-bit EL0
>>>> support.
>>> Surely the MIDR/REVIDR/AIDR also change?
>> They do not change. ID_AA64PFR0_EL1 also does not change (fixed 0x12).
>> What *does* change however is MPIDR. (P-cores has bit 16 set while
>> E-cores do not)
> The MPIDR changing isn't ok either. You might get away with that today,
> but that's not supposed to change behind the back of the kernel.
>
> Is there anything else that can change, or are we absolutley certain
> that *only* MPIDR changes?
Only MPIDR changes, and the state of bit 16 in MPIDR is consistent across all PEs. (At any
given moment, either all PEs are backed by efficiency cores, or all backed by performance
cores)
>
>>>> As mentioned above, it does all work fine when CONFIG_EXPERT is not
>>>> enabled, and if it is enabled, then 32-bit process may crash with illegal
>>>> instruction but everything else will still works fine.
>>> I don't think that's quite true, unless these parts are also violating
>>> the architecture.
>>>
>>> If the CPU doesn't implement AArch32, then an ERET to AArch32 is
>>> illegal. The way illegal exception returns are handled means that this
>>> will result in a (fatal) illegal execution state exception being taken
>>> from the exception return code in the kernel, not an UNDEF being taken
>>> from userspace that would result in a SIGILL.
>> Speaking from experience, when testing with the userspace cpufreq governor,
>> trying to run AArch32 code on the ecores really does result in illegal
>> instruction for that process while everything else remains fine.
>>
>> Referencing ID_AA64PFR0_EL1, the E-cores does claim to support
>> AArch32 EL0, even though they could not execute it for real.
> Ok, so that's a clear violation of the architecture, and doesn't fill me
> with confidence about anything else.
Regarding this, the hardware also needs to handle the case where the PE is already in AArch32
EL0 and migration to E-cores is attempted. In this case there is no exception return happening so
the behavior of the hardware is not as bad as it sounds.
>
>>> I do not think that we should pretend to support hardware with silent
>>> microarchitectural migration. So at the very least, we do not care about
>>> A10/A10X/T2.
>> As explained above, what actually happens on the hardware is different
>> from what you believed, so please do reconsider.
> Different certainly, but still problematic.
>
> I maintain that we should not pretend to support this hardware.
>
> Mark.
>
Nick Chan
prev parent reply other threads:[~2025-07-18 20:46 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
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 [this message]
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=2b69fbd1-067e-4ff4-8ea4-88e32763209a@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=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).