| 184 | #endif |
| 185 | |
| 186 | static int print_sme(void) |
| 187 | { |
| 188 | int error = -1; |
| 189 | #ifndef __DARWIN__ |
| 190 | int ncpus = get_number_of_cpus(); |
| 191 | int i = 0; |
| 192 | bool sme_supported; |
| 193 | |
| 194 | printf("\n============= Dumping AMD SME status =============\n"); |
| 195 | |
| 196 | if (ncpus < 1) { |
| 197 | perror("Failed to get number of CPUs"); |
| 198 | error = -1; |
| 199 | } else { |
| 200 | sme_supported = is_sme_supported(); |
| 201 | for (i = 0; i < ncpus ; i++) { |
| 202 | |
| 203 | printf("------------- CPU %d ----------------\n", i); |
| 204 | printf("SME supported : %s\n", |
| 205 | sme_supported ? "YES" : "NO"); |
| 206 | if (sme_supported) { |
| 207 | printf("SME enabled : %s\n", |
| 208 | is_sme_enabled(i) ? "YES" : "NO"); |
| 209 | printf("SME-HMK enabled : %s\n", |
| 210 | is_sme_hmk_enabled(i) ? "YES" : "NO"); |
| 211 | } |
| 212 | } |
| 213 | error = 0; |
| 214 | } |
| 215 | printf("====================================================\n\n"); |
| 216 | #endif |
| 217 | return error; |
| 218 | } |
| 219 | |
| 220 | static bool is_sev_supported(void) |
| 221 | { |
no test coverage detected