Repository navigation
rust: keep bindgen layout checks in every build - #607
Merged
RyanTheTide merged 1 commit intoOct 30, 2026
Merged
Conversation
Stock bindgen 0.73.2 drops the alignment of an explicitly aligned empty C struct. With CONFIG_SCHEDSTATS=n the empty, cacheline-aligned sched_statistics in task_struct loses its alignment, the following fields move, and Rust read a scheduler list pointer as task_struct.mm. The Asahi RSS charge then faulted in percpu_counter_add_batch. With --no-layout-tests the build gives no sign of this. Drop --no-layout-tests again so every Rust build checks the size, alignment and offsets bindgen emits, and select the corrected generator in tools/aurora-bindgen automatically when it has been prepared (also for O= builds). build.py now defaults to tools/aurora-bindgen/build and publishes build/bin/bindgen only after its compile tests pass. An explicit BINDGEN= still wins. The Fedora, Arch and NixOS kernel packages and the fleet recipe already build with the corrected generator. Drop the stale dead_code expectation on Device::parent(), which made the WERROR KUnit build fail once a driver uses parent() with AUXILIARY_BUS=n. Add the rust-build CI job that prepares the corrected generator and compiles the SEP module for arm64. The SEP ABI and recovery tests from aurora-wip stay there until the v5 enrolment ABI lands. This takes aurora-wip's b47f666, 7b563df, b18158c and 2706037, and the CI step from 5449640, and replaces the opt-in default from 4c56f9c. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Booted in fleet10 (7.3.0-aurora-fleet10) on the Neo, the M2 and the M1 Pro with no regressions; the shipping-recipe build with the fleet bindgen passed. Details in aurora-ctl reports/fleet10-20261030. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the bindgen layout assertions mandatory on integration/aurora again, as Ryan decided on 2026-10-30 (convergence item L7).
Stock bindgen 0.73.2 loses the alignment of an explicitly aligned empty C struct. With
CONFIG_SCHEDSTATS=n, the empty cacheline-alignedsched_statisticsshifts the followingtask_structfields, and Rust read the wrong pointer astask_struct.mm(a real fault inpercpu_counter_add_batch). With--no-layout-testsnothing flags it.What changes
rust/Makefileno longer passes--no-layout-tests;BINDGEN_LAYOUT_TESTSis gone.tools/aurora-bindgen/build/bin/bindgenwhen it has been prepared (also forO=builds). An explicitBINDGEN=still wins.tools/aurora-bindgen/build.pydefaults totools/aurora-bindgen/buildand publishesbuild/bin/bindgenonly after its compile tests pass.rust/kernel/device.rs: drop the staleexpect(dead_code)onDevice::parent()(L16).rust-buildjob from aurora-wip (Merge integration/aurora 695d9745 into aurora-wip (SEP boot policy change) #585) that prepares the corrected generator and compiles the SEP module. The SEP ABI and recovery-tool checks stay on aurora-wip because they test the held-back v5 enrolment ABI (L6/L18).The tree content matches aurora-wip for these files (b47f666, 7b563df, b18158c, 2706037), except the workflow, which is the L6-independent part.
Packaging: fedora-aurora
kernel-aurora.spec, alarm-auroralinux-aurora/PKGBUILDand nixos-aurora (bindgen/) already build with the corrected 0.73.2, and the fleet recipe passesBINDGEN=.Testing
build.pyand noBINDGEN=: see the comment below.rust-buildon this PR.🤖 Generated with Claude Code