Skip to main content

Milestone 7

Milestone Status

This milestone is delivered.

Background

OP-TEE's architecture-specific trusted-application context management must preserve floating-point and vector registers in addition to the associated control state. Lazy switching is unsuitable because supervisor mode can modify the FS and VS status bits without reliably revealing actual register use across privilege levels. Hidden state changes can cause correctness failures, data leakage, or side-channel exposure. Frequent floating-point and vector use also reduces the expected performance benefit of trapping lazily, making eager save and restore the preferred approach.

Milestone Description

Milestone 7 extends the architecture-specific trusted-application context so that floating-point and vector registers and their associated control state are preserved across context switches.


Milestone Update

This milestone is delivered and in review by the upstream OP-TEE community.

The submitted floating-point and vector context-switch patchsets correspond to the two implementation deliverables. The work has been split into separate upstream pull requests that remain under review, so the milestone is delivered but not yet done.

PR #7872 introduces macro-driven assembly routines for saving and restoring the complete RISC-V floating-point state, including all 32 floating-point registers and the fcsr register. (reworked at PR #7951)

PR #7876 integrates floating-point and Vector state management with the OP-TEE thread architecture. It adds support for preserving secure, non-secure, kernel and user TA contexts across thread switches, system calls and exceptions. (reworked at PR #7961)

Upstream Submissions

The following OP-TEE upstream submissions relate to this milestone:

Date SubmittedSubmissionPull RequestPatchset Status
Aug 25, 2026Riscv fp state ctxPR #7951Under Review
Aug 27, 2026Riscv vector contextPR #7961Under Review

Requirements

  • Use eager context switching for floating-point and vector state.
  • Save and restore the complete floating-point register state required by a trusted application.
  • Save and restore the complete vector register state required by a trusted application.
  • Preserve the associated floating-point, vector, and status CSRs.
  • Do not rely on lazy switching based only on supervisor-controlled FS and VS status.
  • Prevent register contents from leaking between trusted-application contexts or across privilege boundaries.
  • Validate repeated switches between contexts with distinct floating-point and vector state.

Deliverables

  • OP-TEE changes that eagerly save and restore trusted-application floating-point registers.
  • OP-TEE changes that eagerly save and restore trusted-application vector registers.
  • Tests demonstrating correct state preservation and isolation.