Skip to content

Add preemption timer to bound TA execution#907

Merged
sangho2 merged 8 commits into
mainfrom
sanghle/lvbs/timebomb
Jun 27, 2026
Merged

Add preemption timer to bound TA execution#907
sangho2 merged 8 commits into
mainfrom
sanghle/lvbs/timebomb

Conversation

@sangho2

@sangho2 sangho2 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This PR adds a timer-based mechanism for preempting TAs on the LVBS platform. In OP-TEE, TA execution is unbounded because there is no secure-world scheduler: if a TA spins in an infinite loop, it can hold the (V)CPU indefinitely. On Arm TrustZone, the normal world can eventually regain control by interrupting the secure world. However, in Hyper-V, VTL0 is not allowed to interrupt VTL1.
To overcome this problem, this PR implements a VTL1-local one-shot preemption timer based on the Hyper-V synthetic timer to limit the execution time of each TA command invocation (which could span multiple syscalls). If it fires, the VTL1 kernel kills the TA and returns back to VTL0.

@sangho2 sangho2 changed the title Add local APIC timebomb for TA preemption Add timebomb for TA preemption Jun 10, 2026
@sangho2 sangho2 changed the title Add timebomb for TA preemption Add LVBS timer for TA preemption Jun 10, 2026
@sangho2 sangho2 changed the title Add LVBS timer for TA preemption Preemption timer to bound TA execution Jun 10, 2026
@sangho2 sangho2 changed the title Preemption timer to bound TA execution Add preemption timer to bound TA execution Jun 10, 2026
@sangho2 sangho2 force-pushed the sanghle/lvbs/timebomb branch 3 times, most recently from 7bea3f7 to e5adb24 Compare June 10, 2026 18:10
@sangho2 sangho2 marked this pull request as ready for review June 10, 2026 18:15
@sangho2 sangho2 force-pushed the sanghle/lvbs/timebomb branch from 4ac37cb to d795648 Compare June 10, 2026 19:53

@sangho2 sangho2 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

.

@sangho2 sangho2 force-pushed the sanghle/lvbs/timebomb branch 3 times, most recently from d2d638b to d7f79ae Compare June 12, 2026 17:03
@sangho2 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 Jun 15, 2026
@sangho2

sangho2 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Potential conflict with PR #865. Merge it first and then this one.

@wdcui wdcui left a comment

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.

LGTM. Thanks!

Comment thread litebox_platform_lvbs/Cargo.toml
Comment thread litebox_platform_lvbs/src/lib.rs Outdated
Comment thread litebox_platform_lvbs/src/arch/x86/timer.rs
@sangho2 sangho2 removed the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Jun 26, 2026
@sangho2 sangho2 force-pushed the sanghle/lvbs/timebomb branch from 4fa6489 to 677b90c Compare June 26, 2026 19:34
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

@sangho2 sangho2 added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 58c99c7 Jun 27, 2026
14 checks passed
@sangho2 sangho2 deleted the sanghle/lvbs/timebomb branch June 27, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants