]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/machine_check.c
xnu-1699.22.73.tar.gz
[apple/xnu.git] / osfmk / i386 / machine_check.c
index 6eaff9d8fd9332d3537c7d7c640a65a65bf1b74a..77681d3405fd67c7a2a1a8f17caacbd8e44d1b5e 100644 (file)
@@ -45,6 +45,7 @@ static uint32_t               mca_family = 0;
 static unsigned int    mca_error_bank_count = 0;
 static boolean_t       mca_control_MSR_present = FALSE;
 static boolean_t       mca_threshold_status_present = FALSE;
+static boolean_t       mca_sw_error_recovery_present = FALSE;
 static boolean_t       mca_extended_MSRs_present = FALSE;
 static unsigned int    mca_extended_MSRs_count = 0;
 static boolean_t       mca_cmci_present = FALSE;
@@ -89,6 +90,7 @@ mca_get_availability(void)
                mca_error_bank_count = ia32_mcg_cap.bits.count;
                mca_control_MSR_present = ia32_mcg_cap.bits.mcg_ctl_p;
                mca_threshold_status_present = ia32_mcg_cap.bits.mcg_tes_p;
+               mca_sw_error_recovery_present = ia32_mcg_cap.bits.mcg_ser_p;
                mca_cmci_present = ia32_mcg_cap.bits.mcg_ext_corr_err_p;
                if (family == 0x0F) {
                        mca_extended_MSRs_present = ia32_mcg_cap.bits.mcg_ext_p;
@@ -269,25 +271,22 @@ static void mca_dump_32bit_state(void)
 static void
 mca_report_cpu_info(void)
 {
-       uint64_t        microcode;
        i386_cpu_info_t *infop = cpuid_info();
 
-       // microcode revision is top 32 bits of MSR_IA32_UCODE_REV
-       microcode = rdmsr64(MSR_IA32_UCODE_REV) >> 32;
        kdb_printf(" family: %d model: %d stepping: %d microcode: %d\n",
                infop->cpuid_family,
                infop->cpuid_model,
                infop->cpuid_stepping,
-               (uint32_t) microcode);
+               infop->cpuid_microcode_version);
        kdb_printf(" %s\n", infop->cpuid_brand_string);
 }
 
 static const char *mc8_memory_operation[] = {
-       [MC8_MMM_GENERIC]               "generic",
-       [MC8_MMM_READ]                  "read",
-       [MC8_MMM_WRITE]                 "write",
-       [MC8_MMM_ADDRESS_COMMAND]       "address/command",
-       [MC8_MMM_RESERVED]              "reserved"
+       [MC8_MMM_GENERIC] =             "generic",
+       [MC8_MMM_READ] =                "read",
+       [MC8_MMM_WRITE] =               "write",
+       [MC8_MMM_ADDRESS_COMMAND] =     "address/command",
+       [MC8_MMM_RESERVED] =            "reserved"
 };
 
 static void
@@ -312,19 +311,20 @@ mca_dump_bank_mc8(mca_state_t *state, int i)
        kdb_printf(
                "  Channel number:         %d%s\n"
                "  Memory Operation:       %s\n"
-               "  Machine-specific error: %s%s%s%s%s%s%s%s\n"
+               "  Machine-specific error: %s%s%s%s%s%s%s%s%s\n"
                "  COR_ERR_CNT:            %d\n",
                mc8.channel_number,
                IF(mc8.channel_number == 15, " (unknown)"),
                mc8_memory_operation[mmm],
-               IF(mc8.read_ecc,            "Read ECC"),
-               IF(mc8.ecc_on_a_scrub,      "ECC on scrub"),
-               IF(mc8.write_parity,        "Write parity"),
-               IF(mc8.redundant_memory,    "Redundant memory"),
-               IF(mc8.sparing,             "Sparing/Resilvering"),
-               IF(mc8.access_out_of_range, "Access out of Range"),
-               IF(mc8.address_parity,      "Address Parity"),
-               IF(mc8.byte_enable_parity,  "Byte Enable Parity"),
+               IF(mc8.read_ecc,            "Read ECC "),
+               IF(mc8.ecc_on_a_scrub,      "ECC on scrub "),
+               IF(mc8.write_parity,        "Write parity "),
+               IF(mc8.redundant_memory,    "Redundant memory "),
+               IF(mc8.sparing,             "Sparing/Resilvering "),
+               IF(mc8.access_out_of_range, "Access out of Range "),
+               IF(mc8.rtid_out_of_range,   "RTID out of Range "),
+               IF(mc8.address_parity,      "Address Parity "),
+               IF(mc8.byte_enable_parity,  "Byte Enable Parity "),
                mc8.cor_err_cnt);
        kdb_printf(
                "  Status bits:\n%s%s%s%s%s%s",
@@ -344,10 +344,12 @@ mca_dump_bank_mc8(mca_state_t *state, int i)
                mc8_misc.u64 = bank->mca_mci_misc;
                kdb_printf(
                        " IA32_MC%d_MISC(0x%x): 0x%016qx\n"
+                       "  RTID:     %d\n"
                        "  DIMM:     %d\n"
                        "  Channel:  %d\n"
                        "  Syndrome: 0x%x\n",
                        i, IA32_MCi_MISC(i), mc8_misc.u64,
+                       mc8_misc.bits.rtid,
                        mc8_misc.bits.dimm,
                        mc8_misc.bits.channel,
                        (int) mc8_misc.bits.syndrome);
@@ -355,10 +357,10 @@ mca_dump_bank_mc8(mca_state_t *state, int i)
 }
 
 static const char *mca_threshold_status[] = {
-       [THRESHOLD_STATUS_NO_TRACKING]  "No tracking",
-       [THRESHOLD_STATUS_GREEN]        "Green",
-       [THRESHOLD_STATUS_YELLOW]       "Yellow",
-       [THRESHOLD_STATUS_RESERVED]     "Reserved"
+       [THRESHOLD_STATUS_NO_TRACKING] =        "No tracking",
+       [THRESHOLD_STATUS_GREEN] =      "Green",
+       [THRESHOLD_STATUS_YELLOW] =     "Yellow",
+       [THRESHOLD_STATUS_RESERVED] =   "Reserved"
 };
 
 static void
@@ -395,6 +397,13 @@ mca_dump_bank(mca_state_t *state, int i)
                            mca_threshold_status[threshold] :
                            "Undefined");
        }
+       if (mca_threshold_status_present &&
+           mca_sw_error_recovery_present) {
+               kdb_printf(
+                       "  Software Error Recovery:\n%s%s",
+                       IF(status.bits_tes_p.ar, "   Recovery action reqd\n"),
+                       IF(status.bits_tes_p.s,  "   Signaling UCR error\n"));
+       }
        kdb_printf(
                "  Status bits:\n%s%s%s%s%s%s",
                IF(status.bits.pcc,   "   Processor context corrupt\n"),