Repository navigation
accel/ane: prepare H16 with the macOS 27.0 runtime contract - #669
Merged
Merged
Conversation
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]>
RyanTheTide
marked this pull request as ready for review
October 31, 2026 04:58
This was referenced Oct 31, 2026
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.
H16 macOS 27.0 uses
0x020con channel 7 for inference, a0x258-byte CREATE_PROCESS, and0x60-byte0x0300reports. 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, UNLOAD0x201/0xc, CREATE0x202/0x258, TERMINATE0x203/0x10, EXECUTE0x20c/0xca8,0xcc0,0xcd8, power gate0x2d/0xc, and firmware report0x300/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:Image modulesbuild andW=1 drivers/accel/ane/(12 translation units, zero warning/error diagnostics).CHECK_DTBS=y W=1has identical baseline diagnostics (21 normalized headers, no additions); J700 DTB is byte-identical to baseline.No hardware access or test boot was performed. The PR remains a preparation series and does not enable H16 execution.