Skip to content

arm64: configs: one kernel configuration for every Mac (aurora_defconfig) - #2803

Closed
RyanTheTide wants to merge 3 commits into
mainfrom
sweep-kcmd/config-v2
Closed

RyanTheTide wants to merge 3 commits into
mainfrom
sweep-kcmd/config-v2

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #2292 (same changes, commit trailers fixed, on the current integration/aurora).

Adds one kernel configuration for every supported Mac, owned by the kernel tree, so the fleet build and the Fedora, Arch Linux ARM and NixOS packages stop carrying their own bases.

make ARCH=arm64 LLVM=1 aurora_defconfig

merges arch/arm64/configs/asahi.config (Apple hardware, unchanged in scope) over the new arch/arm64/configs/aurora-base.config (generic distribution base, savedefconfig form, no symbol overlapping asahi.config) and runs olddefconfig.

Why

Resolved over this same source (0abc2f3) with the same toolchain, the four existing recipes differ:

fleet build Fedora pkg Arch pkg NixOS pkg
generic base Fedora Asahi kernel config trimmed distro config (in fedora-aurora) same trimmed config (in alarm-aurora) alarm's resolved snapshot from an older pin
asahi.config merged merged merged not merged (validated only)
  • fleet vs the packages: about 6,900 options differ, so the kernel tested on hardware was not the kernel users install.
  • The package base was missing a lot of hardening the fleet had: RANDOMIZE_BASE, FORTIFY_SOURCE, HARDENED_USERCOPY, INIT_STACK_ALL_ZERO (it had INIT_STACK_NONE), LEGACY_TIOCSTI was on, BPF_UNPRIV_DEFAULT_OFF, SLAB_FREELIST_HARDENED, LIST_HARDENED, IO_STRICT_DEVMEM and DEFAULT_MMAP_MIN_ADDR=65536 were all missing. It also lacked USERFAULTFD.
  • Over this source, NixOS is missing the T6050 Wi-Fi/Bluetooth, M5/G18 GPU, DWI backlight, PCIE_APPLE_MSI and the T6050 DP PHY, because its snapshot comes from an older pin.
  • TYPEC_TPS6598X_DEBUG_COMMANDS was off everywhere. The tipd debugfs command file was first built whenever DEBUG_FS was set. It later moved behind this default-n option, and nothing enabled it. tuxvdmtool/macvdmtool need it to send Apple VDMs (DFU, reboot) from Linux. SPMI-attached controllers have no /dev/i2c fallback.

What is in it

  1. asahi.config: CONFIG_TYPEC_TPS6598X_DEBUG_COMMANDS=y.
  2. aurora-base.config + aurora_defconfig target. The base is the fleet's Fedora Asahi base (the configuration booted on the lab Macs since the first fleet cut), plus all 176 options any package had that it lacked: AppArmor, SCHED_CLUSTER, IKCONFIG_PROC, USB gadget functions, CFG80211_WEXT, RELR, FONT_TER16x32, extra filesystems and drivers, and so on. On hardening options the stricter value is used everywhere, including the packages' IOMMU_DEFAULT_DMA_STRICT. PREEMPT_LAZY stays, PREEMPT_DYNAMIC is still on, and VFAT_FS=y. The CONFIG_LSM order stays Fedora's. SELinux is built in; on distributions without a policy it does nothing.
  3. Drops j813.config/j813-usb4.config, a second, board-specific config recipe. All J813 drivers they enabled are in asahi.config. The J813 doc now builds with aurora_defconfig.

asahi.config still enables every Apple SoC/board driver in the tree (M1 through M5 and A18, including the T8122, T6030, T8132, T6050, T8142 and T8152 options). The only Apple options left off are KUnit tests, APPLE_SEP_KEY_RESEARCH, DRM_APPLE_DEBUG, DRM_ASAHI_DEBUG_ALLOCATOR, the experimental MT7932_AWDL (off by design), and x86-only Apple drivers.

Tests

  • aurora-base.config + asahi.config → olddefconfig on 0abc2f3: 5557 + 183 requests, 0 mismatches, 0 Kconfig warnings (unmet, override, invalid). The result is identical to the configuration it was derived from (diffconfig empty). The resolved config also passes the NixOS requirement and policy checks and the fleet distro gate (SELinux, nftables, binfmt_misc, userfaultfd, ntsync, uinput, hidraw, zram, wireguard, user4k, Rust, drm_asahi, SEP, MT7932, brcmfmac, PMP, PMC, AVE, dm-crypt, dm-integrity, BT, exFAT, HID).
  • Full build (Image, modules, dtbs) with make aurora_defconfig and nothing else: see the comment below.
  • Hardware boots are still to come: Neo (T8140), J616s (T6040), M1 Pro (T6000), M2 (T8112).

Full per-option diff of the four recipes and the unified config: traces/kernel/20261119-sweep-kcmd/config/CONFIG-DIFF.md (lab storage).

Order

Merge this first. Then fedora-aurora, alarm-aurora and nixos-aurora switch to aurora_defconfig (draft PRs linked below), which only work with a kernel pin that includes this PR. They land with the first pin bump past it, and NixOS refreshes its kernel/config snapshot in that same bump. The fleet build recipe changes the same way: make aurora_defconfig replaces the Fedora base plus merge_config.

The branch now merges integration/aurora (36faebf) so it carries 26294e8; consumers that take their configuration snapshot from this PR get a source with that fix. The merge changes no configuration value.

The tipd driver's usb/tipd/<port>/command debugfs file sends LOCK, DBMa,
VDMs, DVEn and DISC to the CD321x/SN201202x USB-PD controller. tuxvdmtool
and macvdmtool use it to send Apple VDMs (reboot, DFU, serial, Debug USB)
to a Mac connected to that port, which is the only way to reach an
SPMI-attached controller from Linux (there is no /dev/i2c-N for it).

The interface was first built whenever DEBUG_FS was set; it later moved
behind CONFIG_TYPEC_TPS6598X_DEBUG_COMMANDS (default n), and no config
selected it, so no shipped kernel had it. Every supported Mac has these
controllers, so enable it in the shared fragment. The file is root-only
and inert until written.

Suggested-by: Satya Benson <[email protected]>

Signed-off-by: Ryan Murray <[email protected]>
Each Aurora kernel build started from its own generic base and merged
asahi.config over it: the fleet build used the Fedora Asahi kernel
configuration, the Fedora, Arch Linux ARM and NixOS packages used a
trimmed distribution configuration kept in each packaging repository,
and NixOS did not merge asahi.config at all but reused a resolved
snapshot from an older kernel. Resolved over the same source the
fleet and package configurations differ in about 6,900 options, so the
kernel tested on hardware was not the kernel users install, and NixOS
lacked several recent drivers (T6050 Wi-Fi and Bluetooth, the M5 GPU,
the DWI backlight).

Add the generic half of the configuration to the tree as
aurora-base.config and an aurora_defconfig target that merges
asahi.config over it, so every build gets the same options from the
kernel source:

  make ARCH=arm64 LLVM=1 aurora_defconfig

aurora-base.config is in savedefconfig form and sets no symbol that
asahi.config sets. It is the Fedora Asahi base the fleet builds have
been using, with every option a distribution package had enabled that
it lacked (AppArmor, SCHED_CLUSTER, IKCONFIG_PROC, USB gadget
functions, CFG80211_WEXT, additional filesystems and drivers, ...).
Where the two disagreed on a hardening option the stricter value is
kept, so all distributions now get KASLR, FORTIFY_SOURCE, hardened
usercopy, zero-initialised stack variables, no TIOCSTI injection,
unprivileged BPF off and strict IOMMU invalidation.

The result resolves with no Kconfig warnings, every request of both
fragments survives olddefconfig, and asahi.config still enables every
Apple SoC and board driver in the tree.

Signed-off-by: Ryan Murray <[email protected]>
j813.config (an allnoconfig RAM-boot recipe) and j813-usb4.config were a
second, board-specific way to configure a kernel for one Mac. Every
J813 driver they enable (DCP, dockchannel, DART, RTKit, PMGR power
states, SPMI, dwc3, ATC PHY, USB4, PCIe, cpufreq, MacSMC) is already in
asahi.config, so the shared aurora_defconfig builds the same hardware
support for the J813 as for every other Mac. What remains in them is
bring-up policy (47-bit VA, userspace cpufreq governor, host-only dwc3,
simple framebuffer) that the shared configuration intentionally does
not use.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at 14414bc (non-author, draft). No blocker; ready once the hardware boots are in, with one runtime difference from the tested kernels that deserves its own row.

  • Merges cleanly on integration/aurora 6748d83. Three commits, human trailers only.
  • aurora_defconfig uses the stock merge_into_defconfig helper with aurora-base.config and the asahi fragment. No reference to the removed j813.config / j813-usb4.config is left in the tree; the J813 document is updated.
  • aurora-base.config (5571 lines) is in savedefconfig form: no symbol appears twice, and none of its symbols is also set in asahi.config (0 overlaps), so the merge cannot produce override warnings.
  • No lab-only content: CONFIG_CMDLINE is not set (resolves to ""), no LOCALVERSION, no KASAN/KCSAN/lockdep/KMEMLEAK, MAGIC_SYSRQ_DEFAULT_ENABLE=0x0. The debug-flavoured options that are present (KGDB, KFENCE, UBSAN shift, PAGE_OWNER, KUNIT=m, DEBUG_SHIRQ) are the distribution base's own and are in the kernels running on the test machines today.
  • I compared all 5741 requests of the two fragments with the configuration of the current test kernel build: 5608 are identical, nothing that kernel has on is requested off, 132 options are newly on (IKCONFIG, AppArmor, GPIO_SYSFS, CFG80211_WEXT, USB gadget functions, extra codecs and filesystems, FONT_TER16x32), and one changes value (VFAT_FS m to y, as the body says). TYPEC_TPS6598X_DEBUG_COMMANDS=y is already in that kernel.
  • Page size, LSM order, DEFAULT_SECURITY_SELINUX, PREEMPT_LAZY/PREEMPT_DYNAMIC, HZ and module signing resolve as before.

Small points, not blocking:

  • aurora-base.config sets no IOMMU_DEFAULT_DMA_*, so the arm64 Kconfig default applies and the result is IOMMU_DEFAULT_DMA_STRICT; the kernels tested so far use IOMMU_DEFAULT_DMA_LAZY, and apple-dart reports IOMMU_CAP_DEFERRED_FLUSH. That is the one change here that alters a hot path on every Mac (NVMe, Wi-Fi, USB unmaps flush synchronously). The body states it as intended; please add a throughput row (NVMe sequential and random, Wi-Fi iperf, one GPU-heavy run) next to the boot rows, so the cost is a number and not a guess. A comment line in the base file saying the strict default is deliberate would stop a later regeneration from flipping it back.
  • SECURITY_APPARMOR=y is built but not in CONFIG_LSM, so it stays inactive unless a distribution passes lsm=. Fine; say so in the base file header for the distributions that expect it on.
  • The body refers to "the comment below" for the full build result and to linked distribution PRs; this replacement PR has no comments yet. Please repost the build result and the links here.
  • The body cites a per-option diff by a local storage path; attach it (gist or PR comment) or drop the reference.
  • Still to run per the body: boots on T8140, T6040, T6000 and T8112. T8122 and T8132 machines should be on that list too, since this replaces their configuration as well.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Closing as superseded: one kernel configuration for every Mac landed on main as arch/arm64/configs/aurora_defconfig through #3064 (merge 02c6a46), done another way (no aurora-base.config fragment or make target needed). KERNEL-UNIFY, which owns #3064, confirmed this. This PR's other change, dropping j813.config/j813-usb4.config, is deliberately not wanted: Documentation/arch/arm64/apple-j813.rst documents them as a separate user-facing choice. The branch is kept and can be reopened. The distro side (fedora-aurora#426, alarm-aurora#350, nixos-aurora#332) moves to KERNEL-UNIFY's -48 cut.

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