Skip to content

accel/ane: stage H16 cold boot through firmware startup - #720

Closed
RyanTheTide wants to merge 17 commits into
aurora-wipfrom
ane/h16-cold-boot
Closed

RyanTheTide wants to merge 17 commits into
aurora-wipfrom
ane/h16-cold-boot

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

H16 firmware currently refuses registration before it can reach the cold-start handshake. Add an explicit h16_stage=preflight|map|boot|startup path in the existing firmware module for the pinned 27.0 26A428 preload. Leaving the parameter unset preserves refusal, and H17 still requires an ownership provider.

The backend raises the five genpd suppliers and checks ACTUAL before engine reads, authenticates the reserved preload, claims a private unmanaged domain, verifies DAPF, executes the H16 CE and ordered AXI/XL/C1PPT updates, and publishes the scratch init record. It validates and arms the shared transport before the four startup commands. RTKit mailbox service is polled and never gates scratch progress. IRQ 1054 remains disabled.

Any failure after RUN quarantines the instance, dumps scratch and DART fault words, and retains mappings, power and a module reference. Successful boot stages also stay pinned until reboot. No accel node or inference interface is enabled.

Stacked dependencies are #706 (ane/fw-transport), ane/t6041-dt-boot at e7b895d, and #699 for the existing immutable preload checker. Dependency merges preserve both transport and validation tests.

Integration limits

The inherited test DTS still lists SID 0 and SID 11. Generic IOMMU attachment claims all listed streams, so this backend refuses that six-stream description instead of silently configuring SID 11. The test DT needs only SID 0 on each of its three DARTs before the map rung can run. Production DT remains disabled. This integration choice is pending operator review.

Private surfaces currently require the client to be DMA coherent. An unsupported memory model refuses pool allocation before RUN. The module does not call unexported architecture cache helpers. Firmware preload physical bases must come from the bootloader's two no-map reservations, and the finalized domain aperture must include the identity pages. No geometry fields or runtime DT properties are overwritten.

SHAREDMALLOC uses the accepted transport's bounded allocate provider. The pinned H16 profile acknowledges native FREE only for its own live allocations, revokes report authority and retains backing storage/quota until reset. Foreign or repeated frees and control forms without a proved request layout quarantine without invented replies. Other profiles keep default FREE/control refusal. Heap and shared-memory ceilings are host policy, not recovered firmware limits.

Hardware test plan

Lead-owned tether boot only. Build one matching kernel/module set with this stack and a SID-0-only J616s ANE test DTB. Confirm both bootloader-provided preload reservations and the identity-page aperture. Keep the persistent boot path untouched and use user4k=on modprobe.blacklist=ane,ane_t6021 with the tether console args. Preserve the full dmesg at the first unexpected result.

Rung 1, before any CPU release

modprobe ane_t6021 h16_stage=preflight
rmmod ane_t6021

Expect H16 preload identity H16 27.0 26A428 accepted, five H16 power ACTUAL items twice with low byte ff, H16 CPU control/RVBAR 0 10000000001, the three DART status/address sets and DAPF record comparisons, then H16 stage 1 complete. The backend performs no engine/DART/DAPF writes in this rung; genpd owns power transitions.

Rung 2, still before RUN

modprobe ane_t6021 h16_stage=map
rmmod ane_t6021

Expect TEXT/DATA mappings, four H16 identity MMIO mappings, DAPF verify/readback, clean DART fault words and H16 stage 2 complete. A six-stream DT instead logs H16 map requires only SID 0 on three DARTs; refusing extra streams. A locked, different DAPF refuses before RUN.

Rung 3, fresh tether boot

modprobe ane_t6021 h16_stage=boot

Expect the CE and tunables before scratch, H16 READY 8042006 0, the sizing requests, H16 table validated 100003d0000 8, H16 scratch 3 cleared 0 0, then H16 stage 3 complete; held until reboot. Comparator sizing values are channels 8, IPC-minus-one c440, heap f00000, mode 0; these are logged, not hard-coded request equality tests. A noncoherent client instead logs H16 private surfaces require a coherent client at pool allocation before RUN. Do not unload after RUN.

