Asylo
|
Enumerations | |
enum | AttributeBit { AttributeBit::INIT = 0, AttributeBit::DEBUG = 1, AttributeBit::MODE64BIT = 2, AttributeBit::PROVISIONKEY = 4, AttributeBit::INITTOKENKEY = 5, AttributeBit::KSS = 7, AttributeBit::FPU = 64 + 0, AttributeBit::SSE = 64 + 1, AttributeBit::AVX = 64 + 2, AttributeBit::BNDREG = 64 + 3, AttributeBit::BNDCSR = 64 + 4, AttributeBit::OPMASK = 64 + 5, AttributeBit::ZMM_HI256 = 64 + 6, AttributeBit::HI16_ZMM = 64 + 7, AttributeBit::PKRU = 64 + 9 } |
SGX defines 128 bits of enclave attributes, which are located in the SECS (Secure Enclave Control Structure) of the enclave. More... | |
enum | MiscselectBit { MiscselectBit::EXINFO = 0 } |
The following enum defines the various MISCSELECT bits and assigns them a value that is same as their bit position in the SECS MISCSELECT bit vector. More... | |
Functions | |
Attributes | operator & (const Attributes &lhs, const Attributes &rhs) |
Computes the bitwise AND of two Attributes protos. More... | |
bool | operator== (const Attributes &lhs, const Attributes &rhs) |
Checks two Attributes protos for equality. More... | |
bool | operator!= (const Attributes &lhs, const Attributes &rhs) |
Checks two Attributes protos for inequality. More... | |
Status | SetAttributeBit (AttributeBit bit, Attributes *attributes) |
Sets the given bit of attributes to true, or returns a non-OK Status if the bit was invalid. More... | |
Status | ClearAttributeBit (AttributeBit bit, Attributes *attributes) |
Sets the given bit of attributes to false, or returns a non-OK Status if the bit was invalid. More... | |
StatusOr< bool > | IsAttributeBitSet (AttributeBit bit, const Attributes &attributes) |
Returns whether the given bit of attributes is set, or a non-OK Status if the bit was invalid. More... | |
std::vector< absl::string_view > | GetPrintableAttributeList (const Attributes &attributes) |
Returns a printable list of the bits set in attributes . More... | |
bool | operator== (const Miscselect &lhs, const Miscselect &rhs) |
Checks two Miscselect protos for equality. More... | |
bool | operator!= (const Miscselect &lhs, const Miscselect &rhs) |
Checks two Miscselect protos for inequality. More... | |
Status | SetMiscselectBit (MiscselectBit bit, uint32_t *miscselect) |
Sets the given bit of miscselect to true, or returns a non-OK Status if the bit was invalid. More... | |
Status | SetMiscselectBit (MiscselectBit bit, Miscselect *miscselect) |
Status | ClearMiscselectBit (MiscselectBit bit, uint32_t *miscselect) |
Sets the given bit of miscselect to false, or returns a non-OK Status if the bit was invalid. More... | |
Status | ClearMiscselectBit (MiscselectBit bit, Miscselect *miscselect) |
StatusOr< bool > | IsMiscselectBitSet (MiscselectBit bit, uint32_t miscselect) |
Returns whether the given bit of miscselect is set, or returns a non-OK Status if the bit was invalid. More... | |
StatusOr< bool > | IsMiscselectBitSet (MiscselectBit bit, const Miscselect &miscselect) |
std::vector< absl::string_view > | GetPrintableMiscselectList (uint32_t miscselect) |
Returns a printable list of the bits set in miscselect . More... | |
std::vector< absl::string_view > | GetPrintableMiscselectList (const Miscselect &miscselect) |
Variables | |
const AttributeBit | kAllAttributeBits [15] |
All valid bit positions in the ATTRIBUTES bit vector. More... | |
const size_t | kNumAttributeFlagBits |
The number of ATTRIBUTES flag bits. More... | |
const size_t | kNumAttributeXfrmBits |
The number of ATTRIBUTES XFRM bits. More... | |
const size_t | kNumAttributeBits |
The total number of ATTRIBUTES bits. More... | |
const uint64_t | kValidAttributeFlagsBitmask |
A bitmask over all valid ATTRIBUTES flag bits. More... | |
const uint64_t | kValidAttributeXfrmBitmask |
A bitmask over all valid ATTRIBUTES XFRM bits. More... | |
const MiscselectBit | kAllMiscselectBits [1] |
All valid bit positions in the MISCSELECT bit vector. More... | |
const size_t | kNumMiscselectBits |
The total number of MISCSELECT bits. More... | |
const uint32_t | kValidMiscselectBitmask |
A bitmask over all valid MISCSELECT bits. More... | |
|
strong |
SGX defines 128 bits of enclave attributes, which are located in the SECS (Secure Enclave Control Structure) of the enclave.
The lower 64 bits of these attributes are treated as individual flags, whereas the upper 64 bits are collectively called XFRM (XSAVE Feature Request Mask). This enum defines the various attribute bits and assigns them a value that is same as their bit position in the SECS attributes bit vector. The names of these bits are taken verbatim from the Intel SDM (Software Developer's Manual), volume 3D (see https://software.intel.com/en-us/articles/intel-sdm).
|
strong |
The following enum defines the various MISCSELECT bits and assigns them a value that is same as their bit position in the SECS MISCSELECT bit vector.
The names of these bits are taken verbatim from the Intel SDM (Software Developer's Manual).
Enumerator | |
---|---|
EXINFO | Indicates that information about page faults and GP exceptions that occurred inside an enclave will be saved upon an asynchronous exit. |
Status asylo::sgx::ClearAttributeBit | ( | AttributeBit | bit, |
Attributes * | attributes | ||
) |
Sets the given bit
of attributes
to false, or returns a non-OK Status if the bit
was invalid.
Status asylo::sgx::ClearMiscselectBit | ( | MiscselectBit | bit, |
uint32_t * | miscselect | ||
) |
Sets the given bit
of miscselect
to false, or returns a non-OK Status if the bit
was invalid.
Status asylo::sgx::ClearMiscselectBit | ( | MiscselectBit | bit, |
Miscselect * | miscselect | ||
) |
std::vector<absl::string_view> asylo::sgx::GetPrintableAttributeList | ( | const Attributes & | attributes | ) |
Returns a printable list of the bits set in attributes
.
std::vector<absl::string_view> asylo::sgx::GetPrintableMiscselectList | ( | uint32_t | miscselect | ) |
Returns a printable list of the bits set in miscselect
.
std::vector<absl::string_view> asylo::sgx::GetPrintableMiscselectList | ( | const Miscselect & | miscselect | ) |
StatusOr<bool> asylo::sgx::IsAttributeBitSet | ( | AttributeBit | bit, |
const Attributes & | attributes | ||
) |
Returns whether the given bit
of attributes
is set, or a non-OK Status if the bit
was invalid.
StatusOr<bool> asylo::sgx::IsMiscselectBitSet | ( | MiscselectBit | bit, |
uint32_t | miscselect | ||
) |
Returns whether the given bit
of miscselect
is set, or returns a non-OK Status if the bit
was invalid.
StatusOr<bool> asylo::sgx::IsMiscselectBitSet | ( | MiscselectBit | bit, |
const Miscselect & | miscselect | ||
) |
Attributes asylo::sgx::operator& | ( | const Attributes & | lhs, |
const Attributes & | rhs | ||
) |
Computes the bitwise AND of two Attributes protos.
bool asylo::sgx::operator!= | ( | const Miscselect & | lhs, |
const Miscselect & | rhs | ||
) |
Checks two Miscselect protos for inequality.
bool asylo::sgx::operator!= | ( | const Attributes & | lhs, |
const Attributes & | rhs | ||
) |
Checks two Attributes protos for inequality.
bool asylo::sgx::operator== | ( | const Miscselect & | lhs, |
const Miscselect & | rhs | ||
) |
Checks two Miscselect protos for equality.
bool asylo::sgx::operator== | ( | const Attributes & | lhs, |
const Attributes & | rhs | ||
) |
Checks two Attributes protos for equality.
Status asylo::sgx::SetAttributeBit | ( | AttributeBit | bit, |
Attributes * | attributes | ||
) |
Sets the given bit
of attributes
to true, or returns a non-OK Status if the bit
was invalid.
Status asylo::sgx::SetMiscselectBit | ( | MiscselectBit | bit, |
uint32_t * | miscselect | ||
) |
Sets the given bit
of miscselect
to true, or returns a non-OK Status if the bit
was invalid.
Status asylo::sgx::SetMiscselectBit | ( | MiscselectBit | bit, |
Miscselect * | miscselect | ||
) |
const AttributeBit asylo::sgx::kAllAttributeBits[15] |
All valid bit positions in the ATTRIBUTES bit vector.
const MiscselectBit asylo::sgx::kAllMiscselectBits[1] |
All valid bit positions in the MISCSELECT bit vector.
const size_t asylo::sgx::kNumAttributeBits |
The total number of ATTRIBUTES bits.
const size_t asylo::sgx::kNumAttributeFlagBits |
The number of ATTRIBUTES flag bits.
const size_t asylo::sgx::kNumAttributeXfrmBits |
The number of ATTRIBUTES XFRM bits.
const size_t asylo::sgx::kNumMiscselectBits |
The total number of MISCSELECT bits.
const uint64_t asylo::sgx::kValidAttributeFlagsBitmask |
A bitmask over all valid ATTRIBUTES flag bits.
const uint64_t asylo::sgx::kValidAttributeXfrmBitmask |
A bitmask over all valid ATTRIBUTES XFRM bits.
const uint32_t asylo::sgx::kValidMiscselectBitmask |
A bitmask over all valid MISCSELECT bits.