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

Function print_sme

util/amdtool/cpu.c:186–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184#endif
185
186static 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
220static bool is_sev_supported(void)
221{

Callers 1

print_cpu_infoFunction · 0.85

Calls 6

printfFunction · 0.85
perrorFunction · 0.85
is_sme_supportedFunction · 0.85
is_sme_enabledFunction · 0.85
is_sme_hmk_enabledFunction · 0.85
get_number_of_cpusFunction · 0.70

Tested by

no test coverage detected