Add secure-world UCSI test stub - #90
Open
dymk wants to merge 3 commits into
Open
Conversation
Add a deterministic, secure-world-only UCSI PPM stub so the OS side can exercise the UCSI-over-FF-A path against QEMU. The `Ucsi` FF-A service (UUID 65467f50-...) reads the doorbell tag at payload byte 0 and the 48-byte UCSI mailbox inline from bytes 1..49, parses the CONTROL opcode at mailbox offset 8, and returns the updated mailbox at response offset 0. Implements GET_CAPABILITY (0x06), GET_CONNECTOR_CAPABILITY (0x07, connector 1) and GET_CONNECTOR_STATUS (0x12, connector 1) with fixed fake data for a single connected USB-PD sink; unknown opcodes and invalid connectors return CCI not_supported with a zeroed MESSAGE IN. MESSAGE IN payloads and CCI are hand-encoded (embedded-usb-pd does not compile for aarch64-unknown-none), and a host-only wire-format gate test round-trips each fixture through the upstream embedded-usb-pd encoder to prove the const bytes are valid UCSI 1.2 wire data. embedded-usb-pd is added as a dev-dependency-only oracle, mirroring battery.rs. Assisted-by: GitHub Copilot:claude-opus-4.8 Copilot-Session: 6cb7060d-6d47-49ad-a710-428fe4c2f3dc
Pin the host-only embedded-usb-pd oracle to current main, where the obsolete macro dependency chain has been removed. Enable its explicit UCSI v1.2 feature and update the test imports for the versioned module. Document the remaining test-only bincode advisory and cargo-vet exemptions. None of these dependencies are linked into secure-partition builds. Assisted-by: GitHub Copilot:gpt-5.6-sol Copilot-Session: 6cb7060d-6d47-49ad-a710-428fe4c2f3dc
Append the deterministic UCSI service to the repository QEMU secure partition and advertise its UUID in the partition manifest. This keeps the standalone QEMU SP coherent with the new service library. Assisted-by: GitHub Copilot:gpt-5.6-sol Copilot-Session: 6cb7060d-6d47-49ad-a710-428fe4c2f3dc
dymk
marked this pull request as ready for review
August 4, 2026 20:15
dymk
requested review from
RobertZ2011,
felipebalbi,
kat-perez,
makubacki and
williampMSFT
August 4, 2026 20:15
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a secure-world, deterministic UCSI 1.2 Platform Policy Manager (PPM) test stub to the QEMU secure partition so host/OS-side code can exercise the UCSI-over-FF-A (via ACPI) path with stable, known-good mailbox fixtures.
Changes:
- Introduces a new
ec-service-libUcsiservice that returns deterministic capability/connector-capability/connector-status data and includes host-only tests validating fixtures againstembedded-usb-pd. - Registers the UCSI service in the QEMU SP runtime service list and advertises the UUID in the FF-A manifest.
- Updates dependency/audit configuration to accommodate the host-test-only
embedded-usb-pdoracle and its transitive crates.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| supply-chain/config.toml | Adds cargo-vet exemptions for new host-test-only transitive dependencies. |
| platform/qemu-sp/src/main.rs | Registers the new Ucsi service in the QEMU secure partition message handler. |
| platform/qemu-sp/linker/qemu-ec-sp.dts | Advertises the UCSI service UUID in the FF-A manifest UUID list. |
| ec-service-lib/src/services/ucsi.rs | Implements the deterministic UCSI stub and host-only wire-format gate tests. |
| ec-service-lib/src/services/mod.rs | Wires the new ucsi module into the services module exports. |
| ec-service-lib/Cargo.toml | Adds embedded-usb-pd as a dev-dependency for host-only fixture validation. |
| deny.toml | Ignores a RustSec advisory for a host-test-only transitive dependency (bincode). |
| Cargo.toml | Adds the embedded-usb-pd workspace dependency (used by ec-service-lib tests). |
| Cargo.lock | Locks new dependency graph entries introduced by embedded-usb-pd. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RobertZ2011
approved these changes
Aug 4, 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.
Summary
Scope
The stub is synchronous and secure-world-only. It does not add EC relay, PD hardware, notifications, or native Windows UCSI class-driver integration.
Validation
Related