Linux Assemblycollection of fast libraries

Software Guard Extensions (SGX)

Intel Software Guard Extensions (SGX) provide two sets of instruction leaf functions to enable application software to instantiate a protected container, referred to as an enclave. The enclave instructions are organized as leaf functions under two instruction mnemonics: ENCLS (ring 0) and ENCLU (ring 3).

Contents

Tip: For detailed information about each instruction please read: Intel Architectures Software Developer’s Manual Volume 2: Instruction Set Reference, A-Z

Supervisor Instructions

Instruction📄Meaning
Setup
ENCLS[ECREATE]ℹ️Create an enclave
ENCLS[EINIT]ℹ️Initialize an enclave
ENCLS[EADD]ℹ️Add a page
ENCLS[EEXTEND]ℹ️Extend EPC page measurement
Eviction
ENCLS[EBLOCK]ℹ️Block an EPC page
ENCLS[ETRACK]ℹ️Activate EBLOCK checks
ENCLS[EWB]ℹ️Write back/invalidate an EPC page
ENCLS[EPA]ℹ️Add version array
Restoration
ENCLS[ELDB]ℹ️Load an EPC page as blocked
ENCLS[ELDBC]ℹ️Load an EPC page as blocked but with improved conflict handling for over-subscription
ENCLS[ELDU]ℹ️Load an EPC page as unblocked
ENCLS[ELDUC]ℹ️Load an EPC page as unblocked but with improved conflict handling for over-subscription
Dynamic Management
ENCLS[EAUG]ℹ️Add a page to an initialized enclave
ENCLS[EREMOVE]ℹ️Remove a page from EPC
ENCLS[EMODPR]ℹ️Restrict the permissions of an EPC page
ENCLS[EMODT]ℹ️Change the type of an EPC page
Debug
ENCLS[EDBGRD]ℹ️Read data by debugger
ENCLS[EDBGWR]ℹ️Write data by debugger

User Instructions

Instruction📄Meaning
Lifecycle Flow
ENCLU[EENTER]ℹ️Enter an Enclave
ENCLU[ERESUME]ℹ️Re-enter an Enclave
ENCLU[EEXIT]ℹ️Exit an Enclave
Memory Control
ENCLU[EACCEPT]ℹ️Accept changes to an EPC page
ENCLU[EACCEPTCOPY]ℹ️Initialize a pending page
ENCLU[EMODPE]ℹ️Extend an EPC page permissions
Security
ENCLU[EREPORT]ℹ️Create a cryptographic report
ENCLU[EGETKEY]ℹ️Create a cryptographic key

VMM Instructions

Instruction📄Meaning
ENCLV[EDECVIRTCHILD]ℹ️Decrement VIRTCHILDCNT in SECS
ENCLV[EINCVIRTCHILD]ℹ️Increment VIRTCHILDCNT in SECS
ENCLV[ESETCONTEXT]ℹ️Set the ENCLAVECONTEXT field in SECS
Copyright 2012-2026 Eugene Zamlinsky. All rights reserved.