Dump details about a single machine check. */
| 382 | |
| 383 | /* Dump details about a single machine check. */ |
| 384 | static void |
| 385 | mca_log(const struct mca_record *rec) |
| 386 | { |
| 387 | uint16_t mca_error; |
| 388 | |
| 389 | if (mca_mute(rec)) |
| 390 | return; |
| 391 | |
| 392 | printf("MCA: Bank %d, Status 0x%016llx\n", rec->mr_bank, |
| 393 | (long long)rec->mr_status); |
| 394 | printf("MCA: Global Cap 0x%016llx, Status 0x%016llx\n", |
| 395 | (long long)rec->mr_mcg_cap, (long long)rec->mr_mcg_status); |
| 396 | printf("MCA: Vendor \"%s\", ID 0x%x, APIC ID %d\n", cpu_vendor, |
| 397 | rec->mr_cpu_id, rec->mr_apic_id); |
| 398 | printf("MCA: CPU %d ", rec->mr_cpu); |
| 399 | if (rec->mr_status & MC_STATUS_UC) |
| 400 | printf("UNCOR "); |
| 401 | else { |
| 402 | printf("COR "); |
| 403 | if (cmci_supported(rec->mr_mcg_cap)) |
| 404 | printf("(%lld) ", ((long long)rec->mr_status & |
| 405 | MC_STATUS_COR_COUNT) >> 38); |
| 406 | } |
| 407 | if (rec->mr_status & MC_STATUS_PCC) |
| 408 | printf("PCC "); |
| 409 | if (rec->mr_status & MC_STATUS_OVER) |
| 410 | printf("OVER "); |
| 411 | mca_error = rec->mr_status & MC_STATUS_MCA_ERROR; |
| 412 | switch (mca_error) { |
| 413 | /* Simple error codes. */ |
| 414 | case 0x0000: |
| 415 | printf("no error"); |
| 416 | break; |
| 417 | case 0x0001: |
| 418 | printf("unclassified error"); |
| 419 | break; |
| 420 | case 0x0002: |
| 421 | printf("ucode ROM parity error"); |
| 422 | break; |
| 423 | case 0x0003: |
| 424 | printf("external error"); |
| 425 | break; |
| 426 | case 0x0004: |
| 427 | printf("FRC error"); |
| 428 | break; |
| 429 | case 0x0005: |
| 430 | printf("internal parity error"); |
| 431 | break; |
| 432 | case 0x0400: |
| 433 | printf("internal timer error"); |
| 434 | break; |
| 435 | default: |
| 436 | if ((mca_error & 0xfc00) == 0x0400) { |
| 437 | printf("internal error %x", mca_error & 0x03ff); |
| 438 | break; |
| 439 | } |
| 440 | |
| 441 | /* Compound error codes. */ |
no test coverage detected