| 192 | #endif |
| 193 | |
| 194 | int 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 | |
| 225 | static int is_tme_supported(void) |
| 226 | { |
no test coverage detected