Skip to content

Add APIF MMIO transport and SPTM guest IOMMU providers - #238

Closed
DjDeveloperr wants to merge 8 commits into
aurora-wipfrom
apif-mmio
Closed

DjDeveloperr wants to merge 8 commits into
aurora-wipfrom
apif-mmio

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Introduce Aurora Platform Interface over Memory-Mapped I/O (APIF MMIO)
for a trusted Linux guest under Aura and SPTM. The transport forwards
native selectors, six arguments and opaque results unchanged; peripheral
policy stays in Linux.

  • Add a synchronous version-2 transport with per-consumer buffers, atomic
    submission, prefix-completion validation and ordered client revocation.
  • Add apple-dart-apif with stream grouping, retained-root adoption,
    shared IOVA allocation, mapping rollback and native table ownership.
    Translate DMA backing and page-list pointers before native calls;
    retain uncertain frames instead of attaching duplicate tables.
  • Add apple-sart-apif through the existing SART consumer API, preserving
    raw MMIO behavior. Handle void MAP and status-returning UNMAP locally.
  • Describe transport/providers in DT bindings and document the ABI.
    Explicit firmware metadata selects units, streams and aperture rules.
  • Extend the existing Apple wait-state handling to captured T6050 CPU
    parts 0x064/0x065 and share the predicate with timed-delay avoidance.
    Preserve existing CPU ranges and the existing task TSO interface.

This series is based on aurora-wip (c679c8a75). It excludes GPU backend
changes, unrelated private-branch work, board DT enablement, probe-time
mapping self-tests and routine successful-call logging. A version-2 Aura
monitor and matching guest DT are required; existing boots are not switched
to these providers automatically.

Validation: driver code at fcfe58107, contact/ABI documentation at
007b579dc:

  • Native AArch64 Image build passed with all APIF providers enabled,
    Clang 22 and GNU ld 2.46, using a minimal 16 KiB-page configuration.
  • Production-function selftests passed for transport completion, DART
    ownership/list translation and SART return handling.
  • All three binding schemas passed dt-doc-validate; whitespace checks
    passed; checkpatch reported no errors. GPL-2.0-only binding notices
    follow the project's licensing policy.
  • LLD's full Image link failed with a section-address convergence error
    on this configuration; the GNU ld build completed successfully.

Hardware qualification of this cleaned version-2 integration is pending.
Unknown firmware SART grants are not advertised as inherited, and lost
native table completion requires recovery. No GPU changes or unqualified
hardware artifacts are deployed by this PR.

Non-GPU m5 integration still required:

  • Convert the guest DT to version-2 transport phandles and provider
    properties, preserving DMA apertures, force masks and retained SIDs.
    Enable the APIF providers in the guest kernel configuration; the SART
    backend currently requires APPLE_SART=y.
  • Port the resident-SPTM NVMe consumer: native queue setup and per-request
    TCB registration/invalidation, 16 KiB SART grants, pinned queue-page and
    RTKit handoff, and synchronous durability-preserving flush completion.
  • Port the preinitialized PCIe host/MSI path and its controlled native
    port-reset/DART-power integration for the N1 path.
  • Port the M5 PMP v2 consumer/protocol and its RTKit buffer-lifetime rules
    when enabling that DART-backed power-management device.

The version-2 page is now 0x61ff0000, outside the sixteen retained unit
aliases. The previously chosen 0x61f20000 is occupied by an existing
external-display DART alias on m5. The companion Aura change includes
production address-classification tests and passed all CI checks.

The internal optional EL1 register-probe harness is diagnostic and is
not required for DART/SART operation.

DjDeveloperr and others added 8 commits October 10, 2026 22:08
Describe the version-2 transport phandle and DART/SART providers. Native
unit IDs, retained SIDs and aperture restrictions are explicit metadata;
no whole-chip match chooses the backend.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
Give each consumer a private, synchronous batch buffer and device link.
Forward native selectors, six arguments and opaque results unchanged.
Validate prefix completion and revoke clients before their buffers die.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
Build native DART calls in Linux while preserving stream groups,
retained roots, transactional maps and shared IOVA allocation. Translate
both DMA backing and physical page-list pointers before native MAP.
Retain uncertain table frames and stop subsequent transactions rather
than attaching another table after a lost completion.

Add a SART provider through the existing consumer API. Preserve raw MMIO
behavior and interpret void MAP versus status-returning UNMAP locally.
Remove probe self-tests and routine successful-call logging.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
Add captured T6050 CPU parts 0x064/0x065 to the existing WFI preservation
ranges without dropping older entries. Share the CPU predicate with
short delays, whose callers cannot use the idle task's SIMD save path.
Do not invent future Ultra CPU identifiers or topology.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
Compile production transport, DART and SART functions into host fault
harnesses. Cover partial and malformed completion, table ownership,
non-identity page-list translation and endpoint return semantics.
Document the wire ABI, ownership rules and pending hardware validation.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
Preserve the inherited dual-license notice while marking the new
Aurora contributions GPL-2.0-only. Advertise GPL module licensing for
the combined source.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
Use hey@djdev.me in the binding and maintainer contacts, and map the
previous GitHub noreply address to the canonical author identity.

Signed-off-by: Dj <hey@djdev.me>
Place the version-2 example at 0x61ff0000, outside the retained
version-1 unit-alias window used by existing guests.

Signed-off-by: Dj <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Superseded by #472, refreshed from the current T6050 source onto Linux 7.3 integration. The new shared base is #472; all feature PRs now target t6050/base. Closing this stale chained version and keeping its branch for history.

@RyanTheTide
RyanTheTide deleted the apif-mmio branch November 7, 2026 12:10
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