cpu_sgx_t(3)
π NAME π
okay so this is cpu_sgx_t(3) from the libcpuid Library Functions Manual β and it's literally the struct that contains information about the SGX features of the processor. Example usage: yes bestie, we're getting into it.
β¨ SYNOPSIS β¨
#include <libcpuid.h>
π Data Fields π
uint32_t presentuint8_t max_enclave_32bituint8_t max_enclave_64bituint8_t flags [SGX_FLAGS_MAX]int num_epc_sectionsuint32_t misc_selectuint64_t secs_attributesuint64_t secs_xfrm
πΈ Detailed Description πΈ
This contains information about SGX features of the processor. Example usage:
...
struct cpu_raw_data_t raw;
struct cpu_id_t id;
if (cpuid_get_raw_data(&raw) == 0 && cpu_identify(&raw, &id) == 0 && id.sgx.present) {
printf("SGX is present.\n");
printf("SGX1 instructions: %s.\n", id.sgx.flags[INTEL_SGX1] ? "present" : "absent");
printf("SGX2 instructions: %s.\n", id.sgx.flags[INTEL_SGX2] ? "present" : "absent");
printf("Max 32-bit enclave size: 2^%d bytes.\n", id.sgx.max_enclave_32bit);
printf("Max 64-bit enclave size: 2^%d bytes.\n", id.sgx.max_enclave_64bit);
for (int i = 0; i < id.sgx.num_epc_sections; i++) {
struct cpu_epc_t epc = cpuid_get_epc(i, NULL);
printf("EPC section #%d: address = %x, size = %d bytes.\n", epc.address, epc.size);
}
} else {
printf("SGX is not present.\n");
}
π¦ Field Documentation π¦
uint8_t cpu_sgx_t::flags[SGX_FLAGS_MAX]
contains SGX feature flags. See the INTEL_SGX* macros below.
uint8_t cpu_sgx_t::max_enclave_32bit
Max enclave size in 32-bit mode. This is a power-of-two value: if it is "31", then the max enclave size is 2^31 bytes (2 GiB).
uint8_t cpu_sgx_t::max_enclave_64bit
Max enclave size in 64-bit mode. This is a power-of-two value: if it is "36", then the max enclave size is 2^36 bytes (64 GiB).
uint32_t cpu_sgx_t::misc_select
bit vector of the supported extended features that can be written to the MISC region of the SSA (Save State Area)
int cpu_sgx_t::num_epc_sections
number of Enclave Page Cache (EPC) sections. Info for each section is available through the cpuid_get_epc() function
uint32_t cpu_sgx_t::present
Whether SGX is present (boolean)
uint64_t cpu_sgx_t::secs_attributes
a bit vector of the attributes that can be set to SECS.ATTRIBUTES via ECREATE. Corresponds to bits 0-63 (incl.) of SECS.ATTRIBUTES.
uint64_t cpu_sgx_t::secs_xfrm
a bit vector of the bits that can be set in the XSAVE feature request mask; Corresponds to bits 64-127 of SECS.ATTRIBUTES.
π Author π
Generated automatically by Doxygen for libcpuid from the source code.
okay bye bestie π
β¨ this has been the libcpuid Library Functions Manual's cpu_sgx_t(3) page β the footer situation is just libcpuid and cpu_sgx_t(3), and there's no date line printed, so that's the whole footer vibe fr fr π«Άπ
π¦ where this page comes from
- arch rolling: libcpuid 0.8.2-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms