Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

[Pal/Linux-SGX] Rename enclave_tls to pal_tcb_sgx #638

Closed
dimakuv opened this issue Apr 24, 2019 · 5 comments · Fixed by gramineproject/gramine#776
Closed

[Pal/Linux-SGX] Rename enclave_tls to pal_tcb_sgx #638

dimakuv opened this issue Apr 24, 2019 · 5 comments · Fixed by gramineproject/gramine#776

Comments

@dimakuv
Copy link
Contributor

dimakuv commented Apr 24, 2019

  • TLS stands for "Thread Local Storage" and is a memory area dedicated to storing app-specific thread-local variables.

  • TCB stands for "Thread Control Block" and contains thread-specific internal state such as thread ID, stack pointer, and saved registers.

The Linux PAL correctly defines the struct pal_tcb. The Linux-SGX PAL however defines the struct enclave_tls. The enclave_tls name is misleading and breaks uniformity of code (see e.g. #555).

I suggest to rename:

  • struct enclave_tls to struct pal_tcb_sgx
  • SET/GET_ENCLAVE_TLS to SET/GET_ENCLAVE_TCB
  • sgx_tls.h to sgx_tcb.h

If agreed, this change should be enacted after #555 is merged.

@yamahata
Copy link
Contributor

+1 for naming consistency.

@mkow
Copy link
Member

mkow commented Apr 24, 2019

+1, though I also don't like "TCB", as it's used in SGX nomenclature as "Trusted Code Base". But we probably won't find any better name.

@HW42
Copy link
Contributor

HW42 commented Apr 25, 2019

I also always read "trusted code base" first. But the suggested change seems reasonable.

@HW42
Copy link
Contributor

HW42 commented Apr 25, 2019

SGX calls it internal thread specific state TCS ("Thread Control Structure"). So something like GTCS (Graphene TCS, to avoid confusion with the SGX's TCS) would be an options. But this naming might be too SGX specific.

@dimakuv
Copy link
Contributor Author

dimakuv commented Apr 26, 2019

@HW42: TCS is too SGX-specific. I still prefer TCB.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants