Repository navigation
tools/aurora-sep: mesa-m3: bound and harden the system-Mesa handoff - #2156
DjDeveloperr merged 10 commits into
Conversation
Keep qualified native /usr Mesa usable when the legacy mesa-m3 hook is still installed. Admit only J613/T8122 and J516S/T6030 after display, render-node, journal, user-setup and previous-login checks, followed by a bounded no-draw EGL device/context and implementation-path check. Keep kernel recovery flags and all failed admissions on the existing fallback. Preserve active legacy profiles and their attempt markers. Add host refusal controls and document the remaining packaged login test. Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com> Signed-off-by: Scott Jones <scottajones@gmail.com>
The handoff probe runs in a clean environment against /usr, but the desktop keeps the session's own setup. Under --system-provider, also refuse an LD_LIBRARY_PATH entry that holds its own libEGL, libGLESv2, libGL, libGLX, libglapi or libgbm, treat a relative entry as unknown, and refuse GBM_BACKEND, __GLX_VENDOR_LIBRARY_NAME and the Mesa GL/GLES/GLSL version overrides. The legacy gate keeps its existing rules. Run the whole admission in its own sh under one 20-second timeout, so a stalled journal, home directory or scanner refuses and keeps the software fallback instead of holding the login. Run the handoff cases under the suite's own shell so the bash run covers the new path, add stall and override cases, document that the helper does not render and that a later failure is not recorded, and bump pkgrel to 7 with the new checksums. Signed-off-by: Marcelo Alcantara <maralc@gmail.com> Signed-off-by: Scott Jones <scottajones@gmail.com>
glibc also splits LD_LIBRARY_PATH on ";" and reads an empty entry as the current directory, so ":", "/a:" or "/a;/b" could still hide another provider from --system-provider. Split on both and treat a real empty entry as unknown. A reference to the previous value still counts as no entry. Signed-off-by: Marcelo Alcantara <maralc@gmail.com> Signed-off-by: Scott Jones <scottajones@gmail.com>
A placeholder for $LD_LIBRARY_PATH hid the current-directory entry that
"/a:$LD_LIBRARY_PATH" or "${LD_LIBRARY_PATH}:/a" leave when the inherited
value is unset or empty. For --system-provider, expand plain references
with the inherited value and ${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} as the
shell does, treat any other form as unknown, and ignore a wholly empty
value as glibc does.
Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
An earlier file can unset LD_LIBRARY_PATH, so its inherited value does not
show what "/a:$LD_LIBRARY_PATH" expands to. For --system-provider, take a
plain reference as empty, accept ${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} and
its ${...} spelling, keep spaces in an entry as glibc does, and treat only
a truly empty value as no entry.
Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
"${LD_LIBRARY_PATH}/x" or "/a$LD_LIBRARY_PATH" name a directory the
detector cannot see, so for --system-provider a reference counts only when
it stands alone between separators; anything else is unknown. Take the
environment's own value literally, and keep the legacy gate's parsing
exactly as it was.
Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
…pend
"${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" with nothing before it expands to
":/prev", a current-directory entry, so for --system-provider a conditional
append needs an entry before it. Do not expand ~ or $HOME in the
environment's own value either; glibc does not.
Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
Bash accepts NAME+=VALUE in POSIX mode, but the scanner only recognizes NAME=VALUE. A late uwsm export such as LIBGL_ALWAYS_SOFTWARE+=1 therefore passes the system-provider check before selecting software rendering. Report tracked append assignments as unknown in system-provider mode, keeping the software recovery path. Leave the default legacy scanner unchanged. Exercise Bash's actual result and the complete handoff under both shells, and bump the package release with its updated checksum. Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com> Signed-off-by: Scott Jones <scottajones@gmail.com>
|
Blockers: 2.
HW row: the boot evidence predates the last three commits, and the description says the packaged login test is still open. On a J613 with this package installed and the file opt-out set, run a Hyprland login. The journal should show "system Mesa on /usr admits /dev/dri/renderD128 (t8122)". A client in the session should report the native renderer from /usr/lib. Then add an LD_LIBRARY_PATH entry holding a libEGL and a Assisted-by: LLM (Claude:Opus 5.5) |
|
The system Mesa handoff checks are still needed. This head replays cleanly onto integration/aurora |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at verified live head 9a847af26982b20c1ca93aac251b4d597aab11eb (not superseded on integration/aurora; live CI 7/7 green: host-tests, source, rust-build, kunit, DWC3/ATC ×3).
Technical Audit
- Provider &
LD_LIBRARY_PATHhardening (mesa-m3-user-setup,mesa-m3-session-env,PKGBUILD): Clean. glibc-style:/;splitting, empty/relative entry refusal, safe${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}handling, BashNAME+=VALUEunknown detection, bounded 20 s / 5 s timeouts, and updatedPKGBUILDsha256sumsall verify against the modified files. - Model/board gating (
mesa-m3-session-env,mesa-m3-system-check.c): Blocked under §1 (see below).
Checklist Summary
- §1 No model gating: FAIL (Blocker).
- §2 Production-ready, no hacks: PASS — bounded timeouts are defensive login guards; default kernel cmdline and
mesa_m3=off/nomodesetrecovery are preserved. - §3 Safety: PASS — fails closed to the existing software fallback on every error/timeout path.
- §4 Clean-room & attribution: FAIL (Blocker).
- §5 Evidence: FAIL (Blocker).
- §6 Naming: PASS —
HK_DEBUG_LOGinmesa-m3-user-setupis solely for detecting/refusing the legacy env var already exported by/opt/mesa-m3.
Blockers
- §1 Hardcoded board allowlist and exact renderer-string gate:
tools/aurora-sep/recipes/mesa-m3/mesa-m3-session-env(_mm3_system_admit) restricts admission tot8122:apple,j613:apple,t8122andt6030:apple,j516s:apple,t6030.tools/aurora-sep/recipes/mesa-m3/mesa-m3-system-check.crepeats the exact board allowlist (board_compat_matches()) and requires exactGL_RENDERERequality ("Apple M3 (G15G C0)"/"Apple M3 Pro (G15S B1)").- This strands other Macs with the same GPU block (e.g., J615, J514s, J504) on software fallback even when
/usrMesa works. Since the hook and helper already verify the singleasahirender node matchingapple,agx-<soc>, the matching native display card, and/usr/lib/provenance oflibEGL_mesa/libgallium/asahi_drivia/proc/self/maps, drop the board allowlist and exact stepping renderer table (refuse software renderers such asllvmpipe/softpipeinstead).
- §4 Attribution in commits and PR body:
- Commits
b4226f6cca9band9a847af26982contain aGenerated-by: LLMtrailer. Per §4, git commits must carry human author/committer identity and humanSigned-off-by:only, with zero AI trailers. - Replace the PR body footer (
🤖 Generated with [Claude Code]...) with a plainAssisted-by:line at the end of the PR body.
- Commits
- §5 Packaged login evidence on live head:
- The stacked boot evidence predates the final three fix-up commits (
0cc902a6..9a847af2), andSYSTEM-HANDOFF.mdnotes a packaged login test has not yet been run. Please post a packaged Hyprland login run on affected hardware with the opt-out file set (confirmingsystem Mesa on /usr admits ...and native/usr/librenderer), negative refusal checks (LD_LIBRARY_PATHholding alibEGL,LIBGL_ALWAYS_SOFTWARE+=1), and the §5 regression line (0 SELinux denials, 0 failed units, 0 new kernel errors).
- The stacked boot evidence predates the final three fix-up commits (
Verdict
REQUEST_CHANGES — blocked on §1 model gating, §4 commit/PR attribution cleanup, and §5 packaged login evidence.
Assisted-by: LLM (Gemini 4 Neon)
9a847af to
b2e162f
Compare
The system handoff admitted only the J613 and the J516S, and the helper required the exact renderer strings "Apple M3 (G15G C0)" and "Apple M3 Pro (G15S B1)". Other boards with the same GPU (J615, J504, J514S, and the J433 and J434 iMacs) and other steppings stayed on the software fallback even when /usr Mesa works, as review pointed out. Key the admission on the SoC instead. The device tree must name exactly one board and exactly one SoC, and the SoC must be T8122 or T6030; the existing checks then apply as before: the single asahi render node is apple,agx-<soc>, the native display is apple,<soc>-display-subsystem, and the loaded EGL and gallium libraries come from /usr/lib. The helper accepts the renderer only when it names the admitted SoC's chip and GPU, with any stepping: "Apple M3 (G15G " on T8122 and "Apple M3 Pro (G15S " on T6030. That prefix also rules out llvmpipe, softpipe, swrast, lavapipe and zink, which stay refused by name as well. Without a board table the hook can no longer tell that a board belongs to another SoC; the GPU and display checks are keyed on the SoC compatible instead. The board and session tests move J615, J504 and J514S to admitted, keep two boards, two SoCs and no board refused, and add renderer controls: each SoC's GPU at any stepping is accepted, and the other SoC's GPU, an M2 (G14G), an M3 Max (G15C) and software renderers are refused. The PKGBUILD checksums follow the two sources. Signed-off-by: Scott Jones <scottajones@gmail.com>
6956443 to
8913443
Compare
The system Mesa admission required the render node's platform driver to be "asahi". That name is not the only one the M3 GPUs get: - On the 7.3 kernels the driver is "aurora" (2d76bce); "asahi" is only its module alias. On an M3 Air running 7.3.0, a real SDDM to uwsm Hyprland login with /etc/mesa-m3/disable: the admission stopped at the driver check, and the journal showed decision=inactive with no admission line. - A kernel built with the native G15 backend (CONFIG_DRM_ASAHI_G15, set in asahi.config) binds the T6030 to that backend's own platform driver: "asahi-g15" on 7.2.11, "aurora-g15" on 7.3. The admission refused every M3 Pro on those kernels. On those three drivers the refusal only changed the record. The software fallback matches only "asahi", so those sessions already kept the system Mesa (fallback=none). What was missing is the state file's and journal's admission detail ("system Mesa on /usr admits ..."). Accept "aurora", "aurora-g15", "asahi" and "asahi-g15" in _mm3_system_admit() only. mesa-m3-system-check still decides whether /usr drives the GPU. The software fallback (_mm3_node_open()) and the render-node udev rule stay keyed on "asahi", and the hook's header comment and the rule's comment say so. They exist because the pre-7.3 kernels' legacy M3 path refuses the system Mesa. On "aurora" the system Mesa drives the M3 Air's GPU (that login rendered "Apple M3 (G15G C0)" from /usr). The helper's J516S validation in SYSTEM-HANDOFF.md, on a 7.2.11 kernel named "-g15", returned "Apple M3 Pro (G15S B1)" from /usr. Widening them would move those sessions from hardware rendering to software, and lock the node to the render group. No M3 Pro has run 7.3 yet. The session test admits the system Mesa with "aurora" on both SoCs and with "asahi-g15" and "aurora-g15" on the T6030 (these cases fail on the previous commit). It also pins that nothing falls back to software on those drivers: a failed admission, near-miss "aurora-x" and "asahi-g15x" drivers, the default T8122 session (experimental) and a T6030 the /opt/mesa-m3 profile cannot use. pkgrel goes to 9 so an upgrade replaces the installed -8, and the PKGBUILD checksums follow the hook and the rule's comment. SYSTEM-HANDOFF.md now says that the software fallback and the mesa_m3=off recovery apply to "asahi" nodes only. Signed-off-by: Scott Jones <scottajones@gmail.com>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: HOLD at c628edbfd5fd
Blockers:
- §4, PR body: the body ends with
Assisted-by: Claude:claude-opus-5-5. Please delete that line. The checklist, aligned with policy on 11-24, now bans AI attribution everywhere, PR bodies included. Our review at9a847af2asked you to add anAssisted-by:line, so that request was wrong under the current rule and you can ignore it. The ten commits are clean: human authors, committer Scott Jones, humanSigned-off-byon each, and noGenerated-byor other tool trailers. - §5, evidence at the head: the boot rows come from a kernel built "before the last four commits, including the SoC admission change". That leaves
89134432(SoC admission) andc628edbf(driver namesaurora/aurora-g15/asahi-g15) without a hardware run. Please post one packaged Hyprland login atc628edbfwith the opt-out file set, on a 7.3 (aurora) kernel. The J613 is enough if a J615 or J514S is not available. The run should show:system Mesa on /usr admits ...in the state file and journal, with the/usr/librenderer;- the two refusals (an
LD_LIBRARY_PATHentry that holds its ownlibEGL, andLIBGL_ALWAYS_SOFTWARE+=1); - the regression line: 0 SELinux denials, 0 failed units, 0 new kernel errors.
- §5, PR body: please switch the body to the org template (
What:/Tested:/Risk:/Not yet:).Tested:should name the Mac, kernel, head SHA and result;Risk:should say two-way door and list the T8122/T6030 boards. The body is also stale in two places:- "The last commit keys admission on the SoC" is now
89134432; the last commit is the driver-name change, which the body does not describe. - The base is listed as "integration/aurora", but this PR targets
main.
- "The last commit keys admission on the SoC" is now
Checked:
- Prior blockers:
- §1 board allowlist: resolved. The hook and
board_compat_matches()now accept any single board, require exactly one SoC compatible, and key the GPU and display checks on that compatible. The renderer check is now a chip+GPU prefix with any stepping, and software and layered renderers are refused by name as well. - §4 commit trailers: resolved.
- §5 head evidence: still open (blocker 2).
- §1 board allowlist: resolved. The hook and
- §1: what remains is the T8122/T6030 scope and the per-SoC renderer prefix. I accept both. They match the hook's existing
_mm3_soc_ofscope, since the legacy package exists only for these two GPUs, the SoC comes from the DT, and the commit gives the reason. Non-blocking: once a released kernel carries a DT/sysfs GPU identity, the prefix could come from that instead. - §2: no new cmdline or parameters. The 20 s and 5 s timeouts are refuse-on-stall guards, not retries.
- §3: fails closed on
asahinodes. Onaurora/*-g15, a failed check changes only the record. Nothing on those drivers is newly refused or newly falls back, andSYSTEM-HANDOFF.mdsays so. The software fallback and the udev rule stay keyed onasahi. - §6: no Honeykrisp or hk in prose; the one
HK_reference is an existing env var that the check refuses. - Code: POSIX
shandbashsyntax OK. The driver-namecaseis exact, and the tests cover near misses (aurora-x,asahi-g15x). ThePKGBUILDchecksum and pkgrel bump match the changed sources. - Overlap with linux#2367 (open): it deletes only
mesa-m3/tests/{build-checks.sh,late-load.c,tls-pad.c}, which are duplicates. This PR does not touch them, andPKGBUILDuses the root-level copies. No conflict either way; the recipe stays active onmain. - Mergeability:
MERGEABLEagainstmain; merge stateBLOCKEDby the review and CI. - CI at
c628edbf: still running. Green so far:pr-text,source, DWC3/ATC builtin-no-atc and modular-no-atc. Pending:host-tests,kunit,rust-build, DWC3/ATC builtin-modular-atc, readiness.
Evidence
- Live PR state read right before posting: OPEN, not a draft, head
c628edbfd5fdfa5c244c010a7150c49b9896adaf. - File diff between
9a847af2andc628edbfacross all ten touched files: the board/SoC admission, thenative_renderer()prefix check, the driver-namecase, comments in the udev rule, the hook andSYSTEM-HANDOFF.md, pkgrel 8→9 with three checksums, and the new session and board tests. - Host run of the recipe tree at the head (light, host only):
test-system-board.c(cc -std=c11 -Wall -Wextra -Werror -pedantic): "18 board parser and 19 renderer controls passed".test-session-env.shundersh: ALL PASS (232 ok).test-system-provider.py: OK;test-user-setup.shandtest-udev-rule.sh: ALL PASS. The bash run oftest-session-env.shwas not finished locally; CIhost-testscovers it.
- Commit hygiene: checked all 10 commits for author, committer and
Signed-off-by. Grepping the touched files for attribution strings found nothing.
|
Hardware run at c628edb on a J613 (M3 Air, T8122), 7.3.0 kernel with the
This is the run that was blocked at 8913443 on the driver name. The Mac was restored to its stock package set afterwards. |
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approved at c628edbfd5fd. Checked the recipe diff, host tests, CI (8/8 green), and the exact-head J613 packaged login row (admit + both refusal cases + 0 failed units / 0 new kernel errors / 0 GPU faults). Cleaned up the PR body to match the template and target branch. Thank you for the contribution.
Follow aurora-silicon/linux main (integration/aurora no longer exists) at 4a42f31, which brings in #3133 (T8112 DCP on firmware 27.2). Retire, each merged upstream and in this intake: aurora-silicon/linux#2145 as 6f84f56 aurora-silicon/linux#2150 as 15b1e2e aurora-silicon/linux#2152 as 8bd4942 aurora-silicon/linux#2153 as a2801d4 aurora-silicon/linux#2154 as 90d3f11 aurora-silicon/linux#2156 as dff34de aurora-silicon/linux#2199 as d51160c aurora-silicon/linux#2147, closed in favour of #3114 (merged as e8d93e4, in this intake) j613-touchid-data-ready, superseded by aurora-silicon/linux#2678 (merged as 3777510), which describes the same line for the J613 and J615 in t8122-j613-j615.dtsi Update remaining carries: - #2146, #2148, #2149 and #2151 re-pinned to their main-merged PR heads (carried via merge = true). - #2155 pinned to ad63582 (last reviewed commit before #2155 rebased onto the post-4a42f3105002 IIO API change in #3473; adds the describe-by-role follow-up). - #3490 (merged on integration/aurora-7.3 in #529) re-pinned cleanly to upstream 717a6ff..e6e8509, dropping the 00cbc67 rebase commit d98f2a8. - #370 replaced by merged upstream aurora-silicon/linux#3770 (6b8d44f + 9dab09e, adding the D0 sleep quiesce/resume fix for BCM4388 s2idle). - #3607 now carries all three commits including KUnit tests in drivers/bluetooth/hci_bcm4377_test.c (present in 4a42f31). - xart-pin-7.3 note updated (#486 open, #506 closed). Based-on-work-by: Satya Benson <satya@benson.earth> Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
What: Bound and harden the
mesa-m3system-Mesa handoff recipe (tools/aurora-sep/recipes/mesa-m3/): allow checked/usrMesa after a file opt-out, refuse hidden providers, parseLD_LIBRARY_PATHlike glibc, refuse unresolved Bash append overrides, key admission by SoC (T8122 or T6030) and GPU renderer prefix rather than a fixed board list, and admit the 7.3auroraand native G15 (asahi-g15/aurora-g15) drivers in_mm3_system_admit().Tested:
c628edbfd5fdfa5c244c010a7150c49b9896adafon J613 (M3 Air, T8122), 7.3.0 kernel withauroraGPU driver, SDDM autologin to Hyprland:mesa-m3 26.1.4.m3.2-9admits/usrMesa (fallback=none,GL_RENDERER=Apple M3 (G15G C0)), refusesLD_LIBRARY_PATHoverride andLIBGL_ALWAYS_SOFTWARE=1, with 0 failed units, 0 new kernel error kinds, and 0 GPU fault lines.test-system-provider.py,test-system-board.c,test-session-env.shunder sh/bash,test-user-setup.sh,test-uwsm.sh,test-udev-rule.sh) and GitHub CI (8/8 checks) pass atc628edbf.Risk: Two-way door. Scoped to the
tools/aurora-sep/recipes/mesa-m3Arch recipe and its tests on M3/M3 Pro (T8122/T6030). Failed admission keeps the software fallback on legacyasahinodes and leavesaurora/ G15 sessions untouched; recovery ismesa_m3=offor removing the opt-out file.Not yet: Packaged login check on a T6030 (M3 Pro) board running 7.3 (post-merge check).