Skip to content

kboot_gpu: publish the T6041 (M4 Max) GPU resources - #68

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
AxxzyWasTaken:t6041-gpu-resources
Nov 6, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
AxxzyWasTaken:t6041-gpu-resources

Conversation

@AxxzyWasTaken

@AxxzyWasTaken AxxzyWasTaken commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Adds the GPU handoff for T6041 (M4 Max). dt_set_gpu() handles T6040, but on T6041 it stops at "unsupported chip".

The T6041 GPU driver (linux#525) runs a static profile per loaded firmware build. So this only publishes what differs between units and boots:

  • the operating points, one voltage per cluster (4 clusters, 16 states, from /arm-io/sgx perf-states)
  • the CS and AFR tables
  • the six UAT and firmware regions, from the same ADT properties and to the same /reserved-memory paths as T6040
  • apple,firmware-version

It never powers or reads the GPU. It runs only when the device tree has an enabled apple,agx-t6041 node, and leaves a tree that keeps the GPU off alone. It validates everything before writing, and on anything unexpected it disables the GPU and any region it already published.

Testing

  • New host test tests/python/test_t6041_gpu_fill.py (24 cases): runs the fill on the tables and regions of a 32-core J616C ADT. test_t6040_gpu_fill.py still passes.

  • Ran the fill on two real J616C DTBs, with that ADT's values:

    • linux#914's J616C tree with linux#917, which enables the GPU on the shared T604x nodes with four-cell operating points
    • #525's t6041-j616c.dts, with &gpu set to okay (#525 keeps it disabled)

    Both get the same regions, which match what the GPU driver uses on this machine today, the 16×4 operating points and the 8-entry CS/AFR tables.

  • Builds with ESP_STAGE2=1 CHAINLOADING=1; clang-format clean.

  • Booted once on a 32-core J616C, on top of aura#67, with #914's tree, #917 and a 7.3 T6041 25G83 driver. The GPU firmware started from this handoff. On the same stack, Hyprland ran on the G17 driver with Mesa aurora-wip, vkmark on Wayland kept the fragment engine busy (checked in fdinfo), and Sober (x86, through FEX) reached Roblox's home screen, with no recoveries in about 2.5 minutes. No game has been played on it yet. For daily use, this machine still runs an older out-of-tree loader that hands over the same ADT regions.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train review (aura, M4-series): the change reads well and CI is green, but the commit(s) have no Signed-off-by: line, and a DCO sign-off is a hard requirement before we can merge a contributor's commit. We can't add one for you. Could you amend with git commit -s --amend (or git rebase --signoff origin/main for several commits) and force-push the branch? I'll pick it straight back up.

🤖 Generated with Claude Code

The T6041 GPU driver runs a static profile per loaded firmware build,
so the loader only provides what differs between units and boots: the
operating points with one voltage per cluster (four on T6041), the CS
and AFR tables, the UAT and firmware regions, and the OS firmware
version. The regions come from the same ADT properties as on T6040 and
reuse its device tree paths.

Nothing is powered or read on the GPU. The fill runs only when the
device tree enables an apple,agx-t6041 node, validates everything
before writing, and disables the GPU (and any region it published) on
anything unexpected.

The host test runs the fill on the tables and regions of a 32-core
J616C.

Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Signed off and force-pushed. No code change.

@RyanTheTide
RyanTheTide merged commit f147d14 into aurora-silicon:main Nov 6, 2026
8 checks passed
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge train (MTR, 06/11): reviewed. dt_set_gpu_t6041() runs only for chip_id == T6041 with an enabled apple,agx-t6041 node. It validates every ADT table before writing and disables the GPU and its regions on anything unexpected. T6040 keeps its own path, and test_t6040_gpu_fill.py still passes. CI is green, including the new 24-case host test. The hardware proof is the author's J616C boot of the G17 driver from this handoff.

@DjDeveloperr DjDeveloperr mentioned this pull request Nov 7, 2026
sithglan added a commit to sithglan/aura that referenced this pull request Nov 9, 2026
…bisection, census

Bisecting the trap delay that holds off the guest's stall (AURA_TRAP_DELAY_NS)
by trap class: GEXIT only gives aurora-silicon#9 xbt samples, guarded ERET aurora-silicon#6, IMPDEF ops
aurora-silicon#5, everything but GEXIT aurora-silicon#68, sysreg traps alone aurora-silicon#68 (t106-t110, baseline
aurora-silicon#5-6). A census of the guarded world's sysreg traps (AURA_SYSREG_CENSUS, t112)
shows SPTM's entry read of s3_6_c15_c11_1 at ~1.2 million traps a second and
a set of EL2 controls written a few thousand times in 20 s, around each cL4
call; delaying only those rare ones gives aurora-silicon#7 (t115). AURA_TRAP_DELAY_MASK
selects the classes; the entry read is its own class.

Among those EL2 controls is CPTR_EL2: SPTM writes 0x3300000 (FP and SME on)
before cL4 runs and 0x0 on the way back, so that XNU's next FP access traps
and gets XNU's own registers back -- lazy FP switching. aura kept the write
in the shadow, so XNU ran on with cL4's SIMD registers. Under E2H XNU's
CPTR_EL2 is the physical CPACR_EL1, so SPTM's write now lands there (ZEN,
FPEN, SMEN, TTA; the EL2-only bits stay in the shadow) and its reads see it
(AURA_CPTR_LIVE=0 restores the shadow). t114 boots as before with it; it did
not move the stall.

MDCR_EL2 and HACR_EL2 writes are logged once per distinct value.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
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.

2 participants