Skip to content

Support TLS#156

Merged
CvvT merged 3 commits intomainfrom
thread_local_storage
Jun 23, 2025
Merged

Support TLS#156
CvvT merged 3 commits intomainfrom
thread_local_storage

Conversation

@CvvT
Copy link
Contributor

@CvvT CvvT commented Jun 17, 2025

This PR tries to address #66. Similar to how libc uses fs on x86_64 (or gs on x86) for thread-local storage, we could use the other one (i.e., gs on x86_64 and fs on x86) for litebox's TLS.

Note that on x86_64, we can directly modify fs/gs base, while on x86, we have to call syscall set_thread_area to add an entry to GDT and update fs selector to point to the new entry.

@CvvT CvvT requested a review from wdcui June 17, 2025 00:10
Copy link
Member

@wdcui wdcui left a comment

Choose a reason for hiding this comment

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

Looks good to me. I left one minor comment/question.

@CvvT CvvT force-pushed the thread_local_storage branch from cd60fed to ad0a6f4 Compare June 17, 2025 17:30
@CvvT CvvT requested a review from jaybosamiya-ms June 18, 2025 17:37
@CvvT CvvT force-pushed the thread_local_storage branch 4 times, most recently from ae60479 to d996499 Compare June 21, 2025 01:08
Copy link
Member

@jaybosamiya-ms jaybosamiya-ms left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

CvvT and others added 3 commits June 23, 2025 10:07
Co-authored-by: Jay Bosamiya (Microsoft) <jayb@microsoft.com>
@CvvT CvvT force-pushed the thread_local_storage branch from 403c460 to dbfd54b Compare June 23, 2025 17:09
@github-actions
Copy link

🤖 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.

@CvvT CvvT merged commit 89075c2 into main Jun 23, 2025
6 checks passed
@CvvT CvvT deleted the thread_local_storage branch June 23, 2025 17:16
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.

3 participants