Skip to content

drm/asahi: m3: run the M3 (T8122 G15G) GPU on the macOS 27.2 firmware - #2781

Draft
RyanTheTide wants to merge 22 commits into
integration/aurorafrom
j615gpu/g15g-272
Draft

RyanTheTide wants to merge 22 commits into
integration/aurorafrom
j615gpu/g15g-272

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On an M3 MacBook Air booted from a macOS 27.2 volume, the boot chain loads the 27.2 GPU firmware (InitData family 26B123). The m3 runtime only knows 14.8.3 and 26.6.2, so it refuses the GPU. There is no render node, and GNOME falls back to software rendering, which makes the desktop very slow.

Change

  • Read the three-segment (version 2) firmware handoff that aura publishes for 27.2.
  • Add the 27.2 interface as a third firmware profile. Only the admitted image selects it: no parameter, no global, no board check. It covers the 26B123 InitData objects and words, the 60-slot register map, the power images, the start sequence and the wider work records. 14.8.3 and 26.6.2 behave as before (same RTKit operations, PMP link and encodings).
  • The FastDie target and the crash-copy buffer size come from the ADT, through the boot loader (aura). If either is missing, the 27.2 GPU is not started.
  • Admit the T8122 C0 27.2 image by its measured TEXT hash, its layout and the InitData version it accepts.
  • Start the T8122 runtime, and register its render node, where the boot loader hands the GPU over (the firmware description it puts on the GPU node), instead of on a fixed board list. T8122_BOARDS and Soc::validated_boards are gone.
  • Pick the T8122 PMP wait by the supplier PMP's compatible instead of of_machine_is_compatible("apple,t8122").

It carries #2147 unchanged, merged in as the first commit, because without its RAM-adoption fix the probe fails with -12. The three review points raised on #2147 are fixed here in separate commits: the J504 base_edid KUnit check (commit 2), the board list (commit 9) and the machine-compatible PMP wait (commit 8). So this PR can land on its own, with #2147's commits and authorship kept. The GPU node is enabled on 27.2 by aurora-silicon/aura#448, which also exports the two ADT values. Without that aura change, the GPU stays disabled as it is today.

Testing

On a J615 (M3 Air 15", 10-core G15G C0, macOS 27.2 firmware), with the default fleet command line and no module parameters:

  • Head d1eb3e07 on the fleet79-derived J615 test kernel (7.3.0-aurora-g15g272c, source b329fce53908a2ba6384f8326de8a3963b117741; the last two commits have the same stable patch IDs as here), with the saved Stage 2: GPU firmware ready at 1.562 s, renderD128, GNOME on the GPU, all six firstlight stages passed (10-minute soak, GPU die peak 69.8 C, 0 GPU crashes), glmark2 terrain 47 FPS, vkmark 1997. The boot had 0 SELinux AVCs, 0 failed units, 0 oops, and exactly the same set of error-level kernel messages as the saved J615 default.
  • The 27.2 changes on the fleet79-derived J615 test kernel (source c1e39c94c63a9df90e2d4e61811320cbfe000807) passed all six firstlight stages and ran at 47 FPS in glmark2 terrain. A boot of that kernel with Stage 2 f413294d96b76fbbad4dfc9445cfaf87e5de4592 started the GPU at 1.548 s and created renderD128. That boot had 0 SELinux AVCs, 0 failed units, 0 oops and 0 new kernel errors against the saved J615 default.
  • Earlier head of this series, same Mac, its default boot since 2026-11-22: GPU ready at 1.6 s, GNOME on the GPU (Borealis 'Apple M3 (G15G C0)'), deqp-vk smoke 9/9, GLES3/EGL smoke 33/33, glmark2 1697 / vkmark 1917, 10-minute soak clean, GPU die peak 66 C, s2idle 2/2 with the GPU bound.
  • Host tests on d1eb3e07: full bounded host suite 458/459. The one failure is the existing PMP-floor class-twice mutation fixture: GCC 16.1.1 under -Werror rejects the injected variable, and the fixture is unchanged by this PR. The queue-priority test that failed CI at 13cfe7a5, the G15 zero-word tests, the PMP supplier tests (34/34 variants) and the m3 tests pass. Earlier head: m3 runtime 89/89, m3 firmware 23/23, batching 12/12, stamp 3/3, test-m3-power 5/5 (two 26B123 tests: moves, positions, machine values, state word, refusals), m3 uapi/mailbox/stamp-admission pass.

Still to run

  • J613 (M3 Air 13") and J504 (M3 MacBook Pro) hardware rows. On the kernel side a J504 now takes the same path as soon as its boot loader hands the GPU over. The aura side still selects the T8122 GPU handoff by board; a separate aura change will select it from the ADT.
  • PPM budget: the power-image budget word is the existing 26.6.2 builder's value (on integration/aurora since 32ad468), carried unchanged to the 27.2 positions. The J615 ADT gives the GPU PPM gains and filter time but no budget, and the OPP powers are the boot loader's model. A machine-sourced budget (or a supported way to leave the controller off) should replace the literal for both firmware versions. It is not introduced here.
  • Deep sleep (s2r) with the GPU busy.
  • A full dEQP-GLES3 run and a wider Vulkan CTS subset on this firmware.
  • Two deterministic GPU faults from the CTS sweep on the J615 default (with this series): dEQP-VK.spirv_assembly.instruction.graphics.float16.logical.opfordequal_vector_geom (VK-GL-CTS 1.4.7.1, first run, one process) and a 500-case KHR-GL46 sequence ending at KHR-GL46.shader_storage_buffer_object.basic-operations-case2-cs (that case alone passes). Both end in a failed job, and the M3 backend then fails every later job until reboot. Recovery after a job fault is not part of this series; the fault cases need a root cause.
  • Per-job latency (gpubench, not a correctness item): a light compute job costs about 390 us per submit at queue depth 8, against about 17 us on the MacBook Neo (Linux and macOS alike), while heavy GPU work runs at the expected speed. About 260 us of that is between publishing a job and seeing it complete, and deeper queues do not hide it. The numbers are in the details below; the follow-up belongs in a separate PR.
    Follow-up: drm/asahi: m3: let queued compute submissions share a firmware batch #2849 lets queued compute submissions share a firmware batch. On this J615 that takes compute.light at depth 8 from 395 to 174 us per submit, with 0 firmware errors and CTS compute unchanged. The completion-poll backoff and the firmware idle-off standby were measured and ruled out.
Per-job latency numbers (J615, gpubench ae90a40, fleet kernel carrying this head)
  • compute.light at depth 8: 395.6 us per submit, GPU time 10.6 us, gap between jobs 386 us. Mesa recording plus submit is 7 + 27 us.
  • Debug-flag split (dev boot with M3PassTiming, compute.light): publication to observed completion has a median of 260.6 us (p10 219, p90 421) for a 182 ns shader. Kernel retire plus the next publish is 46 us or less. In GPU ticks the jobs start 7.3 us apart, so the GPU timestamp does not advance during the wait.
  • The runtime compute batch override at 1/4/8 makes no difference (389 us). Render pipeline depth 1/2/4 gives 600/500/428 us per submit for render.light tri at depth 8. Compute is never pipelined.
  • With 8 processes, render.light tri takes 7.1 ms per submit (625 us with 2 processes), because a render batch is only extended for the same VM.
Where each 27.2 value comes from
value source
object sizes (main 0x2788, Globals 0xe4c, power 0x698, control 0xedd0, performance 0x6c48), the runtime's performance pointer at +0x479, the FirmwareData words +0x1e0, the main/Globals/performance runs, the 60-slot map positions, +0xfa0/+0xfa8 and the retention pointer at runtime +0x2c8, the power-up words at performance +0x9c..+0xa8, the host block zero order the G16 26B123 layout (#2676, V26B123): G15 26.6.2 and G16 25G83 share the same records, and G15 27.2 and G16 26B123 share the same InitData family
consumed-generation word = last u64 of the control object (0xedd0 - 8) as on 26.6.2, where the m3 code reads it at 0xeae8 of the 0xeaf0 object
InitData root version 0x0c8a836f039404b8 measured on the J615. With this version the image comes up. With the G16 26B123 version (0x0c8a836f039204b8), with 0x0391/0x0393/0x0395 in the u16 where the two differ, or with the G15 26.6.2 version, the firmware faults right after the root is sent and never reports ready
shared3 state word at performance +0x62b4 = DT state count HwDataShared3 (unk_8 = HwConfig::shared3_unk, a performance-state index). The G14 27.2 path (#2544) fills the table of the same block at +0x62b8 in the same 0x6c48 object. T8122 has no shared3 table, so only the state word is set, above every state. If the whole block is left at zero, the firmware never takes the first device-control records
performance +0x2f34 = 1, +0x6ac8 = 1 set the same way by the G14 27.2 path in the same object
power-control image: the words the 26.6.2 builder writes (+0x10..+0x14c) at the same positions the existing 26.6.2 builder. If these words are left at zero, the GPU stays at its lowest clock: glmark2/vkmark score 14/254, against 46/1254 with them carried over under the same lab clock cap. Without the cap the GPU reaches state 7 under load
FastDie target, crash-copy size the ADT (gpu-fast-die0-target 88 C and coredump-copy-buffer 0x8000 on this J615), through aura
PPL magic version 3 as on G14/G16 27.2
start order (nothing staged before the root, IMPORT_GLOBALS + START behind one write update, no Register/Idle controls after) and no PMP link J615 runs. It differs from G16 26B123, which stages a NOP and posts the pair separately
TEXT hash 7406a568..f5, layout, GKTS/ECAP positions, RTKit 3514.41.1 measured on the J615, stable over three boots
Per-commit notes
  1. Merge drm/asahi: T8122: run the M3 runtime as on 7.2, and admit the J504 #2147 (carried unchanged).
  2. drm/apple: v14-board-test: drop the J504 base_edid check: drm/asahi: T8122: run the M3 runtime as on 7.2, and admit the J504 #2147 removes the field this test read.
  3. drm/asahi: m3: read the three-segment (version 2) firmware handoff.
  4. drm/asahi: m3: test the Extended interface through Profile::extended(): mechanical, no behaviour change.
  5. drm/asahi: m3: add the 27.2 (26B123) firmware interface: Profile::Extended27, keyed on Profile::v26b123(). Everything that is the same as 26.6.2 runs through Profile::extended().
  6. drm/asahi: m3: admit the T8122 C0 27.2 firmware.
  7. tools/asahi: follow the 27.2 interface in two host tests: pins the new hw.rs bytes and gives the queue-priority stand-in Profile the new variant (the CI failure at 13cfe7a5).
  8. pmdomain: apple: pmp-report: pick the T8122 GPU wait by the PMP's compatible.
  9. drm/asahi: m3: start the T8122 runtime where the boot loader hands the GPU over.

Assisted-by: LLM (Claude:Opus 5.5)

javanoo6 and others added 19 commits November 17, 2026 06:22
The J514S 14.7 boot chain can load a T6030 firmware build whose full TEXT
digest is not in the admission table. Probe refuses it and no GPU render
node is created.

Desktop use with the explicit prefix override reaches firmware READY and
reduces Hyprland CPU use from several cores to single-digit percentages.
Pin the complete measured digest only for J514S, with its segment sizes
and marker, rather than requiring a persistent bring-up override.

Exercise the production firmware table and exact lookup with the override
disabled. Reject other boards, altered digest suffixes, sizes and markers.

Link: omacom/linux-aurora#247
Signed-off-by: Nikita Konkov <95355711+javanoo6@users.noreply.github.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
The J514S cd05 FirmwareBuild row adds 15 lines to the T6030 firmware
table, which changes the pinned hw.rs file and t6030 module digests.
With that row removed both digests are their previous values, so the
T6030 profile itself is unchanged. Refresh the two pins and record why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
Some 16-inch M3 Pro (J516S) units on the 14.7 boot chain load a B0 GPU
firmware image whose TEXT digest differs from the pinned J516S row:
TEXT 0x5c000, DATA 0x114000, GKTS marker 0x58e88 and TEXT sha256
cd05af6a828b52e4c2fed20086d3d18a7db42e03a8fd6f8354f9f06e0a61363e. The
build is refused with "loaded GFX TEXT identity mismatch", so there is
no render node and the compositor falls back to llvmpipe. The GPU only
starts with the g15_accept_text_prefix bring-up override.

Add this build as a J516S-only row. Rows still pin on the machine they
name; nothing changes on the J514S or on other machines. Extend the
maintained-handoff host test to check the new row and refresh the
zero-words golden pins for hw.rs and the T6030 module, which change by
exactly this one row.

Measured on a J516S (apple,j516s apple,t6030; os-fw 14.7, system-fw
15.5, iBoot2 iBoot-10151.140.19.700.2) with linux-aurora
7.2.11.aurora14-1 and the override: the admission line reports the
identical sizes, marker and digest, and the GPU reaches READY with
renderD128 present.

Link: omacom/linux-aurora#247
Link: omacom/omarchy#17739
Signed-off-by: joel cristobal <joelcristobal97@gmail.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
Some 14-inch (J514S) and 16-inch (J516S) M3 Pro units on the 14.7 boot
chain load a third B0 GPU firmware image: TEXT 0x5c000, DATA 0x114000,
GKTS marker 0x58e88 and TEXT sha256
411833a7ded773feeac4a181552e3ff5582eaf4435f2dd8f620c1ed0b31df1b0. No
row pins it, so probe fails with "loaded GFX TEXT identity mismatch",
there is no render node and the compositor falls back to llvmpipe.

Three machines have reported it in issue omacom/linux-aurora#247, all on the 14.7 stub with
system firmware 26.6.2: a J514S and a J516S (both iBoot-10151.140.19.700.2,
mBoot-18000.161.10), which logged the identical sizes, marker and digest,
and a second 14-inch M3 Pro. With g15_accept_text_prefix=0x411833a7ded773fe
all three reached firmware READY with renderD128 present. The boot
chain matches the J514S cd05 reports, so the chain alone does not
select the image.

Add one row per board, J514S then J516S, so each pin still names the
machine it was measured on; nothing changes for other machines. Extend
the maintained-handoff host test: both boards pin to their own row with
the override disabled, other boards are refused, and an altered digest
suffix, TEXT or DATA size or marker is refused. Refresh the zero-words
golden pins for hw.rs and the T6030 module; with the two rows removed
both are their previous values.

Link: omacom/linux-aurora#247
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
Before the module's final activate() step, the G15 probe returned
-EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list.
activate() then runs the real probe through driver_attach(), but if that
probe fails for good, for example because the firmware is rejected, the
driver core does not take the device off the list. It stays in
/sys/kernel/debug/devices_deferred until the deferred-probe work next
runs, so anything that waits on that list keeps waiting.

Return -ENODEV instead. activate() already reprobes every unbound device
once MODULE_READY is set, and a device added later sees it set, so
nothing needs the deferred list to retry. The display and PMP waits
inside the real probe still return -EPROBE_DEFER.

g15-probe-init-tests.py now checks that every probe before activation
returns -ENODEV, and adds a mutant that defers again.

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>

(cherry picked from commit 6447458 on omacom/linux-aurora, omacom/linux-aurora#470)
[7.3 base: the probe-init test also runs with the G16 registration here, so
 its pre-activation probe count follows the registration order; the new
 mutant is added to this base's expected-failure table.]
…e M3 runtime

The 7.2 rebase replaced the T8122 14.x branch of
apple_pmp_report_wait_supplier_ready() with a T6030-only one, so on an M3
MacBook Air every GPU power vote returns -ENODEV even with the PMP
running. With the new hidden APPLE_T8122_GPU_PMP_LINK, which
DRM_ASAHI_M3_T8122 selects (as DRM_ASAHI_G15 selects
APPLE_T6030_GPU_PMP_LINK), wait for the unique T8122 report's display
request (DISP, reg 7) to be ready and acknowledged before AGX, as on the
7.1.12 kernel the runtime was qualified with.

The PMP graph and supplier host tests copy the dispatch, so they copy the
T8122 wait too, built off there; their mutations still target the T6030
path.

Generated-by: LLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
The supplier suite built apple_pmp_report_wait_t8122_14() only with
APPLE_T8122_GPU_PMP_LINK off, so every case returned at its first
check. Build it also as the M3 runtime does (T6030 and T8122 links on)
and run the T8122 graph: the unique, available report linked to this
PMP, with DISP (reg 7) acked, and its failures (machine, supplier and
report compatibles, a duplicate or disabled report, the apple,pmp shape
and identity, a missing, duplicate, disabled, incompatible or no-ack
DISP entry, the managed start and its readiness). With the link off, a
well-formed T8122 graph is refused.

Mutants cover the wait's config scope, compatibles, report checks,
readiness result and entry reference, and the dispatch's machine
scope in both directions.

Reported-by: Marcelo Alcantara <maralc@gmail.com>
Generated-by: LLM
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
The 14" M3 MacBook Pro (J504) runs the same T8122 DCP image as the M3
MacBook Airs (90F849E1-..., named by the J504 ADT), so the 14.x IOMFB
path can drive its panel once the boot loader hands the display over.
Its panel is the J514S mini-LED panel: 3024x1964 with 74 notch rows,
at 60 or 120 Hz.

Add a J504 record with that geometry, ProMotion allowed, bring-up
logging on, and this image's colour matrix methods. The panel level
block is not qualified on this board, so brightness stays closed, and
its swaps keep zero timestamps as on the Airs. Other T8122 Macs (the
J433 and J434 iMacs) still have no record.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
The J504 (14" M3 MacBook Pro) loads the same 14.8.3 G15G firmware image
as the M3 MacBook Airs (UUID DF697F05-..., TEXT 0x64000, from its ADT).
Move the T8122 board list into t8122_admission as T8122_BOARDS, add the
J504, and test the exact list on the host. Firmware identity, resource
admission, the performance-state cap and the thermal limit are
unchanged; the J504 starts at the same conservative cap (state 2) as
the Airs. The J433 and J434 iMacs stay unlisted.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
Give the J504 DCP its panel node (the J514S 14" mini-LED panel: 302 x
196 mm, 189 mm below the notch, 500 nits) and point the boot
framebuffer at it, as on the J613, so simpledrm and the DCP driver use
the same physical size.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
The J504 runs the J613's DCP image, whose panel level block (brightness
in nits) is qualified on the J613. Mark the J504 record panel_nits and
admit the J504 machine for it, with the KUnit and host tests.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
On 7.3 the M3 MacBook Air runtime adopts the firmware's UAT through
Uat::new_adopted_with_user_upper(), which always asks for a
write-combined mapping of the handoff and TTBAT regions. On these Macs
the boot loader leaves both regions in the kernel's memory map as
reserved RAM, and memremap() refuses a write-combined mapping of RAM:

  memremap attempted on ram 0x00000103fff70000 size: 0x4000
  aurora 292400000.gpu: probe with driver aurora failed with error -12

On 7.2 the same helper chose the mapping per region: write-back for
reserved RAM, write-combined for a carveout. Uat::new_adopted() still
does that on 7.3.

Add Uat::new_adopted_ram_with_user_upper(), which makes the same
per-region choice and keeps the caller's choice of user upper half, and
use it for the M3 runtime. The M4 caller keeps the write-combined
constructor; no other backend calls either.

Seen on a J613 with a 7.3 kernel on the m1n1 1.6.1.aurora23 handoff.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
DRM_ASAHI_M3_T8122 depended on DRM_ASAHI_G15 only because the T8122
runtime adopts the firmware's UAT with the G15 backend's handoff
helpers (g15::uat::Window and g15::memory_mode). Turning the M3 Air on
therefore also turned the G15 backend on for M3 Pro/Max.

Split the adoption out behind a hidden DRM_ASAHI_UAT_ADOPTION, selected
by both options:
- without G15, g15/adopt.rs builds only g15/{uat,regs,hw}.rs (no probe,
  no driver registration); what in them needs G15's Config or ADT
  (adopt(), Window::new, Regs::identity and the T6030/T6031 tables) stays
  under G15;
- the RAM helpers memory_mode needs move from g15/glue.c to
  g15/uat_glue.c, so the runtime doesn't take glue.c's display helpers;
- M3_T8122 now states its own dependency on APPLE_PMP, whose PMP votes
  the runtime calls directly (before, it was implied by nothing);
- the mmu and pgtable items the runtime uses (the adopted
  Uat, with_tracked_status, read_user and point-of-coherency cleaning)
  are built with UAT_ADOPTION instead of G15.

G15 selects UAT_ADOPTION, so every configuration that builds today is
unchanged: off, G15 only and G15 with T8122 give the same warnings as
before, and M3_T8122 alone now builds without warnings. The asahi-g15
selftest reads the helpers from their new file, and the g15-zero-words
test pins the new hw.rs (its separate T6030 table pin is unchanged).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>

(ported from commit 9dff537 on omacom/linux-aurora)
[7.3 base: G15 keeps this base's "default y" and selects the new option. The
 base builds what the runtime shares with G15 under "G15 or G16" and keeps
 the point-of-coherency cleaning unconditional, so the mmu and pgtable gates
 become "UAT_ADOPTION or G16" and gain no new #[cfg] on clean_poc. The
 module is aurora.ko here. g15-zero-words-tests pins hw.rs after the test's
 own normalisation. Built with G15 and T8122 (same warnings as before) and
 with T8122 alone: that builds, and none of its dead-code warnings is in
 g15/, m3/, mmu.rs or pgtable.rs. Not run on hardware.]
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The board record no longer has a base_edid member on integration/aurora, so
the J504 case from the T8122 runtime series stopped building once both met.
The remaining J504 checks are unchanged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On macOS 27.2 iBoot loads the M3's G15G firmware as __TEXT, __DATA and
a 32 KiB __DATA_SHARED_RO right after __DATA. The boot loader describes
that as apple,m3-handoff-version 2: three segment VAs, flags <1 0x10 0>,
and fw-data covering __DATA and the read-only tail.

Accept that description in the resource reader and record the size of
the read-only tail. Version 1 is unchanged. Nothing downstream admits a
version-2 image yet: no known firmware layout matches it, so the probe
still stops at the layout check, before any mapping.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The M3 (T8122 G15G) firmware that macOS 27.2 boots speaks the Extended
interface of 26.6.2 with the 26B123 InitData family: bigger objects,
moved words, a 60-slot register map, a different start and wider work
records. Add it as Profile::Extended27 next to Extended (26.6.2), taken
from the admitted image only (the next commit admits it): no module
parameter, no global, no board check. Every Extended path keeps running
for it through Profile::extended(); what differs is keyed on
Profile::v26b123():

- InitData objects: main configuration 0x2788, Globals 0xe4c, power
  0x698, firmware-data control 0xedd0 and performance 0x6c48 bytes; the
  runtime's performance-object pointer at +0x479 (16 bytes later); the
  firmware-control words 0x1e0 later; the consumed-generation word stays
  the last u64 of the control object; the root's InitData version.
- Power images: the 26.6.2 images moved by the 26B123 runs (the same
  InitData family as G16 26B123, see its V26B123 layout); the register
  map at its 26B123 positions (slots 0-7, 9-20, 22-24 keep their
  numbers, 26-43 move up five, the others have no position and are not
  mapped); main +0xfa0 empty and +0xfa8 the host crash-copy buffer size,
  with the retention table at runtime +0x2c8; the four power-up words at
  the performance object +0x9c (as G16 26B123); two performance-object
  words this family adds, +0x2f34 and +0x6ac8, 1 as the G14 27.2 path
  sets them in the same object; the words the 26.6.2 build writes in
  the power-control image (+0x10..+0x14c: average power, FastDie, PPM,
  SE enable) at the same positions (with them zero the GPU stays at
  its lowest clock; carried, it reaches its top states); real
  per-state values.
- Machine values: the crash-copy buffer size (apple,coredump-copy-buffer)
  and the FastDie target (apple,fast-die0-target) come from the boot
  loader, which copies them from this Mac's ADT; the FastDie release is
  the existing apple,fast-die0-release-temp. Without them the 27.2 GPU is
  not started.
- The performance object's shared3 block (HwDataShared3, at +0x62ac;
  the G14 27.2 path fills its table at +0x62b8): its state word
  (shared3_unk, a performance-state index) is set above every state,
  to the DT state count. With the block all zero the firmware never
  takes the first device-control records. T8122 has no shared3 table
  (shared3_tab is empty, as upstream), so the table stays as the 26.6.2
  build leaves it.
- Start: the host block at SGX+0xd60000 zeroed in the G16 26B123 order and
  its ready word raised before the endpoints start; nothing staged on
  device control before the root; the host log buffer (crash-copy size)
  on the crash-log endpoint; the root; the device-control doorbell; then
  IMPORT_GLOBALS (0x35) and START (0x0a) behind one write-index update
  with the SGX generation word, retired by the firmware, then READY. No
  Register or Idle controls follow. This is the order the J615 runs
  passed with; it differs
  from G16 26B123, which stages a NOP and posts the pair separately.
- No PMP link or vote on the 27.2 start (as on G16 27.2); the 26.6.2
  start keeps requiring its PMP supplier.
- RTKit: the 27.2 firmware places its own buffers; an operations type
  with COPROC_PLACES_BUFFERS serves only that profile, so 14.8.3 and
  26.6.2 keep today's RTKit behaviour.
- PPL: the 27.2 firmware exchanges PPL magic version 3.
- Work records: the binding generation of TA, fragment and compute
  commands is a u64 (completion, auxiliary and target fields +7), the
  compute command caches 0x8e0 bytes, and the queue-info header is 0x80
  with the scheduling context at 0x78 - the G16 25G83 -> 26B123 record
  deltas, which apply one for one since the G15 26.6.2 records equal the
  G16 25G83 ones.

Host tests: the 26B123 power images (moves, positions, machine values,
state word, refusals) in test-m3-power.py, and the 26B123 record encodings in
the m3 runtime tests.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Admit the T8122 C0 image the macOS 27.2 boot chain loads, on the 27.2
interface of the previous commit: its TEXT/DATA layout as the version-2
(three-segment) handoff gives it (TEXT 0x64000, DATA 0xb4000 plus
DATA_SHARED_RO 0x8000), its GKTS/ECAP-normalized TEXT hash, boot table
and RTKit version (measured on the J615, stable over three boots), and
the InitData version it accepts. That version was measured too: with it
the image comes up; with the G16 26B123 version, with 0x0391, 0x0393 or
0x0395 in the field where the two differ, or with the 26.6.2 version,
the firmware faults right after the root is sent and never reports
ready. apple,firmware-compat <27 2 0> from the boot loader selects
the candidate; admission is still the measured hash, the handoff and the
identity checks. There is no board check: every T8122 Mac that boots this
image gets it.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The 27.2 interface adds the PPL magic version 3 constant to g15/hw.rs and
a third interface profile, Extended27. Pin the new hw.rs bytes in the
G15 zero-words test (the T6030/T6031 tables are unchanged) and give the
queue-priority test's stand-in Profile the new variant and its
extended() helper, so both tests build the production code again.

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

apple_pmp_report_wait_supplier_ready() chose the T8122 14.x wait with
of_machine_is_compatible("apple,t8122"), and the wait repeated that
machine check next to the supplier check. The supplier's compatible is
what identifies this PMP, so dispatch on it instead: a supplier that is
an "apple,t8122-pmp-v2" takes the T8122 wait, every other supplier the
T6030 one, which keeps its own checks. The wait no longer looks at the
machine at all.

The host test follows: a T8122 PMP graph is now accepted whatever the
root compatible says, a T6031 supplier on a T6030 machine is still
refused, and the identity mutant keeps the supplier in use so it builds.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…e GPU over

The T8122 runtime started by default, and registered its render node,
only on a fixed list of boards (T8122_BOARDS: J613, J615, J504). The
list stood for "a Mac on which the boot loader runs the G15G firmware
for Linux". The device tree already says that: the boot loader puts its
description of the firmware it loaded (apple,m3-handoff-version and the
apple,firmware-segment-* properties) on the GPU node, and only when it
hands the GPU over. Resource admission already refuses a GPU node
without it.

Select the default from that description instead of the board list:
m3_board::handed_over() checks the GPU node for it, and the render-node
default (asahi.m3_expose=auto), the backend choice and the start
default (asahi.t8122_start omitted) use it. A T8122 Mac whose boot
loader does not hand the GPU over gets no render node and no start, as
an unlisted board did before; one whose boot loader does is admitted by
the same resource and firmware checks as the Airs.

Drop T8122_BOARDS, Soc::validated_boards and the test that pinned the
list. The 26.6.2 interface choice (profile_for) is unchanged.

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

Copy link
Copy Markdown
Contributor Author

Still needed: fix the host-tests failure (the Profile::extended() fixture), post the J615 rows on this head, and add J613 and J504 rows. It also carries #2147, which has to land first with its board list (T8122_BOARDS, t8122_admission.rs:11) replaced and its commits re-committed with a human Signed-off-by only, since several carry Co-Authored-By or Assisted-by trailers.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Adversarial review of d1eb3e07 (someone other than the author tried to break the 8 commits after the #2147 merge). Verdict: not ready, the PR stays draft. The hardware row on this head passes, but four problems remain that a row can't catch:

  1. FastDie on 27.2 still has guessed words. Only power +0xc8 gets the ADT target (88 C). The performance object keeps the 26.6.2 literals at +0x2270 and +0x22c4 (80 C and 110 C), moved to +0x2280 and +0x22d4. The release temperature in power +0xcc is the kernel default of 80, because apple,fast-die0-release-temp is not in the DT. On this J615 the ADT has gpu-fast-die0-target 88 and gpu-fast-die0-alarm-threshold 88, and no release value. So none of the 80/110 words has a machine source yet.
  2. The PPM budget is the 26.6.2 builder's 22044 literal, and this PR carries it to a new firmware path. With the board list gone, any T8122 whose boot loader hands the GPU over would get it.
  3. The 27.2 relocation drops 26.6.2 words. Performance 0x2d08..0x2f08 is in no run, so the ten-word block at 0x2e2c..0x2e78 is zero on 27.2. Main 0x25b4..0x2600, the 0xff block, is also zero. The host test doesn't check either range.
  4. Refusal order. The checks for missing apple,coredump-copy-buffer / apple,fast-die0-target run in Config::new. That is after the start latch, the ASC start and UAT adoption, so a boot loader that hands the GPU over without them gets a partial start instead of a clean ENODEV.

Next steps: (4), the crash-log page-count bound and the PMP-link message are local fixes. (3) needs the 27.2 positions of that block, from a public layout or a contained A/B on the J615 before it lands. (1) and (2) need machine-sourced values, or a firmware path that runs without them. Until then this stays draft, and the J615 keeps its current default.

Full findings (blockers, should-fix, what passed)

Blockers as above, with file:line: m3_power_26.rs:128 (budget), :229 (main 0xff fill), :331/:337 (perf FastDie literals), :400-409 (dropped perf block), :471-481 (run tables), :502-503 (power FastDie), hw/mod.rs:617 (release default 80), m3_runtime.rs:1064/1081/1098 (start latch, ASC start, Config::new).

Should-fix:

  • Crash-log message: pages << 44 overflows into the type field at the accepted maximum of 0x100000 bytes (m3_runtime.rs:1345). Bound it to the field width.
  • A fixed 2 ms sleep, and a 20 ms wait that continues silently on timeout (m3_runtime.rs:1348, :1362).
  • post_boot_pair_26b123 does not check that the ring is idle or that the index is in range.
  • shared_ro_size is recorded but never checked.
  • The host-test fixes in db72f0de arrive after the commits that need them (bisect). No history rewrite: this is noted for the merge.
  • No host test covers 27.2 profile selection, image admission, the InitData pointer graph or the early refusal.
  • On 27.2 a DT-named PMP link is ignored without a log line.

Passed: no new machine-compatible checks, board compares or board tables (the PR removes one of_machine_is_compatible and T8122_BOARDS). No regression found in the 14.8.3 or 26.6.2 paths. Commits carry human identity + Signed-off-by only. Merges cleanly on current integration/aurora.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial §1–§6 review at d1eb3e07413fc0fddc5b5b5af8e76e67287eb715: REQUEST_CHANGES (PR is Draft and not ready for MERGETRAIN-LINUX4).

What Passed Audit

  • CI: 8/8 checks green (dt-checks, host-tests, SEP source checks).
  • PMP wait dispatch (91f3950f, drivers/pmdomain/apple/pmp-report.c:703-751): Replacing of_machine_is_compatible("apple,t8122") with of_device_is_compatible(supplier->of_node, "apple,t8122-pmp-v2") removes a SoC gate cleanly. Ref-counting (of_node_get/of_node_put), unique-report checks, CONFIG_APPLE_T8122_GPU_PMP_LINK scoping (and Kconfig APPLE_PMP -> select APPLE_PMP_REPORT), and timeout/error propagation via apple_pmp_report_wait_ready() are sound. Non-T8122 SoCs (native25 / T6030 / T6031 / T8132 / T8140) keep their exact existing paths.
  • Bootloader handoff gating (d1eb3e07, m3_board::handed_over()): Dropping T8122_BOARDS / Soc::validated_boards in favor of SEGMENT_PROPS on the GPU node is the right §1 direction. Boards without a bootloader GPU handoff fail closed cleanly (expose_render_node = false, t8122_backend = false, start_for_board = Start::Off, and admit() refuses with -ENODEV). No regression on non-T8122 SoCs.
  • Ryan's 8 commits after Merge #2147: Human author/committer + human Signed-off-by: only, zero AI trailers; J615 default-cmdline hardware row passes cleanly.

Hard Blockers (§1–§5)

  1. §4 Clean-room & attribution — 11 carried #2147 commits contain forbidden AI trailers/co-authors:
    • Because #2147 is still OPEN (not merged into integration/aurora), Merge #2147 (22da1711) carries 11 commits with Co-Authored-By: Claude ..., Assisted-by: Claude:..., and/or Generated-by: LLM trailers (daec11fd, 35bf7a18, 147001c3, 24e790b1, 66f845e1, 3749fdbe, 1cb77d66, 4e742a9f, de895c58, 15c5d4d0, 98897fac). Under §4, commits must carry human identity and human Signed-off-by: only. #2147 must be cleaned up and landed separately first (or rebased cleanly without AI trailers in commits).
  2. §3 Safety — Hardcoded/guessed FastDie thermal limits & PPM power budget on the new 27.2 path:
    • FastDie (m3_power_26.rs:331, 337, 462, 502-503; hw/mod.rs:617): relocate_26b123() writes the ADT apple,fast-die0-target only into power +0xc8. The performance object still carries hardcoded 8_000 (80°C) and 11_000 (110°C) literals (relocated to +0x2280/+0x22d4), and pwr.fast_die0_release_temp falls back to a hardcoded kernel default of 80 in hw/mod.rs:617 when apple,fast-die0-release-temp is absent from DT (check_boot_loader_power does not require it). §3 forbids guessed thermal constants and fallback defaults.
    • PPM power budget (m3_power_26.rs:128, 235, 258, 290, 292, 297, 359): let budget = 22_044u32 is carried verbatim onto the new 27.2 path. With T8122_BOARDS removed, any T8122 Mac (fanless J613/J615 Air, fanned J504 MBP, or desktop J433/J434 iMac) whose bootloader hands over 27.2 firmware receives this hardcoded budget.
  3. §2 Correctness — Silent dropped ranges in relocate_26b123() (m3_power_26.rs:229, 400-409, 471-482):
    • main relocation skips 0x25b4..0x2600, silently zeroing the 0xff block written at main.0[0x25b4..0x25e4] (line 229).
    • performance relocation skips 0x2d08..0x2f08, silently zeroing the 10-word controller block written at 0x2e2c..0x2e78 (lines 400–409). Neither gap is checked by test-m3-power.py.
  4. §2 Production-ready — Magic sleep, silent timeout, and bitfield overflow in boot_26b123() (m3_runtime.rs:1344-1365):
    • Crash-log page-count overflow (m3_runtime.rs:1345-1346, m3_power_26.rs:465): relocate_26b123() admits crash_copy_bytes <= 0x10_0000 (256 × 4 KiB pages = 0x100), but (0x9u64 << 52) | (pages << 44) only has an 8-bit pages field (bits 44..51). Because bit 52 is already 1 in 0x9, pages = 0x100 silently wraps the encoded page count to 0 while preserving type 0x9! Bound crash_copy_bytes to the field width (<= 0xff000, or verify page-size unit).
    • Magic delay & silent timeout (m3_runtime.rs:1348, 1358-1364): Unconditional fsleep(Delta::from_millis(2)) over a race violates §2; the 20 ms udelay(5) busy-spin loop silently breaks on timeout and continues sending 0x0083_0000_0000_0010 instead of failing cleanly or sleeping/polling properly.
  5. §2 / §3 Refusal order (m3_runtime.rs:1064-1104, m3_config.rs:635-643):
    • Missing apple,coredump-copy-buffer or apple,fast-die0-target is only checked in ExtendedStorage::new() (Config::new at m3_runtime.rs:1098) — after FIRMWARE_START is permanently latched (claim_start at 1064), ASC is started (1081), RTKit endpoints are opened (1088–1091), and UAT/PPL v3 is adopted (1097). Validate these DT properties before latching or touching ASC (e.g., in Contents::extended() / admit()).
  6. §1 Model gating in carried #2147 commits & §5 Hardware evidence:
    • Carried #2147 commits add new board-gated entries not yet on integration/aurora (machine_is(ctx, "apple,j504") in iomfb_v14_7.c:1723, and per-board duplicate cd05/4118 rows in g15/hw.rs:177-240).
    • §5 hardware coverage is incomplete across affected boards: J615 (27.2) passes on default cmdline, but J613 (14.8.3/26.6.2/27.2), J504 (newly enabled by carried #2147 + d1eb3e07), and T6030 regression rows for the carried #2147 changes are still unrun. PR also remains a Draft.

Should-Fix / Non-blocking Items

  • m3_config.rs:483-502 (post_boot_pair_26b123): does not check that the ring is idle or w < SLOTS before writing ((w + 2) % SLOTS can also overflow u32 if w >= u32::MAX - 1).
  • agx_resources.rs:629 / m3_firmware.rs: Resources::shared_ro_size is parsed and stored for handoff v2 but never validated in Firmware::matching_layout() (so a v1 handoff with data_size == 0xbc000 and shared_ro_size == 0, or a wrong DATA/RO split, is not distinguished).
  • m3_device.rs:62-78: on 27.2 when the DT does carry apple,pmp, let pmp = has_pmp_link(pdev) && !v26b123; logs "M3: no apple,pmp link; GPU power is left to its power domain" — misleading when an apple,pmp property is present and intentionally bypassed.
  • tools/asahi/t6030-pmp-supplier-tests.py:49-50: CONFIGS tests (0,0), (1,0), (1,1) with a stale comment saying DRM_ASAHI_M3_T8122 depends on DRM_ASAHI_G15; commit 98897fac removed that dependency, so (0, 1) (T8122 without G15) should also be covered.
  • m3_runtime.rs:1323-1334: 12 consecutive stray blank lines above boot_26b123().
  • Bisectability: db72f0de fixes host-tests two commits after 92f63b4c; fold into 92f63b4c when preparing the non-draft series.
  • §6 Naming: carried #2147 commit 15c5d4d0 mentions m1n1 in its commit message (historical; Ryan's 27.2 commits properly use aura and Borealis).

Assisted-by: LLM (Gemini 4 Neon)

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.

5 participants