Skip to content

m1n1: Resident EL3 PSCI for A7-A9, on by default - #102

Open
brkosebay wants to merge 4 commits into
OrchardLinux:mainfrom
brkosebay:j71t/psci
Open

brkosebay wants to merge 4 commits into
OrchardLinux:mainfrom
brkosebay:j71t/psci

Conversation

@brkosebay

@brkosebay brkosebay commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Part 1 of 11 of the iPad 5 (J71t) series in this repository; merge it first.

How to merge

This is the first of the 11 PRs of this series that are still open; each body says which PR it follows. They were brought onto main as of 8ea3182 (after #101, #108, #110, #111, #118, #121, #122, #124, #126 and #127 were merged and #123 and #128 closed) by merge commits only, so every branch is a fast-forward of what you reviewed. Each branch contains the one before it. Merging them in order with "Create a merge commit" is clean at every step in a simulation against that main, and a PR's "Files changed" view shrinks to its own change once the PR before it is merged. Landing a PR on its own, as you have been doing, works too: I then merge main into the branches after it, fast-forward only. Parts that were left out of merged PRs and that warm restart or suspend need are in #107 and #117, as their own commits.

Problem

A7-A9 have no EL2 and boot without any PSCI firmware, so Linux on an iPad 5 could not bring secondary CPUs down and up again, and a kexec had nowhere to park them. CPU hotplug, kexec and a clean poweroff all need a PSCI implementation that stays resident after m1n1 hands over.

Change

Carry m1n1 patches that keep a small EL3 PSCI implementation resident: CPU_ON/CPU_OFF with a firmware rendezvous (EL1 WFI/WFE trap to EL3), SYSTEM_OFF, and a guarded SYSTEM_RESET that boots the default entry again. The loader marks retained hardware in the device tree after a PSCI re-entry. The resident PSCI is on by default on these SoCs; the shipped boot framing keeps psci_reset=0, so SYSTEM_RESET stays off unless a loader enables it. Adds boot/m1n1/psci-loader and its tests.

Testing

  • Hardware: iPad 5 Wi-Fi (J71t). Hands-on testing on 2026-11-11 with an integrated build of this series, made before the final failure-path fixes, covered secondary CPU hotplug and warm restart.
  • Not covered on hardware: PSCI SYSTEM_RESET, which is disabled in the shipped framing (psci_reset=0) and has never been qualified on this device; that work continues after this series.
  • 2026-11-12: the release build ran with the shipped framing (psci=1 psci_reset=0), and the 20+ warm restarts that day (kexec, which parks and restarts the secondary CPUs through the resident PSCI) completed without a freeze.
  • Host: the Linux test suite passes at this branch's head, and the kernel and m1n1 patch series apply on apple-16k and apple-4k. At the top of the series the applied kernel tree differs from the built release image only where main took earlier PRs of this series in reworked form, by the closed perf: apple: A9 memory port byte counters #123, and by the new G5P sleep refusal (drivers/drm 0045, not yet run on the device).
  • Other boards that share these drivers or compatibles have not been tested.

Dependencies

None; based on current main.

This update keeps the branch's history: it merges current main and the updated branch below it into this branch. Nothing is forced.

🤖 Generated with Claude Code

Bring this branch onto current main. The merge keeps the other side's
tree; the next commit carries the reworked version of this branch's
change.
A7-A9 have no EL2 and boot without any PSCI firmware, so Linux on an
iPad 5 could not bring secondary CPUs down and up again, and a kexec had
nowhere to park them. CPU hotplug, kexec and a clean poweroff all need a
PSCI implementation that stays resident after m1n1 hands over.

Carry m1n1 patches that keep a small EL3 PSCI implementation resident:
CPU_ON/CPU_OFF with a firmware rendezvous (EL1 WFI/WFE trap to EL3),
SYSTEM_OFF, and a guarded SYSTEM_RESET that boots the default entry
again. The loader marks retained hardware in the device tree after a
PSCI re-entry. The resident PSCI is on by default on these SoCs; the
shipped boot framing keeps psci_reset=0, so SYSTEM_RESET stays off
unless a loader enables it. Adds boot/m1n1/psci-loader and its tests.

Assisted-by: LLM
@brkosebay brkosebay changed the title Optional resident m1n1 EL3 PSCI m1n1: Resident EL3 PSCI for A7-A9, on by default Nov 12, 2026
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122,
OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or
reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic,
main's version is kept; the left-out parts that warm restart and
suspend need come back in OrchardLinux#107 and OrchardLinux#117.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant