MCPcopy Create free account
hub / github.com/coreboot/coreboot / print_sgx

Function print_sgx

util/inteltool/cpu.c:194–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192#endif
193
194int print_sgx(void)
195{
196 int error = -1;
197#ifndef __DARWIN__
198 int ncpus = get_number_of_cpus();
199 int i = 0;
200
201 printf("\n============= Dumping INTEL SGX status =============");
202
203 if (ncpus < 1) {
204 perror("Failed to get number of CPUs");
205 error = -1;
206 } else {
207 printf("\nNumber of CPUs = %d\n", ncpus);
208 for (i = 0; i < ncpus ; i++) {
209
210 printf("------------- CPU %d ----------------\n", i);
211 printf("SGX supported : %s\n",
212 is_sgx_supported(i) ? "YES" : "NO");
213 printf("SGX enabled : %s\n",
214 is_sgx_enabled(i) ? "YES" : "NO");
215 printf("Feature Control locked : %s\n",
216 is_sgx_locked(i) ? "YES" : "NO");
217 }
218 error = 0;
219 }
220 printf("====================================================\n");
221#endif
222 return error;
223}
224
225static int is_tme_supported(void)
226{

Callers 1

inteltool.cFile · 0.85

Calls 6

printfFunction · 0.85
perrorFunction · 0.85
is_sgx_enabledFunction · 0.85
is_sgx_lockedFunction · 0.85
get_number_of_cpusFunction · 0.70
is_sgx_supportedFunction · 0.70

Tested by

no test coverage detected