Skip to content

Relay TimeAlarm timer values - #87

Merged
dymk merged 4 commits into
OpenDevicePartnership:mainfrom
dymk:dymk/time-alarm-timer-set-get
Jul 21, 2026
Merged

Relay TimeAlarm timer values#87
dymk merged 4 commits into
OpenDevicePartnership:mainfrom
dymk:dymk/time-alarm-timer-set-get

Conversation

@dymk

@dymk dymk commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • relay TimeAlarm SetTimerValue and GetTimerValue through the EC
  • validate canonical request/response discriminants (6 -> 6, 7 -> 5)
  • preserve the existing AML raw status/value ABI with focused protocol tests

Architecture

Relay::invoke_request_with_response_id keeps remote-error handling ahead of success-discriminant validation while preserving the existing equal-ID helper. TimeAlarm uses typed zerocopy request layouts and exact empty/four-byte response parsing.

Code-judo review

An independent simplification pass consolidated duplicate positive assurance into FFA-to-wire contract tests: 47 net test LOC removed, no production churn, with malformed-body, wrong-ID, remote-error, oversized-parser, and GetRealTime boundaries retained.

Validation

  • cargo test --locked -p ec-service-lib — 116 passed
  • cargo clippy --locked -p ec-service-lib --tests -- -D warnings
  • cargo check --locked -p ec-service-lib --target aarch64-unknown-none
  • cargo check --locked -p ec-service-lib --target aarch64-unknown-none-softfloat
  • repository pre-commit/feature/build gates passed
  • dependent TimeAlarm, Thermal, Battery, and aggregate ArmVirt E2Es passed

Downstream

Dependent ArmVirt PR will track:
OpenDevicePartnership/odp-platform-qemu-arm-virt#127

dymk added 3 commits July 20, 2026 20:05
Allow service shims to validate canonical success response
discriminants that differ from their request IDs while preserving the
existing equal-ID convenience method and remote-error ordering.

Assisted-by: GitHub Copilot:gpt-5.6-sol

Copilot-Session: d2609ceb-d6c1-4dab-a4bd-3e4c6eb98def
Add typed timer set/get requests, canonical response-discriminant
validation, exact body parsing, and the existing AML raw scalar ABI.

Assisted-by: GitHub Copilot:gpt-5.6-sol

Copilot-Session: d2609ceb-d6c1-4dab-a4bd-3e4c6eb98def
Assisted-by: GitHub Copilot:gpt-5.6-sol
Copilot-Session: d2609ceb-d6c1-4dab-a4bd-3e4c6eb98def

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the TimeAlarm EC relay service to support relaying SetTimerValue and GetTimerValue over the EC with explicit request/response discriminant validation, while keeping the existing AML-facing raw ABI (status/value as a 32-bit scalar) and adding focused protocol contract tests to prevent wire-format drift.

Changes:

  • Add SetTimerValue / GetTimerValue command handling in TimeAlarm, using typed zerocopy request layouts and exact response parsing.
  • Introduce Relay::invoke_request_with_response_id to validate success responses against an explicit expected discriminant (while preserving remote-error precedence).
  • Add protocol-level tests that round-trip request/response bytes via the EC-side serializer/deserializer to lock the canonical wire contract.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ec-service-lib/src/services/time_alarm.rs Adds timer value relay support with typed request parsing, explicit response-discriminant validation, and contract-focused tests preserving the existing AML ABI.
ec-service-lib/src/services/ec_relay.rs Factors out invoke_request_with_response_id to support commands whose success response discriminant differs from the request message id, plus targeted tests for discriminant validation and error precedence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move the checked command-byte-skipping zerocopy parser into the services module so Thermal and TimeAlarm use one implementation and one pair of boundary tests.

Assisted-by: GitHub Copilot:gpt-5.6-sol

Copilot-Session: d2609ceb-d6c1-4dab-a4bd-3e4c6eb98def

@williampMSFT williampMSFT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@dymk
dymk merged commit 82a5de2 into OpenDevicePartnership:main Jul 21, 2026
10 checks passed
@dymk
dymk deleted the dymk/time-alarm-timer-set-get branch July 21, 2026 20:40
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.

4 participants