Skip to content

arm64: keep MTE off on Apple SoCs without reserved tag storage - #1639

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
fix/apple-mte-tag-storage-guard
Nov 12, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
fix/apple-mte-tag-storage-guard

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

The MTE tag store on Apple SoCs is unreserved until the aura change lands. Until a loader reserves it, this keeps MTE off on those chips.

Measured on the M5 Pro (J714s, T6050, 64 GiB):

  • iBoot keeps dram-size / 32 at the top of the RAM it hands over as the tag store: ADT carve-out region-id-218 = [0x10f4a500000, 0x10fca500000), 2 GiB. Its base goes in TagOffset_EL2 (S3_0_C11_C9_0, [41:20], lock in bit 63).
  • aura gives that range to Linux as RAM. node 0: [mem 0x10003b40000-0x10fca4effff] covers it, and NODE_DATA and the SWIOTLB are allocated inside it. With MTE on, the kernel writes tags there, starting with the zero page's at boot. Every M5 boot so far has carried arm64.nomte.
  • Distribution boots go aura → U-Boot → GRUB → EFI stub. The stub replaces /chosen/bootargs with GRUB's line (drivers/firmware/efi/libstub/fdt.c). A fresh image's first boot runs the command line baked at image build, so neither the loader nor a distro template can add arm64.nomte to that boot.

Change (arch/arm64/kernel/pi/idreg-override.c): the early ID-register code applies the arm64.nomte alias when all three hold:

  • the root is compatible with apple,arm-platform;
  • ID_AA64PFR1_EL1.MTE >= MTE2;
  • no /reserved-memory child is compatible with apple,mte-tag-storage.

Other platforms, and Apple SoCs without MTE2 (M1 to M4, A18 Pro), return before the DT is read. The aura change, aurora-silicon/aura#184 (draft), adds a no-map mte-tag-storage@<base> node with that compatible and ends /memory at the base. With it, this override no longer applies.

Build check:

  • intg3's tree (447b752). arch/arm64/kernel/pi/idreg-override.c is identical there and at integration/aurora 3d7100c.
  • The build ran on a private overlay of intg3's output (CONFIG_ARM64_MTE=y, clang 23.1.1).
  • arch/arm64/kernel/pi/ builds with no warnings, and idreg-override.pi.o passes relacheck.
  • The new __pi_fdt_node_check_compatible, __pi_fdt_first_subnode, __pi_fdt_next_subnode and __pi_fdt_path_offset references are defined in lib-fdt.pi.o / lib-fdt_ro.pi.o.
  • checkpatch: 0 errors. Its one warning is the From/Signed-off-by name mismatch.
  • Not run on hardware yet. The Image relink is queued.

🤖 Generated with Claude Code

On Apple SoCs with MTE (T6050 and T8142), iBoot keeps 1/32 of DRAM at
the top of the RAM it hands over as the MTE tag store and programs
TagOffset_EL2 (S3_0_C11_C9_0) with its base. On a 64 GiB J714s (T6050)
that is 2 GiB at [0x10f4a500000, 0x10fca500000). No ADT or DT property
names the range, and the boot loader (aura) currently gives it to Linux
as normal memory. With MTE on, the kernel writes tags into that range,
which is memory it uses, starting with the zero page's tags at boot.

Until the loader reserves the tag store, these chips need arm64.nomte on
every boot. Distribution boots go through U-Boot and GRUB, where the EFI
stub replaces the bootargs the loader sets, so the loader cannot add it.

Apply the arm64.nomte override from the early ID-register code when the
root node is compatible with "apple,arm-platform", the CPU reports MTE2
or later, and /reserved-memory has no node compatible with
"apple,mte-tag-storage". A loader that reserves the store adds that
node, and the override no longer applies. Other platforms, and Apple
SoCs without MTE, are unchanged. Through the same override, the MTE
fields of ID_AA64PFR2_EL1 (MTEFAR, MTESTOREONLY) are hidden too, so
userspace sees none of MTE's parts while it is off.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr force-pushed the fix/apple-mte-tag-storage-guard branch from 59d88cf to 42a362b Compare November 12, 2026 12:34
@DjDeveloperr DjDeveloperr reopened this Nov 12, 2026
@DjDeveloperr DjDeveloperr reopened this Nov 12, 2026
@DjDeveloperr
DjDeveloperr merged commit 107b361 into integration/aurora Nov 12, 2026
1 of 2 checks passed
@RyanTheTide
RyanTheTide deleted the fix/apple-mte-tag-storage-guard branch November 16, 2026 05:06
RyanTheTide added a commit to aurora-silicon/fedora-aurora that referenced this pull request Nov 19, 2026
44-37 added arm64.nomte with grubby on T6050 and T8142 Macs, because no
boot loader reserved the MTE tag storage. That is no longer a chip
property for userspace to track:

- the kernel (7.3.0-37, aurora-silicon/linux#1639) applies the nomte
  override itself on an Apple platform whose CPU reports MTE2 and whose
  /reserved-memory has no apple,mte-tag-storage node;
- aura 1.0.0~b13 (aurora-silicon/aura#184) adds that node.

So the posttrans no longer adds anything, and a one-shot triggerpostun
on the update from 44-41 or older removes the argument. grubby
--update-kernel=ALL wrote it to every BLS entry, GRUB_CMDLINE_LINUX and
/etc/kernel/cmdline; --remove-args with ALL takes it out of all three.
aurora-platform now requires those kernel and aura floors.

Based on DjDeveloperr's 44-39 change in this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RyanTheTide added a commit to aurora-silicon/alarm-aurora that referenced this pull request Nov 19, 2026
20261018-17 added arm64.nomte to GRUB_CMDLINE_LINUX on T6050 and T8142
Macs through /etc/default/grub.d/45-aurora-mte.cfg, because no boot
loader reserved the MTE tag storage. That is no longer a chip property
for the distribution to track:

- the kernel (linux-aurora 7.3.0.aurora1-37, aurora-silicon/linux#1639)
  applies the nomte override itself on an Apple platform whose CPU
  reports MTE2 and whose /reserved-memory has no apple,mte-tag-storage
  node;
- aura 1.0.0b13 (aurora-silicon/aura#184) adds that node.

Drop the fragment and depend on those floors. The grub hook keeps the
fragment as a target, so with a Remove operation (alarm-aurora#287) its
removal regenerates grub.cfg at once; without it the next kernel update
does.

Based on DjDeveloperr's 20261018-18 change in this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RyanTheTide added a commit to aurora-silicon/nixos-aurora that referenced this pull request Nov 19, 2026
The GRUB install step appended arm64.nomte to every linux line on T6050
and T8142 Macs, because no boot loader reserved the MTE tag storage. That
is no longer a chip property for the distribution to track:

- the kernel (aurora-silicon/linux#1639, in the pinned 9125b314) applies
  the nomte override itself on an Apple platform whose CPU reports MTE2
  and whose /reserved-memory has no apple,mte-tag-storage node;
- aura 1.0.0b13 (aurora-silicon/aura#184, pinned 5dcf62d0) adds that node.

Drop the step. grub.cfg is rewritten on every switch, so the next switch
removes the argument from every generation, older ones included: their
kernels boot under the same aura, which reserves the store.

Based on DjDeveloperr's change in this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AxxzyWasTaken pushed a commit to AxxzyWasTaken/alarm-aurora that referenced this pull request Nov 21, 2026
20261018-17 added arm64.nomte to GRUB_CMDLINE_LINUX on T6050 and T8142
Macs (/etc/default/grub.d/45-aurora-mte.cfg), because no boot loader
reserved the MTE tag storage then. Two merged changes now make the
argument moot on the T6050:
- aura 1.0.0b13 (aurora-silicon/aura#184) reserves the tag storage as a
  no-map apple,mte-tag-storage node, or adds arm64.nomte itself when a
  check fails;
- linux-aurora 7.3.0.aurora1-37 and later (aurora-silicon/linux#1639)
  keep MTE off by themselves on an Apple SoC with MTE whose device tree
  has no such node.

The fragment now adds arm64.nomte only on the T8142 (M5), which has had
no MTE trial. 95-aurora-grub.hook already regenerates grub.cfg when the
fragment changes, so the update itself takes the argument off a T6050's
boot entries. aurora-boot depends on aura>=1.0.0b13 and
linux-aurora>=7.3.0.aurora1-37.

This is the owner's T6050 policy for the M5 Pro deep-sleep Edge release
(2026-11-20): MTE on. The broader draft aurora-silicon#288 drops the fragment on every
chip; this one keeps it on the T8142.

Signed-off-by: Diljit Singh <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sioodmy pushed a commit to sioodmy/nixos-aurora that referenced this pull request Nov 22, 2026
The GRUB install step (boot.loader.grub.extraInstallCommands) appended
arm64.nomte to every linux line on T6050 and T8142 Macs, because no boot
loader reserved the MTE tag storage then. Two merged changes now make
the argument moot on the T6050:
- aura 1.0.0b13 (aurora-silicon/aura#184) reserves the tag storage as a
  no-map apple,mte-tag-storage node, or adds arm64.nomte itself when a
  check fails;
- the pinned kernel (aurora-silicon/linux#1639) keeps MTE off by itself
  on an Apple SoC with MTE whose device tree has no such node.

The step now matches the T8142 (M5) only, which has had no MTE trial.
NixOS rewrites grub.cfg on every switch, so a T6050's next switch drops
the argument from every generation; older generations boot under the
same aura on the ESP, which reserves the store.

This is the owner's T6050 policy for the M5 Pro deep-sleep Edge release
(2026-11-20): MTE on. The broader draft aurora-silicon#280 removes the step for every
chip; this one keeps it on the T8142.

Signed-off-by: Diljit Singh <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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