Skip to content

accel/ane: prepare H16 with the macOS 27.0 runtime contract - #669

Merged
RyanTheTide merged 9 commits into
aurora-wipfrom
ane/h16-capture-20261031
Oct 31, 2026
Merged

RyanTheTide merged 9 commits into
aurora-wipfrom
ane/h16-capture-20261031

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

H16 macOS 27.0 uses 0x020c on channel 7 for inference, a 0x258-byte CREATE_PROCESS, and 0x60-byte 0x0300 reports. Reusing the H14 procedure packet or completion predicate would submit the wrong ABI or retire buffers before completion. This series adds the captured runtime contract to the existing H16 preparation work and keeps execution refused while the boot and validation backend is incomplete.

The H16 runtime table covers LOAD 0x200/0x1c0, UNLOAD 0x201/0xc, CREATE 0x202/0x258, TERMINATE 0x203/0x10, EXECUTE 0x20c/0xca8,0xcc0,0xcd8, power gate 0x2d/0xc, and firmware report 0x300/0x60. Host packets use a zero word followed by little-endian u16 ID and u16 acknowledgment. Descriptor wire indices are retained independently of channel names. Reports are validated as diagnostics; their undecoded body never completes an inference. H14 body serializers are refused on H16.

J616s match data records one IRQ for all channel replies/events (DT IRQ 1054) and AP ownership. The runtime observation did not cover cold boot, RTKit negotiation, scratch publication, CONFIG_GET or RESOURCE_INFO_GET, so their conservative predicates and smaller resource ceilings remain. H17 ownership refusal and disabled DT nodes remain in force. The source contains derived field constants and synthetic test packets; no captured payload bytes or private records are included.

This PR carries the rebased #638 DART binding/DT prerequisites and the t-3509 resource, preflight, channel, RTKit and task-validation helpers. H16 still has no registered inference interface: strict preload validation, the original-container HWX ABI, the physical boot backend and execute/completion decoding need implementation. The updated documentation states that boundary.

Validation at 1ab7d910cb984b0baceb61b814576fb40a7b7840:

  • ARM64 fleet configuration: Image modules build and W=1 drivers/accel/ane/ (12 translation units, zero warning/error diagnostics).
  • QEMU x86_64 KUnit: 15/15 tests, including the runtime ID/size/channel table, u16 envelope/refusal handling, reordered descriptor indices and diagnostic-only reports.
  • Device-free fp16 fixture: three buffer hashes and all 16,384 CPU oracle elements pass; no HWX or hardware inference result is claimed.
  • DT binding validation passes. J616s/J700 CHECK_DTBS=y W=1 has identical baseline diagnostics (21 normalized headers, no additions); J700 DTB is byte-identical to baseline.
  • Strict checkpatch across all nine commits, diff checks and trailer/disabled-node/ownership audits pass. Only the generic FILE_PATH_CHANGES notice is excluded: the existing ANE MAINTAINERS directory wildcard covers the new header.

No hardware access or test boot was performed. The PR remains a preparation series and does not enable H16 execution.

The T6041 ADT gives the ANE two IOMMU parents on its DART: stream 0 for
the engine and stream 11 for its MPM. Allow the three DARTs' stream 11
after their stream 0 on the T6041 and keep three entries everywhere else.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The ADT's dart-ane0 translates from vm-base 0x100_0000_0000 for
0x300_0000_0000 bytes, and iBoot preloads the ANE firmware at DVA
0x100_0000_0000 and 0x100_000c_0000, so the DARTs need that window as on
the T8140. The ANE also has a second IOMMU parent, mapper-ane0-mpm on
stream 11.

Give the three ANE DARTs apple,dma-range and the ANE stream 11 on each.
All of these nodes stay disabled until there is an H16 firmware backend,
so nothing changes at runtime.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Describe the seven H16 ranges using neutral auxiliary names, the five
real power suppliers, and bootloader-provided TEXT/DATA reservations.
Keep the original H14 firmware-alias reservation distinct from physical
preload reservations. Allow the known H17 resource geometry and document
that absence of the exclave marker does not establish Linux ownership.

Build on draft #638's SID 11 binding without replacing its shared-domain
policy with an untested remap.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Add the six auxiliary ranges, firmware generation and preload marker.
Attach the system, CPU, MPM, task and base suppliers; their existing PMGR
parents already encode the required ordering. Retain draft #638's DART
aperture and stream 11 mappings without duplicating those properties.

Keep all ANE nodes disabled. Dynamic firmware reservations must be
provided by the bootloader, and no physical preload address is fixed in
the board description. Virtual no-state gates cannot be represented by
the current register-backed PMGR binding.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Recognize H16 and H17 in the shared firmware module without entering the
H14 staging path. Refuse H17 with EOPNOTSUPP until a Linux exclave
ownership backend exists, even if DT omits the ownership marker. Check
before driver registration because platform core DMA configuration and
single-domain power-on precede the driver's probe callback.

Record H16 geometry and validate dynamic no-map preload reservations.
Keep H16 fenced: the specification does not define the 27.x CONFIG_GET
capability reply sufficiently to validate address width, configuration
size or target limits. H14's nonzero-word predicate cannot prove those
contracts. Do not expose program loading or infer task descriptor fields.

Add KUnit coverage for changing physical placement, adjacency, overlap,
alignment, overflow, segment size and DVA order. Document the remaining
contracts required for execution support. This is preparation and refusal
handling, not completed H16 inference support.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The legacy exchange assigns BUF_T2H and IO_T2H pointers without reading
them. Remove the unused locals and assignments so W=1 is clean for the
shared firmware transport. Ring service and completion behavior do not
change.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
platform_irq_count() calls platform_get_irq_optional() and can create IRQ
mappings. Preflight must only inspect the DT description before refusing
the unsupported firmware contract. Use of_irq_count() to parse and count
the interrupt specifiers without allocating an IRQ mapping.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Parse the eight 27.x channel descriptors by name, checking owned-memory
bounds, counts, types and overlaps. Use copied dynamic geometry in the
shared exchange path and detect descriptor mutation. Distinguish a zero
successful acknowledgment from a nonzero firmware refusal; quarantine
failed exchanges without retiring corrupted slots or resetting hardware.

Add version-12 RTKit ordering and exact CONFIG_GET/completion predicates.
Keep one H16 execution deadline across acknowledgment and finish, retain
all firmware-visible memory on failure and reject new BO work while
quarantined. Preserve the legacy reserved-word and completion behavior.

Add H16 nine-word task-stream/register and local relocation checks, with
KUnit coverage. Add the device-free add-128 input/oracle selftest from the
SPEC-r2 hashes. These components do not enable H16: the pristine preload
comparison reference and custom HWX descriptor/aperture byte layouts are
still required before a complete original-container ABI or boot path can
be admitted. Keep H17 ownership refusal unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Use the observed H16 command IDs, sizes and channel indices rather than
the H14 procedure ABI. Prepare the zero-word/u16-ID/u16-ack envelope and
reject invalid runtime packets before publication. Retain descriptor wire
indices independently of logical channel names.

Validate 0x60-byte 0x0300 reports as diagnostics without interpreting the
undecoded body as legacy completion. Record the single J616s IRQ as the
channel reply/event doorbell. Keep cold boot, preload and original-HWX
gates closed and allocation ceilings unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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