Skip to content

arm64: restore distro support and require checked Rust layouts - #465

Closed
RyanTheTide wants to merge 11 commits into
integration/aurorafrom
consistency/asahi-config-20261026
Closed

RyanTheTide wants to merge 11 commits into
integration/aurorafrom
consistency/asahi-config-20261026

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Restore shared distro/security/peripheral requirements lost when replacing the Fedora base with defconfig, while retaining the redundant-request cleanup and Apple backends. Keep checked Rust layouts and make the corrected generator the default. Restore the early ESP charset dependency needed before vendor firmware is unpacked.

Pin combined cons3 source 26f2474183fcb287e0f7e8e180c53ed639b6a353. Public source archive SHA256 5516214432b23f39a3f0e79278454d76a846dc9c8131168f8dff22e78ad166ad.

The corrected generator is prepared at tools/aurora-bindgen/build/bin/bindgen, then Kbuild selects it automatically in-tree and with O=. No BINDGEN= make argument or export is needed. Every generated size, alignment and field-offset assertion remains mandatory. Preparation verifies pinned public sources, patches, Cargo.lock and compile fixtures; make performs no implicit download.

The common fragment also matches Fedora's FAT codepage 437 / ASCII defaults with both converters built in. Asahi's dracut pre-udev hook mounts the ESP without charset options; a modular ISO-8859-1 default can be absent from initramfs and prevent vendor-firmware extraction. Enable XZ/Zstd firmware loading for compressed distribution firmware files. No per-device fragment or new shipping parameter is added.

Retained Apple-only distro bases explicitly enable memory hotplug/hot-remove for DAX, built-in INET diagnostics and the Apple HID core selected by the built-in OF transport. They keep absent internal ACPI HID and Qualcomm QMI DSP offload disabled while retaining ordinary OF HID and USB audio. This fixes the initial hosted validation failures without ignoring mismatches or relaxing display/device admission gates.

Validation on this exact combined cons3 source:

  • Complete universal and independent Fedora-base Image/modules/dtbs builds passed with WERROR=y, all 1,331 fragment requests matched, and no BINDGEN make argument or environment override. Recorded generator commands and mandatory assertions were checked.
  • ARM64 QEMU KUnit: 358 passed, 95 skipped, no failures/crashes/errors; all nine required groups and real-MM attribution executed. Apple-dcp: 63/63 groups passed.
  • The unmodified public Asahi pre-udev hook reproduced cons2's missing ISO-8859-1 charset on a synthetic GPT/VFAT ESP. The exact cons3 Image mounted with default options and extracted the synthetic firmware correctly. Only NVMe readiness was modeled; mount, FAT/NLS and archive extraction were real guest operations.
  • Stock-generator fallback fails the mandatory layout assertions; restoring the prepared default passes the same configuration, even with the old layout opt-out set to zero. In-tree and O= selection both passed.
  • Both Apple dtbs_check runs retain the same 6,094 inherited diagnostics and identical normalized diagnostic context as the preserved baseline, with no new or removed diagnostics. This is not clean device-tree validation.
  • Native Linux distro host tests: Fedora 134, ALARM 89, NixOS 87; Fedora images 9. All three retained package policy bases also resolve with strict validators and pass rustavailable without a generator override. Source pins/checksums and Nix generator manifest/patches/Cargo.lock match.

The filesystem/NLS/initramfs/firmware/partition audit covers 508 symbols against 73x, including all 90 raw value/presence differences. The key mount difference is FAT_DEFAULT_IOCHARSET, not missing cp437 or ASCII implementations. Other optional filesystem, diagnostic, legacy partition and KUnit differences are accounted for separately from the ESP path.

Upstream checked 2026-10-26: released bindgen 0.73.2, Linux minimum 0.71.1 and bindgen main still omit explicit alignment for zero-sized non-opaque structs. Raising the minimum cannot fix this case. Related upstream #551/#552 concern empty C size and #1683 the Windows ABI; no exact aligned-empty fix was found. Generic aligned empty records and their containing types can be affected under other configs/architectures. All emitted assertions are compiled without KUnit; they do not cover C-only types or opaque internal fields. Primary links and preparation details are in tools/aurora-bindgen/README.rst.

The shipping recipe remains defconfig plus the single shared asahi.config; the Fedora-base recipe is an independent compatibility check. Existing cons2 artifacts are preserved. No physical hardware operation was performed. Device smokes remain separately orchestrated, and this PR stays draft. Full RPM/makepkg/Nix image builds and channel publication are separate from these kernel and host gates.

