Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Remove platform singletons from the LVBS platform and OP-TEE shim - #1127

Open
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux
Open

Remove platform singletons from the LVBS platform and OP-TEE shim#1127
Sangho Lee (sangho2) wants to merge 2 commits into
mainfrom
sanghle/no_plat_mux

Conversation

@sangho2

@sangho2Sangho Lee (sangho2) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes platform singletons from the LVBS platform and OP-TEE shim crates, allowing us to drop litebox_platform_multiplex completely. Refactor both crates at once because they relied on the same GlobalVmapManager which is now removed as well.

@sangho2

Copy link
Copy Markdown
ContributorAuthor

A sequel of #1056

@sangho2Sangho Lee (sangho2) changed the title [DRAFT] Remove platform singletons from the LVBS platform and OP-TEE shimRemove platform singletons from the LVBS platform and OP-TEE shimAug 5, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 5, 2026 21:48
@praveen-pk

Copy link
Copy Markdown
Contributor

This is rather a large PR. would be nice if this can be broken down to smaller commits.

Overall, the PR LGTM!

@wdcui

Copy link
Copy Markdown
Member

Jay Bosamiya (Microsoft) (@jaybosamiya-ms) , can you help review this PR? Thanks!

@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) , the agent found the following issue:

Medium — OpteeShim unintentionally loses Clone — litebox_shim_optee/src/lib.rs:292 . #[derive(Clone)] adds Platform: Clone , but neither platform implements it. Replace the derive with a manual Clone impl that clones the inner Arc .

@github-actions

Copy link
Copy Markdown

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

Click for details
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_common_linux::physical_pointers::PhysMutPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:122, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:117
litebox_common_linux::physical_pointers::PhysMutPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:165, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:165
litebox_common_linux::physical_pointers::PhysMutPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:200, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:204
litebox_common_linux::physical_pointers::PhysConstPtr::new takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:469, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:472
litebox_common_linux::physical_pointers::PhysConstPtr::with_contiguous_pages takes 2 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:479, but now takes 3 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:486
litebox_common_linux::physical_pointers::PhysConstPtr::with_usize takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/physical_pointers.rs:490, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:501
--- 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.50.0/src/lints/repr_c_removed.ron
Failed in:
struct PhysMutPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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.50.0/src/lints/trait_missing.ron
Failed in:
trait litebox_common_linux::vmap::GlobalVmapManager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_linux/src/vmap.rs:126
--- failure type_const_generic_reordered: type const generics were reordered ---
Description:
A type's definition now requires a generic type parameter where a const generic previously stood. Uses of this type that supplied that const generic will be broken since a generic type is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_const_generic_reordered.ron
Failed in:
struct PhysMutPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect const ALIGN in the place of type T in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_generic_type_reordered: type generic types were reordered ---
Description:
A type's definition now requires a const generic parameter where a generic type previously stood. Uses of this type that supplied that generic type will be broken since a const generic is now required instead.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_generic_type_reordered.ron
Failed in:
struct PhysMutPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
struct PhysConstPtr used to expect type V in the place of const ALIGN in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct PhysMutPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:85
Struct PhysConstPtr (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_common_linux/src/physical_pointers.rs:458
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type LvbsVtl1Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl1Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:587
type LvbsVtl0PrivilegedWriter is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0PrivilegedWriter is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
type LvbsVtl0Gate is no longer UnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
type LvbsVtl0Gate is no longer RefUnwindSafe, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:578
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_platform_lvbs::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:455
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_platform_lvbs::set_platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2011
function litebox_platform_lvbs::platform_low, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/lib.rs:2021
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vtl_switch::vtl_switch_init now takes 0 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vtl_switch.rs:240
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_platform_lvbs::mshv::vsm::LvbsVtl1Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:613, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:620
litebox_platform_lvbs::mshv::vsm::LvbsVtl0PrivilegedWriter::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:622, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:629
litebox_platform_lvbs::mshv::vsm::LvbsVtl0Gate::mint takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_platform_lvbs/src/mshv/vsm.rs:604, but now takes 1 parameters in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:611
--- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes ---
Description:
A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken.
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_mismatched_generic_lifetimes.ron
Failed in:
Struct LvbsVtl0PrivilegedWriter (0 -> 1 lifetime params) in /home/runner/work/litebox/litebox/litebox_platform_lvbs/src/mshv/vsm.rs:601
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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.50.0/src/lints/enum_missing.ron
Failed in:
enum litebox_shim_optee::Vmap, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:1531
--- failure feature_missing: package feature removed or renamed ---
Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/feature_missing.ron
Failed in:
feature platform_linux_userland in the package's Cargo.toml
feature platform_lvbs in the package's Cargo.toml
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function 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.50.0/src/lints/function_missing.ron
Failed in:
function litebox_shim_optee::session::session_manager, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/session.rs:485
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron
Failed in:
litebox_shim_optee::msg_handler::decode_ta_request now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
litebox_shim_optee::msg_handler::update_optee_msg_args now takes 7 parameters instead of 6, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
litebox_shim_optee::msg_handler::handle_optee_smc_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
litebox_shim_optee::msg_handler::handle_optee_msg_args now takes 2 parameters instead of 1, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
litebox_shim_optee::msg_handler::read_optee_msg_args_from_phys now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---
Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_requires_different_generic_type_params.ron
Failed in:
function decode_ta_request (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:412
function update_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:604
function handle_optee_smc_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:212
function handle_optee_msg_args (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:335
function read_optee_msg_args_from_phys (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/msg_handler.rs:182
function generate_identity_signing_key (0 -> 1 generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:43
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron
Failed in:
litebox_shim_optee::OpteeShimBuilder::new takes 0 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_shim_optee/src/lib.rs:133, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:173
--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---
Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_requires_more_generic_type_params.ron
Failed in:
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
trait OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
trait OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
trait OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
trait LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
trait OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---
Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_requires_more_generic_type_params.ron
Failed in:
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct SessionManager (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:458
Struct OpteeShimEntrypoints (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:84
Struct OpteeShimBuilder (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:157
Struct OpteeShim (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:292
Struct LoadedProgram (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/lib.rs:415
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct TaInstance (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:128
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Struct SessionToken (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:396
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178
Enum OpenSessionTarget (0 -> 1 required generic types) in /home/runner/work/litebox/litebox/litebox_shim_optee/src/session.rs:178

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Sangho for getting rid of the final bits of the multiplex! The PR generally looks good to me. Most of it is fairly mechanical, so I haven't reviewed every line, but have done a look through for any bits that stood out to me, and have pointed out a few very minor nits. If there are any parts that you think I should specifically take a closer look at or sanity check, let me know.

Comment on lines -40 to +51
unsafe { crate::platform_low().vmap_privileged(pages, perms) }
unsafe { self.0.vmap_privileged(pages, perms) }

Choose a reason for hiding this comment

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

Nit: do we want to name it as self.platform_low for consistency/readability? Or just self.platform? It is possible .0 good enough. No response needed here, feel free to mark as resolved either way.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, self.0 sometimes looks bad. self.platform might work well. Let me figure out better option.

Comment on lines +501 to +505
// NOTE: the session manager singleton lives in the composition root (each
// runner), not here. A `static` cannot name a generic parameter, and a shim
// instance is built per session, so the shim has nowhere to put it. The runner
// knows its concrete platform, so it can hold the `static` and hand out
// `&'static SessionManager<ConcretePlatform>`.

Choose a reason for hiding this comment

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

Nit: this feels like a comment left in by an agent removing code leaving breadcrumbs; not sure it needs to stay?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch. Let me go over all comments again.

@sangho2Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 18, 2026
@sangho2

Copy link
Copy Markdown
ContributorAuthor

Let me merge this one later because it might conflict with ongoing dynamic TA loading efforts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:blocked-on-other-changesOther changes/PRs to be handled first. Label not needed for non-main changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sangho2@praveen-pk@wdcui@jaybosamiya-ms