Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #1568
Closed
Open
Issue created Dec 05, 2014 by Derek Bruening@derekbrueningContributor

TLS for MacOS 64-bit

Split from #58 as this may have some overlap with ARM work. I'm going to paste my notes here:

** TODO 64-bit: can only set gs, not fs, and can't read gs

For 64-bit: thread_fast_set_cthread_self64 which sets MSR_IA32_KERNEL_GS_BASE. May not be a way to set MSR for FS: no reference to MSR_IA32_KERNEL_FS_BASE in xnu sources.

*** TODO option #1 (closed) for DR: is there some free padding space in TLS mmap?

Maybe beyond pthread data structs, since stack beyond that is page-aligned?

*** TODO option #2 (closed) for DR: early injection and use privlib w/ larger mmap + app mangling?

Add extra page to TLS mmap, maybe to the left so out of way (16-bit offs will still reach).

We'd need to mangle the app's references even w/o priv loader.

*** TODO option #3 for DR: like Windows, can we steal some slots from app's TLS?

Like Windows, request official TLS slots like app would and take ~20 (and ensure directly addressable)?

*** TODO for priv libs, have to mangle app's refs

If go w/ option #2 (closed), have to do so even w/o priv libs.

*** TODO how read current gs? *** TODO on Ivybridge+, use OP_wrfsbase or OP_wrgsbase?! *** TODO steal register? later update: leverage ARM code? Though this only helps for the code cache and our gencode: in our C code we need a separate TLS mechanism.

Assignee
Assign to
Time tracking