Skip to content

soc: apple: sep: select the platform profile by SoC - #2311

Closed
RyanTheTide wants to merge 2 commits into
integration/aurorafrom
sweep/soc-gates-sep
Closed

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
sweep/soc-gates-sep

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

drivers/soc/apple/profile.rs:697-720 (0abc2f3) chose the SEP platform profile on T8122, T6040, T6041, T6050, T8132 and T8142 only for the boards it had been tried on: J613, J615, J614s, J616s, J614c, J616c, J714s, K116s, J716c, J713, J715, J813 and J815. Any other board with the same SoC got no profile, so it had no SEP and no Touch ID. The profile itself holds only SoC facts: SEP shared memory and handshake, the DART window, and the SPI controller the SoC wires to the sensor. The list started in 64ff4f1 and grew one board per commit.

Change

  • select() picks the profile by the SoC compatible alone. T8103, T8112, T6000/T6001, T6020/T6021 and T8140 already work this way.
  • detect() returns no profile when the device tree has no apple,sep node. Module init then logs that the SEP stays disabled, as it does today, and does not fail on the missing node. This matters for the T8142 J704, whose dts does not describe the SEP yet.
  • enable_sep_and_dart() leaves the SEP and its DART disabled when the board keeps the SEP mailbox disabled. With the profile picked by SoC alone, boards such as J773s, J575c, J716s, J775c, J873s and K114s now get a profile, but their device trees describe no usable enclave. Most trees leave the SEP node and its DART disabled for the warm attach to enable, so only the mailbox status says whether a board has one. Without this check the module would enable the SEP and its DART at load on those boards.
  • KUnit: the selection test now checks that the board compatible does not change the result. The Touch ID test covers J504, J614c, J715, J604, J716s, K116s, J704, J813 and J815 as well.

A board without a built-in sensor (Mac mini, Mac Studio, iMac) has nothing on the sensor's SPI bus. The sensor probe finds no part, and the SEP runs without biometrics, as on the M1 and M2 Mac minis.

The profiles were written by Scott Jones (T8122), Michal S. (J614s), Artyom Astafurov and Jos Dehaes (T6041), Diljit Singh (T6050), Jens Axboe (K116s), Erik Bourget (J713, J716c) and Nick (T8142).

Testing

  • Build, release config, LLVM, CONFIG_APPLE_SEP_KUNIT_TEST=y: make drivers/soc/apple/ builds apple-sep.o, including the KUnit tests. No warnings in the changed file. The Rust warnings in bio.rs, key.rs, control.rs and store.rs were there before.

  • KUnit on arm64 QEMU (tools/testing/kunit/kunit.py run --arch=arm64 --kunitconfig=drivers/soc/apple/sep.kunitconfig 'apple_sep*', as in CI): 306/306 pass, including apple_sep_profile (8 subtests: selection_follows_the_soc, unprofiled_socs_are_refused). Host tests (tools/asahi/run-host-tests.py): 427/427 pass.

  • Compiled DTBs of this tree, SEP mailbox status per board on the SoCs that change: enabled on J614s, J616s, J614c, J616c, J714s, J716c, K116s, J433, J434, J504, J613, J615, J604, J623, J624, J713, J715, J773g, J813, J815; disabled on J773s, J575c, J714c, J716s, J775c, J775d, J873s, K114c, K114s, K116c; no SEP node on J704.

  • Hardware (one-shot test kernel 7.3.0-aurora-swl1 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):

    • T6040 J616s: 'SEP platform profile: T6040/J616s' as on the current kernel.
    • T6000 J316s: 'SEP platform profile: T6000/J316s' as on the current kernel. 3 s2idle cycles clean on both.

Still to run

  • J616s (T6040): dmesg | grep "SEP platform profile" shows T6040/J616s, the same as before. Touch ID enrol and verify still work.
  • Neo J700 (T8140), M1 Pro J316s (T6000), M2 J413 (T8112): this code path did not change. dmesg | grep "SEP platform profile" shows the same profile as before.
Boards newly reached (none in our lab)
SoC Boards Sensor
T8122 J504 built in
T8122 J433, J434 none (iMac)
T6040 J773s none (Mac mini; SEP mailbox disabled: SEP stays off)
T6041 J575c none (Mac Studio; SEP mailbox disabled: SEP stays off)
T6050 J714c, J716s, K114s, K114c, K116c built in (SEP mailbox disabled in the DT: SEP stays off)
T6050 J873s, J775c, J775d none (SEP mailbox disabled: SEP stays off)
T8132 J604 built in
T8132 J773g, J623, J624 none
T8142 J704 no apple,sep node, so no profile

Each of these boards includes the SoC dtsi with the same SEP, SEP DART and spi2 nodes as the boards on the old list. The mailbox check and the added KUnit cases come from #2439, which this PR supersedes.

Assisted-by: LLM (Claude:Opus 5.5)

On T8122, T6040, T6041, T6050, T8132 and T8142 the SEP profile was chosen
only for the boards it had been tried on (J613, J615, J614s, J616s, J614c,
J616c, J714s, K116s, J716c, J713, J715, J813, J815). Every other board with
the same SoC got no profile, and so no SEP and no Touch ID, although each
profile holds only SoC facts: the SEP's shared memory and handshake, its
DART window, and the SPI controller the SoC wires to the sensor.

Select by the SoC compatible, as T8103, T8112, T6000/T6001, T6020/T6021
and T8140 already are. A board without a built-in sensor has nothing on
that bus: the sensor probe finds no part and the SEP runs without
biometrics, as on the M1 and M2 Mac minis.

A device tree that does not describe the SEP at all (the T8142 J704 has
no apple,sep node yet) now gets no profile, so module init keeps saying
the SEP stays disabled instead of failing on the missing node.

The KUnit selection test now checks that the board compatible does not
matter, and the Touch ID list covers the boards this admits.

The profiles were written by Scott Jones (T8122), Michal S. (J614s),
Artyom Astafurov and Jos Dehaes (T6041), Diljit Singh (T6050), Jens Axboe
(K116s), Erik Bourget (J713, J716c) and Nick (T8142).

Fixes: 64ff4f1 ("soc: apple: sep: add a T8122 (MacBook Air M3) platform profile")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…disabled

With the profile picked by SoC alone, select() now also returns a profile
on boards whose device tree describes no usable enclave, and the warm
attach then enables the SEP node and its DART at module load. Most device
trees leave both disabled for that path, so their status cannot say
whether a board has an enclave.

The SEP mailbox's status does: the SEP cannot be reached without it, and
the device tree enables it (in the board file, or in the SoC .dtsi for
every board of that SoC) where the SEP is described for the machine.
enable_sep_and_dart() now leaves the SEP and its DART disabled when the
mailbox is disabled.

From the compiled DTBs of this tree: J773s (T6040), J575c (T6041), and
J714c, J716s, J775c, J775d, J873s, K114c, K114s and K116c (T6050) keep the
SEP mailbox disabled, so nothing is enabled or bound there. Every board
whose mailbox is enabled attaches as before.

The selection KUnit test also covers J773g, J815, K114s, J316s and J413,
and checks that SoCs without a profile (T6002, T6031, T8152) are refused.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@aeries0x

Copy link
Copy Markdown
Contributor

J604 read-only row (MacBook Pro 14", M4, Mac16,1; os-fw 26.6.2, system-fw 27.2; aura 1.0.0b13.1, U-Boot aurora11). Tested this PR's head b81e61bca81d on my J604 config plus a local revert of #1888 to keep the speakers off.

Loaded apple_sep manually read-only via insmod (xart_writes=0 provision_keybag=0 trusted_keys=0 filevault_api=0, with the packaged aurora-sep units masked for the boot):

  • SEP platform profile: T8132/J713/J715; 3aa600000.sep bound to apple_sep.
  • attach: 7 endpoints advertised in 18 messages (815 ms); ready in 2857 ms: 12 endpoints (cntl sbio scrd sse hdcp xars sks xarm hibe pnon skdl stac), key store open; hwrng registered.
  • xART read cleanly with writes disabled (170 slots, 12 live records, 0 malformed/duplicate/repaired); diag/policy confirmed all four parameters at 0, diag/xart = disabled, xarm_failures = 0, unhandled_messages = 0.
  • No SEP panic, timeout, or DART fault during a 60 s hold after load, and the reboot back into the installed kernel was normal. As in techmore's J773g row on soc: apple: sep: pick the platform profile by SoC; the board DT decides #2439, /var/lib/aurora-sep-host-state.bin (2.3 MB) was still created on the Linux root even with writes off.
  • Booted into macOS afterwards and tested Touch ID lock-screen unlock three times in a row with no issues.

Not tested: Touch ID sensor/enrol/match on Linux (sensor: unbound with provision_keybag=0), default writable parameters, or s2idle with SEP bound.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #2631: the same commits rebased onto current integration/aurora.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #2631, which carries this change on a current base. Branch kept.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Hardware row, Mac mini M4 (J773g, T8132), macOS 27.2 firmware: PASS (2026-11-20)

Kernel 7.3.0-m4drv8 (aurora 010c3eb base, the mini's current 27.2 bring-up kernel). This PR's two commits (5088a3c, b81e61b) were cherry-picked onto it; the only conflict was in the KUnit tables, resolved to this PR's side. Built as a module against that kernel and swapped live for the stock apple_sep, which logs no platform profile for this SoC; the SEP stays disabled on this board. The DT is unchanged: the J773g tree's sep_mbox is enabled, and the warm attach enables sep and sep_dart.

  • SEP platform profile: T8132/J713/J715. The SEP DART changeset applied (offset BIT(40), range 0..4 GiB).
  • xART is found in the iBoot container: 12 live records, 0 malformed, 0 repaired, writes enabled. Guard level 1 protects the 10 macOS session records; 0 refusals.
  • Attach took 831 ms: 7 endpoints advertised. Ready in 3155 ms with 12 endpoints (cntl sbio scrd sse hdcp xars sks xarm hibe pnon skdl stac); key store open; identity keybag provisioned.
  • hwrng apple-sep registered; trusted key type registered.
  • There is no built-in sensor on this board: diag/sensor stays unbound and nothing probes on the sensor bus, as the PR describes for desktops.
  • A second load on the same boot is refused with -16 ("reloading the driver is not supported"), as designed.

One cosmetic point: since the selection is by SoC now, the profile name T8132/J713/J715 shows on boards that aren't J713/J715. Maybe just T8132?

The Magic Keyboard with Touch ID row for #1810 on this mini is pending: the keyboard was unplugged on this boot.

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.

3 participants