Skip to content

soc: apple: Add registry-v2 PMP and safe DMA ownership - #243

Closed
DjDeveloperr wants to merge 1 commit into
apif-pciefrom
apif-pmp
Closed

DjDeveloperr wants to merge 1 commit into
apif-pciefrom
apif-pmp

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Add the matched T6050 registry-v2 PMP protocol: bounded 88-byte descriptors, firmware-assigned IDs, shared value buffers and update opcode 0x36. Preserve the existing T6000 protocol and T8140 DMA-mask profile. Calibration and boot arguments stay firmware-described; validate the whole boot-argument table before mutation.

Require an attached IOMMU before processor start. Own RTKit outside the callback context, drain the reboot notifier before releasing the owner, and verify the matched idle/context-save/CPU-stop proof before freeing DMA. Startup and unbind failures follow one stop-or-retain path instead of the internal port's panic-on-stop-failure paths. A retained context cannot cold-reprobe. Add only the required session-owned endpoint-7 auxiliary buffer support, retaining newer public RTKit lifetime fixes.

Stack: apif-mmio #238 → NVMe #241 → PCIe #242 → this PR. No GPU changes, private implementation references or routine successful-call logs.

Validation: native AArch64 PMP Rust and RTKit C objects; a full linked Image with Clang/GNU ld; production Rust parser tests for truncated descriptors, invalid lengths/IDs/names, and transactional boot-argument rejection; schema validation; the preceding APIF fault tests.

Local toolchain limitation: stock bindgen 0.73.2 generates incorrect Rust layouts for unchanged ns_common anonymous structs and aligned empty sched_statistics/slabobj_ext types. This fails before the PMP driver is compiled. Local validation used an external bindgen wrapper adding --opaque-type 'ns_common.*' --opaque-type sched_statistics --opaque-type slabobj_ext; no generated bindings or build workaround are included in this PR. The driver and full Image build pass with that adjustment. Validation does not establish that the stock Rust build issue is fixed.

Hardware cold boot, registry exchange, idle/context save, reboot and teardown qualification remain pending.

Carry the matched T6050 descriptor, buffer and update protocol into the
public PMP driver. Preserve the T6000 protocol and T8140 DMA-mask profile.
Bound registry copies and validate the complete boot-argument table
before changing it. Require an IOMMU domain before starting firmware.

Own registry-v2 RTKit outside its callback context, register a drained
reboot notifier, and verify the matched context-save and CPU-stop proof
before releasing DMA. Probe and unbind failures stop or retain backing
rather than panicking on an unconfirmed firmware transition.

Port only the required auxiliary-buffer endpoint; keep newer public
RTKit lifetime and inherited-buffer fixes. Expose the existing C handle
and reboot declarations to the Rust owner without copying unrelated
private transport features or GPU code.

Native driver objects and production-parser fault tests pass. Local Rust
validation uses opaque bindings for unrelated existing namespace and
empty-struct bindgen layout failures, outside the published source.
Hardware firmware exchange and teardown qualification remain pending.

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

Copy link
Copy Markdown
Contributor Author

Superseded by #475, 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.

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