Rung 4, another fresh tether boot

modprobe ane_t6021 h16_stage=startup

Expect boot completion, SHAREDMALLOC allocation logs as offered, H16 startup ack for IDs 4, 0, 3, 22 with zero status, a nonzero H16 CONFIG_GET tick, H16 stage 4 complete; held until reboot and all 100 bytes under H16 RESOURCE_INFO. A 24 MHz tick is a comparison value; other nonzero values are logged and accepted. Any post-RUN error must show scratch 0..7, DART status/address and H16 quarantine. Keep state intact, collect the logs and reboot without retry or unload.

Validation

At e40f774, the complete firmware KUnit suite passed 103/103 on x86_64 and 103/103 on arm64 with KASAN/UBSAN, including all 25 new simulated boot cases. Collected configs confirm the sanitizer settings. Controller request h-46915 returned rc 0 for both architectures.

The arm64 LLVM W=1 build of the complete ANE directory passed without warnings/errors at d261c49. The final commit only corrects a synthetic HWX task-prologue word, so production code is unchanged. The initial seven fixture failures are preserved and the strict validator was not weakened.

Native ASAN/UBSAN passed all 25 boot cases. Optional legacy compatibility targets had missing temporary-kit headers; the real Linux transport and protocol suites passed on both architectures. Own implementation and fixture checkpatch checks pass; the aggregate inherited DT dependency diff has two split-binding advisories. Scoped whitespace checks pass and all 13 changed workspace files match the published head.

No J616s hardware was requested or accessed. The SID/coherency integration limits above remain for lead review before the tether test.

RyanTheTide and others added 17 commits October 31, 2026 21:53
Track pending execution UUIDs before channel-7 publication and retire only
matching terminal channel-6 events. Keep one deadline across acknowledgment
and completion, order coherent DMA accesses, and quarantine failed or
uncertain requests without exposing private output mappings.

Validate complete HWX containers, tensor and program descriptors, aperture
records, symbols and payload-only kernel relocations. Match execute buffers
to kernel-owned process resources and revoke per-file authority on close.
Add hardware-free KUnit coverage for validation and pending request paths.

Keep H16 registration and section-only loading refused until preload,
startup, the original-container ABI and process-resource decoding exist.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Authenticate stable, owned resident firmware snapshots against the pinned
normalized digest, checking every patchbay tag and width and masking only
the reviewed mutable value cells and exact tunables interval. Keep live
page acquisition behind the boot backend ownership gate.

Import original HWX bytes once before validation and hashing, retain whole
segment geometry, and bound private load plans before DMA allocation.
Validate backend mapping geometry and decoded process bindings without
accepting userspace resource authority or publishing partial results.

Keep H16 registration, section-only loading and process creation refused:
the load/process wire bodies, allocation replies and physical boot backend
still require reviewed providers. Add hardware-free KUnit coverage for the
identity, import, planning and resource paths.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The accepted dependency patch is already applied verbatim as 4700e91,
with SHA-256 89bdf5072e468dd750580348679c0caa552ad26a07911ed218ac809495a1e8fd.
Record the original PR #681 head as an ancestor so merging it upstream
does not create add/add conflicts for the already extended HWX files.
Preserve the current source tree unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Describe the four inclusive DAPF ranges in record order so that the
firmware backend can derive both its filters and identity MMIO pages
from DT. Require them for T6041 and exercise the preload properties in
a T6041 example. The preload DVAs are fixed; only physical reservations
need to be supplied by the bootloader.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Describe the four DAPF ranges and preload device addresses without fixing
boot-specific physical addresses. Hook the J616s ANE to disabled no-map
TEXT and DATA placeholders for the bootloader to fill from segment-ranges.

Widen the three DART windows down to zero, preserving their upper bound
at 0x3ffffffffff. apple-dart uses the window for forced domain geometry,
including private paging domains. Raw iommu_map() currently permits low
mappings outside that geometry, but relying on that leaves the domain's
advertised aperture inconsistent with the firmware's identity MMIO pages.
The widened window covers both those pages and the high firmware DVAs.

Add a tether-only test DTS that enables the existing ANE and three DART
nodes. The shipping board tree keeps them disabled. Preload reservations
remain disabled in both trees until a loader completes the handoff.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Enable the ANE and its three DARTs only for the tether-loaded test DTB.
Keep the shipping board tree disabled and require the loader to fill
the preload reservations before the driver can pass preflight.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Validate the dynamic channel table before arming host rings, publish pool-backed commands, check replies and consume owned reports. Provide bounded SHAREDMALLOC allocations and match-data IRQ helpers with absolute command deadlines and retained failure state.

Exercise malformed descriptors, ring ordering, reply corruption, report ownership, allocation ceilings and deadline expiry using synthetic KUnit accessors. Keep probe and hardware ownership unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Include the existing tether DTS so the ANE test boot keeps its debug
console and the host-owned ATC0 path. Layer only the four ANE and DART
status enables on top of that established tether configuration.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Clarify that the backend resolves bindings from validated program metadata.
CREATE_PROCESS reply IDs do not describe a resource map. Keep wire
serialization and process installation separate from geometry validation,
with the existing default refusal unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Use the shared DAPF and preload property names for staged boot.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Reuse the accepted normalized preload checker for the pinned 26A428 image.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Keep default registration refused and add explicit preflight, map, boot
and startup stages for the pinned H16 27.0 26A428 preload. Reuse the shared
transport and immutable preload checker, keep genpd transitions separate
from read-only power checks, and run the CE and ordered tunables before
scratch publication. Keep all firmware-visible state and a module reference
after RUN, including every uncertain failure.

Exercise the sequence with a simulated engine and document each tether
rung. Require a SID-0-only test description rather than silently claiming
SID 11 with the generic IOMMU attachment API.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Simulate offered RTKit traffic, absent heaps, power and RVBAR refusals,
post-RUN DART faults and mapping failures. Keep pool pointer arithmetic
inside its allocation and handle a failed domain allocation explicitly.

Require coherent clients for the private surfaces. Architecture cache
preparation helpers are not exported for a module, so refuse an unsupported
memory model rather than leave a cached alias without synchronization.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Opt the pinned H16 build into the native FREE tuple established by the
round-5 facts. Resolve only live provider-owned DVAs, publish the zero reply,
and retire report authority while retaining backing mappings and quota.
Keep other firmware profiles on the conservative default and refuse control
requests whose lookup fields have no proved wire layout.

Cover locked matching filters, heap/shared overlap, native and foreign FREE,
and control refusal in the simulated engine. Complete the polled interrupt
acknowledgment before ring reads and keep the coherent-client refusal at
pool allocation so the map rung remains available.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Expose CE acknowledgment, tunable group completion and locked mismatches
before scratch release, and log a validated nonzero firmware acknowledgment.
Clarify that native FREE is enabled only by the pinned H16 profile while
the generic transport retains its conservative default.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Preserve the upstream H14 command deadline, PM tests and performance
objects while retaining the H16 preload, transport and staged backend.
Resolve shared HWX additions against the accepted original validation
source without discarding either side. The H17 ownership refusal remains.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The updated task validator requires a leading little-endian 1 before its
reserved-zero prologue. Initialize that word in the synthetic HWX builder
so valid import and load-plan fixtures exercise the strict validator. Keep
the validator and malformed-input refusals unchanged.

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

Copy link
Copy Markdown
Contributor Author

Superseded by #750 (ANE: H16 cold boot and first inference), which carries every commit of this branch.

@RyanTheTide RyanTheTide closed this Nov 1, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Correction: the last fixture commit here (e40f774, task prologue word in the HWX fixture) is not in #750 as such; #750 makes the same change in 15b6b3d.

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