Skip to content

Refactor OP-TEE message types and add RPC args support#664

Open
sangho2 wants to merge 9 commits intomainfrom
sanghle/optee/msgs_v2
Open

Refactor OP-TEE message types and add RPC args support#664
sangho2 wants to merge 9 commits intomainfrom
sanghle/optee/msgs_v2

Conversation

@sangho2
Copy link
Contributor

@sangho2 sangho2 commented Feb 13, 2026

This PR refactors the OP-TEE message types and related functions to handle variable-length parameters. It also supports OP-TEE RPC message types to enable future RPC implementation. In addition, it leverages zerocopy to remove some unsafe operations.

#641

@sangho2 sangho2 marked this pull request as ready for review February 13, 2026 03:32
@sangho2 sangho2 force-pushed the sanghle/optee/msgs_v2 branch from 275c28f to e2e91e2 Compare February 13, 2026 05:07
Copy link
Member

@wdcui wdcui left a comment

Choose a reason for hiding this comment

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

Overall the code looks good to me. I left some minor comments below.

@sangho2 sangho2 force-pushed the sanghle/optee/msgs_v2 branch 4 times, most recently from 6f418b4 to 6d7ecf9 Compare February 15, 2026 22:40
@sangho2 sangho2 force-pushed the sanghle/optee/msgs_v2 branch from 6d7ecf9 to 8328c8f Compare February 16, 2026 03:46
@sangho2 sangho2 force-pushed the sanghle/optee/msgs_v2 branch from 63fb7b4 to 403cf1d Compare February 17, 2026 02:41
@github-actions
Copy link

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure enum_struct_variant_field_added: pub enum struct variant field added ---

Description:
An enum's exhaustive struct variant has a new field, which has to be included when constructing or matching on this variant.
        ref: https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/enum_struct_variant_field_added.ron

Failed in:
  field rpc_args of variant OpteeSmcResult::CallWithArg in /home/runner/work/litebox/litebox/litebox_common_optee/src/lib.rs:2113

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/inherent_method_missing.ron

Failed in:
  UteeParamsTypes::new, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:415
  UteeParamsTypes::into_bytes, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:415
  UteeParamsTypes::from_bytes, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:415
  UteeParamsTypes::type_0_or_err, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:418
  UteeParamsTypes::with_type_0, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:418
  UteeParamsTypes::with_type_0_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:418
  UteeParamsTypes::set_type_0_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:418
  UteeParamsTypes::type_1_or_err, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:419
  UteeParamsTypes::with_type_1, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:419
  UteeParamsTypes::with_type_1_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:419
  UteeParamsTypes::set_type_1_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:419
  UteeParamsTypes::type_2_or_err, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:420
  UteeParamsTypes::with_type_2, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:420
  UteeParamsTypes::with_type_2_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:420
  UteeParamsTypes::set_type_2_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:420
  UteeParamsTypes::type_3_or_err, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:421
  UteeParamsTypes::with_type_3, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:421
  UteeParamsTypes::with_type_3_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:421
  UteeParamsTypes::set_type_3_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:421
  OpteeMsgAttr::new, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1348
  OpteeMsgAttr::into_bytes, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1348
  OpteeMsgAttr::from_bytes, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1348
  OpteeMsgAttr::typ, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1353
  OpteeMsgAttr::typ_or_err, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1353
  OpteeMsgAttr::with_typ, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1353
  OpteeMsgAttr::with_typ_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1353
  OpteeMsgAttr::set_typ, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1353
  OpteeMsgAttr::set_typ_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1353
  OpteeMsgAttr::meta_or_err, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1354
  OpteeMsgAttr::with_meta, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1354
  OpteeMsgAttr::with_meta_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1354
  OpteeMsgAttr::set_meta, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1354
  OpteeMsgAttr::set_meta_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1354
  OpteeMsgAttr::noncontig_or_err, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1355
  OpteeMsgAttr::with_noncontig, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1355
  OpteeMsgAttr::with_noncontig_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1355
  OpteeMsgAttr::set_noncontig, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1355
  OpteeMsgAttr::set_noncontig_checked, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1355

--- failure repr_c_removed: repr(C) removed ---

Description:
repr(C) was removed from a type. This can cause its memory layout to change, breaking FFI use cases.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#repr-c-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/repr_c_removed.ron

Failed in:
  struct UteeParamsTypes in /home/runner/work/litebox/litebox/litebox_common_optee/src/lib.rs:422
  struct OpteeMsgAttr in /home/runner/work/litebox/litebox/litebox_common_optee/src/lib.rs:1450

--- failure union_missing: pub union removed or renamed ---

Description:
A publicly-visible union cannot be imported by its prior path. A `pub use` may have been removed, or the union itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/union_missing.ron

Failed in:
  union litebox_common_optee::OpteeMsgParamUnion, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/aa028baa08c98942826f673ebeb18e6d6f5baf6d/litebox_common_optee/src/lib.rs:1311

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.

2 participants