Resolve each candidate removal over both arm64 defconfig and the Fedora Asahi base. The 36 removed requests cause no resolved configuration changes on either recipe: the bases or the remaining selections retain those drivers and capabilities.

Keep the default thermal governor available over the Fedora base by enabling ENERGY_MODEL and THERMAL_GOV_POWER_ALLOCATOR, as identified in #438. Request 48-bit VA and mixed-granule userspace as in #394, and build the native G15 backend alongside the other supported GPUs.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The probe fixture calls cd321x_pm_init() on an uninitialised stack object. That helper sets the initial phase and link-event budget but expects the other fields to have the zeroed allocation used by the real driver. The fixture can read arbitrary setup_pending values and fail its retry assertions under UBSan. Start it from the same zeroed state as the other fixtures.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Building G15 and G16 together exposes stale initializers and calls in the
G15 adapter. Initialise the inactive G16 platform owner and preserve the
RTKit default protocol negotiation and legacy shmem callback.

Resolve timestamp handles through Buffer::firmware_mapping(), retaining
the firmware mapping and rejecting CPU-only destinations. Pass no reserved
region map when walking G15 host-allocated RAM page tables, matching the
same shared API contract already used by G16.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Four G17 helpers exist only for the KUnit suites: the compute QID
floor, the growth gate and admission pool constructors and the runtime
registry constructor. They are gated on cfg(CONFIG_KUNIT), which is
also set when KUnit is a module. #[kunit_tests] compiles its suites only
for CONFIG_KUNIT=y, so with CONFIG_KUNIT=m (the Fedora-based release
configuration) nothing uses the helpers and rustc warns about dead code:

  warning: constant `COMPUTE_FLOOR` is never used
  warning: associated function `new` is never used (x3)

With CONFIG_WERROR=y, KBUILD_RUSTFLAGS gains -Dwarnings and the asahi
module no longer builds.

Gate the helpers on CONFIG_KUNIT="y", the condition the suites use.
Every caller is inside a #[kunit_tests] module, so built-in KUnit runs
are unchanged.

Fixes: a36e352 ("drm/asahi: size the G17 compute QID budget by open logical queues")
Fixes: 014605a ("drm/asahi: add G17 resource wait domains and use them for queue creation")
Fixes: 64f717d ("drm/asahi: wait for G17 compute capacity on the release that frees it")
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Device::parent is a public API in the carried Asahi abstractions, and AOP service lookup uses it with AUXILIARY_BUS disabled. The inherited expectation described the upstream crate-private helper and becomes unfulfilled in the built-in Asahi/firmware KUnit recipe. WERROR correctly rejects it.

Remove the obsolete dead_code expectation from the public method. Keep warning enforcement and the minimal test config; do not enable an unrelated bus to hide the warning. Production behavior is unchanged.

Assisted-by: LLM
With SCHEDSTATS disabled, stock bindgen loses the alignment of the empty sched_statistics member and shifts task_struct.mm. A current-MM read can then pass a scheduler-list pointer to the RSS helpers. Keep unconditional size, alignment and offset checks in production builds and document the corrected generator and command-line BINDGEN selection.
Keep defconfig plus the single shared fragment while restoring SELinux and its LSM policy order, nftables and NAT, container and systemd requirements, filesystems, hardening, desktop compatibility and attached USB peripherals. Do not enable scheduler statistics to hide an invalid Rust binding layout.
@RyanTheTide RyanTheTide changed the title arm64: configs: trim the shared Asahi fragment and retain every backend arm64: restore distro support and require checked Rust layouts Oct 26, 2026
Prepare the pinned generator at a stable source-tree entry point and prefer it for in-tree and O= builds. Keep every generated layout assertion mandatory and retain stock-tool rejection coverage. Document upstream status and the scope of aligned empty records.

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

Assisted-by: LLM
Asahi dracut loads vfat and mounts the system ESP without charset options before unpacking vendor firmware. Match Fedora codepage 437 and ASCII defaults with built-in converters so the mount does not depend on a modular ISO-8859-1 converter absent from initramfs. Retain XZ and Zstd firmware loading for distribution firmware packages.

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

Assisted-by: LLM
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged into aurora-wip through #534 (2026-10-28 consolidation). aurora-wip is the home for WIP from here on.

@RyanTheTide
RyanTheTide deleted the consistency/asahi-config-20261026 branch October 28, 2026 05:16
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