Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 1 | #include <attn/attn_common.hpp> |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 2 | #include <attn/attn_dbus.hpp> |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 3 | #include <attn/attn_dump.hpp> |
Ben Tyner | b797b3e | 2020-06-29 10:12:05 -0500 | [diff] [blame] | 4 | #include <attn/attn_logging.hpp> |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 5 | #include <attn/pel/pel_common.hpp> |
Ben Tyner | b797b3e | 2020-06-29 10:12:05 -0500 | [diff] [blame] | 6 | #include <attn/ti_handler.hpp> |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 7 | #include <sdbusplus/bus.hpp> |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 8 | #include <sdbusplus/exception.hpp> |
Ben Tyner | 9306716 | 2021-07-23 10:39:30 -0500 | [diff] [blame] | 9 | #include <util/dbus.hpp> |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 10 | #include <util/trace.hpp> |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 11 | |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 12 | #include <format> |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 13 | #include <iomanip> |
| 14 | #include <iostream> |
| 15 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 16 | namespace attn |
| 17 | { |
| 18 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 19 | /** |
| 20 | * @brief Determine if this is a HB or PHYP TI event |
| 21 | * |
| 22 | * Use the TI info data area to determine if this is either a HB or a PHYP |
| 23 | * TI event then handle the event. |
| 24 | * |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 25 | * @param i_tiDataArea pointer to the TI info data |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 26 | */ |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 27 | int tiHandler(TiDataArea* i_tiDataArea) |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 28 | { |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 29 | int rc = RC_SUCCESS; |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 30 | |
Ben Tyner | b833556 | 2021-07-16 12:43:52 -0500 | [diff] [blame] | 31 | // capture some additional data for logs/traces |
| 32 | addHbStatusRegs(); |
| 33 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 34 | // check TI data area if it is available |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 35 | if (nullptr != i_tiDataArea) |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 36 | { |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 37 | // HB v. PHYP TI logic: Only hosboot will fill in hbTerminateType |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 38 | // and it will be non-zero. Only hostboot will fill out source and |
| 39 | // it it will be non-zero. Only PHYP will fill in srcFormat and it |
| 40 | // will be non-zero. |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 41 | if ((0 == i_tiDataArea->hbTerminateType) && |
| 42 | (0 == i_tiDataArea->source) && (0 != i_tiDataArea->srcFormat)) |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 43 | { |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 44 | handlePhypTi(i_tiDataArea); |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 45 | } |
| 46 | else |
| 47 | { |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 48 | handleHbTi(i_tiDataArea); |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 49 | } |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 50 | } |
| 51 | else |
| 52 | { |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 53 | // TI data was not available This should not happen since we provide |
| 54 | // a default TI info in the case where get TI info was not successful. |
Ben Tyner | 7a0dd54 | 2021-02-12 09:33:44 -0600 | [diff] [blame] | 55 | eventAttentionFail((int)AttnSection::tiHandler | ATTN_INFO_NULL); |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 56 | rc = RC_NOT_HANDLED; |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 57 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 58 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 59 | return rc; |
| 60 | } |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 61 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 62 | /** |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 63 | * @brief Handle a PHYP terminate immediate special attention |
| 64 | * |
| 65 | * The TI info data area will contain information pertaining to the TI |
| 66 | * condition. We will wither quiesce the host or initiate a MPIPL depending |
| 67 | * depending on the auto reboot configuration. We will also create a PEL which |
| 68 | * will contain the TI info data and FFDC data captured in the system journal. |
| 69 | * |
| 70 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 71 | */ |
| 72 | void handlePhypTi(TiDataArea* i_tiDataArea) |
| 73 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 74 | trace::inf("PHYP TI"); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 75 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 76 | // gather additional data for PEL |
| 77 | std::map<std::string, std::string> tiAdditionalData; |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 78 | |
Ben Tyner | 135793a | 2021-10-27 09:18:41 -0500 | [diff] [blame] | 79 | // make note of recoverable errors present |
| 80 | tiAdditionalData["recoverables"] = recoverableErrors() ? "true" : "false"; |
| 81 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 82 | if (nullptr != i_tiDataArea) |
| 83 | { |
| 84 | parsePhypOpalTiInfo(tiAdditionalData, i_tiDataArea); |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 85 | |
| 86 | tiAdditionalData["Subsystem"] = |
| 87 | std::to_string(static_cast<uint8_t>(pel::SubsystemID::hypervisor)); |
| 88 | |
Ben Tyner | 9d4f91c | 2021-02-09 08:27:58 -0600 | [diff] [blame] | 89 | // Copy all ascii src chars to additional data |
| 90 | char srcChar[33]; // 32 ascii chars + null term |
| 91 | memcpy(srcChar, &(i_tiDataArea->asciiData0), 32); |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 92 | srcChar[32] = 0; |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 93 | tiAdditionalData["SrcAscii"] = std::string{srcChar}; |
| 94 | |
| 95 | // TI event |
| 96 | eventTerminate(tiAdditionalData, (char*)i_tiDataArea); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 97 | } |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 98 | else |
| 99 | { |
| 100 | // TI data was not available This should not happen since we provide |
| 101 | // a default TI info in the case where get TI info was not successful. |
Ben Tyner | 7a0dd54 | 2021-02-12 09:33:44 -0600 | [diff] [blame] | 102 | eventAttentionFail((int)AttnSection::handlePhypTi | ATTN_INFO_NULL); |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 103 | } |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 104 | |
| 105 | // We are finished creating the event log entries so transition host to |
| 106 | // the required state. |
Ben Tyner | 39fcf65 | 2021-10-19 20:38:29 -0500 | [diff] [blame] | 107 | if (true == util::dbus::dumpPolicyEnabled()) |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 108 | { |
Ben Tyner | 39fcf65 | 2021-10-19 20:38:29 -0500 | [diff] [blame] | 109 | // MPIPL is considered a "dump" so we will qualify this transition with |
| 110 | // the dumpPolicyEnabled property. MPIPL is triggered by by starting |
| 111 | // the host "crash" target. |
Ben Tyner | 9306716 | 2021-07-23 10:39:30 -0500 | [diff] [blame] | 112 | util::dbus::transitionHost(util::dbus::HostState::Crash); |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 113 | } |
| 114 | else |
| 115 | { |
Ben Tyner | 39fcf65 | 2021-10-19 20:38:29 -0500 | [diff] [blame] | 116 | // If dumpPolicyEnabled property is disabled we will quiesce the host |
Ben Tyner | 9306716 | 2021-07-23 10:39:30 -0500 | [diff] [blame] | 117 | util::dbus::transitionHost(util::dbus::HostState::Quiesce); |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 118 | } |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | /** |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 122 | * @brief Handle a hostboot terminate immediate with SRC provided |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 123 | * |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 124 | * The TI info will contain the log ID of the event log that has already been |
| 125 | * submitted by hostboot. In this case the attention handler does not need to |
| 126 | * create a PEL. A hostboot dump may be requested and the host will be |
| 127 | * transitioned. |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 128 | * |
| 129 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 130 | */ |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 131 | void handleHbTiWithEid(TiDataArea* i_tiDataArea) |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 132 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 133 | trace::inf("HB TI with PLID/EID"); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 134 | |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 135 | if (nullptr != i_tiDataArea) |
| 136 | { |
Zane Shelley | 44d6f25 | 2024-10-18 15:12:19 -0500 | [diff] [blame^] | 137 | // Trace relevant TI data. |
| 138 | trace::inf("TI data HB Flags = 0x%02x", i_tiDataArea->hbFlags); |
| 139 | trace::inf("TI data HB Word 0 = 0x%08x", |
| 140 | be32toh(i_tiDataArea->srcWord12HbWord0)); |
| 141 | trace::inf("TI data HB Word 2 = 0x%08x", |
| 142 | be32toh(i_tiDataArea->srcWord13HbWord2)); |
| 143 | trace::inf("TI data HB Word 3 = 0x%08x", |
| 144 | be32toh(i_tiDataArea->srcWord14HbWord3)); |
| 145 | trace::inf("TI data HB Word 4 = 0x%08x", |
| 146 | be32toh(i_tiDataArea->srcWord15HbWord4)); |
| 147 | trace::inf("TI data HB Word 5 = 0x%08x", |
| 148 | be32toh(i_tiDataArea->srcWord16HbWord5)); |
| 149 | trace::inf("TI data HB Word 6 = 0x%08x", |
| 150 | be32toh(i_tiDataArea->srcWord17HbWord6)); |
| 151 | trace::inf("TI data HB Word 7 = 0x%08x", |
| 152 | be32toh(i_tiDataArea->srcWord18HbWord7)); |
| 153 | trace::inf("TI data HB Word 8 = 0x%08x", |
| 154 | be32toh(i_tiDataArea->srcWord19HbWord8)); |
| 155 | trace::inf("TI data Error Data = 0x%08x", |
| 156 | be32toh(i_tiDataArea->asciiData0)); |
| 157 | trace::inf("TI data EID = 0x%08x", be32toh(i_tiDataArea->asciiData1)); |
| 158 | |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 159 | // see if HB dump is requested |
Ben Tyner | ac5bd05 | 2022-03-03 14:09:13 -0600 | [diff] [blame] | 160 | if (i_tiDataArea->hbFlags & hbDumpFlag) |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 161 | { |
| 162 | // retrieve log ID from TI info data |
| 163 | uint32_t logId = be32toh(i_tiDataArea->asciiData1); |
Zane Shelley | 611b344 | 2021-11-19 16:02:01 -0600 | [diff] [blame] | 164 | requestDump(logId, DumpParameters{0, DumpType::Hostboot}); |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 165 | } |
| 166 | } |
| 167 | |
| 168 | util::dbus::transitionHost(util::dbus::HostState::Quiesce); |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * @brief Handle a hostboot terminate immediate with SRC provided |
| 173 | * |
| 174 | * The TI info will contain the reason code and additional data necessary |
| 175 | * to create a PEL on behalf of hostboot. A hostboot dump may be created |
| 176 | * (after generating the PEL) and the host may be transitioned depending |
| 177 | * on the reason code. |
| 178 | * |
| 179 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 180 | */ |
| 181 | void handleHbTiWithSrc(TiDataArea* i_tiDataArea) |
| 182 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 183 | trace::inf("HB TI with SRC"); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 184 | |
| 185 | // handle specific hostboot reason codes |
| 186 | if (nullptr != i_tiDataArea) |
| 187 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 188 | // Reason code is byte 2 and 3 of 4 byte srcWord12HbWord0 |
| 189 | uint16_t reasonCode = be32toh(i_tiDataArea->srcWord12HbWord0); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 190 | |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 191 | trace::inf("reason code %04x", reasonCode); |
Ben Tyner | 86aa97a | 2021-12-12 21:29:16 -0600 | [diff] [blame] | 192 | |
| 193 | // for clean shutdown (reason code 050B) no PEL and no dump |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 194 | if (reasonCode != HB_SRC_SHUTDOWN_REQUEST) |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 195 | { |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 196 | // gather additional data for PEL |
| 197 | std::map<std::string, std::string> tiAdditionalData; |
| 198 | |
Ben Tyner | 135793a | 2021-10-27 09:18:41 -0500 | [diff] [blame] | 199 | // make note of recoverable errors present |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 200 | tiAdditionalData["recoverables"] = |
| 201 | recoverableErrors() ? "true" : "false"; |
Ben Tyner | 135793a | 2021-10-27 09:18:41 -0500 | [diff] [blame] | 202 | |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 203 | parseHbTiInfo(tiAdditionalData, i_tiDataArea); |
| 204 | |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 205 | tiAdditionalData["Subsystem"] = std::to_string( |
| 206 | static_cast<uint8_t>(pel::SubsystemID::hostboot)); |
| 207 | |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 208 | // Translate hex src value to ascii. This results in an 8 |
| 209 | // character SRC (hostboot SRC is 32 bits) |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 210 | tiAdditionalData["SrcAscii"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 211 | std::format("{:08X}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 212 | |
Ben Tyner | 86aa97a | 2021-12-12 21:29:16 -0600 | [diff] [blame] | 213 | // dump flag is only valid for TI with EID (not TI with SRC) |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 214 | trace::inf("Ignoring TI info dump flag for HB TI with SRC"); |
Ben Tyner | 86aa97a | 2021-12-12 21:29:16 -0600 | [diff] [blame] | 215 | tiAdditionalData["Dump"] = "true"; |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 216 | |
Ben Tyner | ac5bd05 | 2022-03-03 14:09:13 -0600 | [diff] [blame] | 217 | // TI with SRC will honor hbNotVisibleFlag |
| 218 | if (i_tiDataArea->hbFlags & hbNotVisibleFlag) |
| 219 | { |
| 220 | tiAdditionalData["hidden"] = "true"; |
| 221 | } |
| 222 | |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 223 | // Generate event log |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 224 | eventTerminate(tiAdditionalData, (char*)i_tiDataArea); |
| 225 | } |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 226 | |
| 227 | if (HB_SRC_KEY_TRANSITION != reasonCode) |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 228 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 229 | util::dbus::transitionHost(util::dbus::HostState::Quiesce); |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 230 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 231 | } |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 232 | else |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 233 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 234 | // TI data was not available, this should not happen |
| 235 | eventAttentionFail((int)AttnSection::handleHbTi | ATTN_INFO_NULL); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * @brief Handle a hostboot terminate immediate special attention |
| 241 | * |
| 242 | * The TI info data area will contain information pertaining to the TI |
| 243 | * condition. The course of action to take regarding the host state will |
| 244 | * depend on the contents of the TI info data area. We will also create a |
| 245 | * PEL containing the TI info data and FFDC data captured in the system |
| 246 | * journal. |
| 247 | * |
| 248 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 249 | */ |
| 250 | void handleHbTi(TiDataArea* i_tiDataArea) |
| 251 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 252 | trace::inf("HB TI"); |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 253 | |
| 254 | // handle specific hostboot reason codes |
| 255 | if (nullptr != i_tiDataArea) |
| 256 | { |
| 257 | uint8_t terminateType = i_tiDataArea->hbTerminateType; |
| 258 | |
| 259 | if (TI_WITH_SRC == terminateType) |
| 260 | { |
| 261 | handleHbTiWithSrc(i_tiDataArea); |
| 262 | } |
| 263 | else |
| 264 | { |
| 265 | handleHbTiWithEid(i_tiDataArea); |
| 266 | } |
| 267 | } |
| 268 | else |
| 269 | { |
| 270 | // TI data was not available, this should not happen |
| 271 | eventAttentionFail((int)AttnSection::handleHbTi | ATTN_INFO_NULL); |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 272 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | /** @brief Parse the TI info data area into map as PHYP/OPAL data */ |
| 276 | void parsePhypOpalTiInfo(std::map<std::string, std::string>& i_map, |
| 277 | TiDataArea* i_tiDataArea) |
| 278 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 279 | if (nullptr == i_tiDataArea) |
| 280 | { |
| 281 | return; |
| 282 | } |
| 283 | |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 284 | i_map["0x00 TI Area Valid"] = |
| 285 | std::format("{:02x}", i_tiDataArea->tiAreaValid); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 286 | i_map["0x01 Command"] = std::format("{:02x}", i_tiDataArea->command); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 287 | i_map["0x02 Num. Data Bytes"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 288 | std::format("{:04x}", be16toh(i_tiDataArea->numDataBytes)); |
| 289 | i_map["0x04 Reserved"] = std::format("{:02x}", i_tiDataArea->reserved1); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 290 | i_map["0x06 HWDump Type"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 291 | std::format("{:04x}", be16toh(i_tiDataArea->hardwareDumpType)); |
| 292 | i_map["0x08 SRC Format"] = std::format("{:02x}", i_tiDataArea->srcFormat); |
| 293 | i_map["0x09 SRC Flags"] = std::format("{:02x}", i_tiDataArea->srcFlags); |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 294 | i_map["0x0a Num. ASCII Words"] = |
| 295 | std::format("{:02x}", i_tiDataArea->numAsciiWords); |
| 296 | i_map["0x0b Num. Hex Words"] = |
| 297 | std::format("{:02x}", i_tiDataArea->numHexWords); |
| 298 | i_map["0x0e Length of SRC"] = |
| 299 | std::format("{:04x}", be16toh(i_tiDataArea->lenSrc)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 300 | i_map["0x10 SRC Word 12"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 301 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 302 | i_map["0x14 SRC Word 13"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 303 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord13HbWord2)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 304 | i_map["0x18 SRC Word 14"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 305 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord14HbWord3)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 306 | i_map["0x1c SRC Word 15"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 307 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord15HbWord4)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 308 | i_map["0x20 SRC Word 16"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 309 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord16HbWord5)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 310 | i_map["0x24 SRC Word 17"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 311 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord17HbWord6)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 312 | i_map["0x28 SRC Word 18"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 313 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord18HbWord7)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 314 | i_map["0x2c SRC Word 19"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 315 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord19HbWord8)); |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 316 | i_map["0x30 ASCII Data"] = |
| 317 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData0)); |
| 318 | i_map["0x34 ASCII Data"] = |
| 319 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData1)); |
| 320 | i_map["0x38 ASCII Data"] = |
| 321 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData2)); |
| 322 | i_map["0x3c ASCII Data"] = |
| 323 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData3)); |
| 324 | i_map["0x40 ASCII Data"] = |
| 325 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData4)); |
| 326 | i_map["0x44 ASCII Data"] = |
| 327 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData5)); |
| 328 | i_map["0x48 ASCII Data"] = |
| 329 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData6)); |
| 330 | i_map["0x4c ASCII Data"] = |
| 331 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData7)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 332 | i_map["0x50 Location"] = std::format("{:02x}", i_tiDataArea->location); |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 333 | i_map["0x51 Code Sections"] = |
| 334 | std::format("{:02x}", i_tiDataArea->codeSection); |
| 335 | i_map["0x52 Additional Size"] = |
| 336 | std::format("{:02x}", i_tiDataArea->additionalSize); |
| 337 | i_map["0x53 Additional Data"] = |
| 338 | std::format("{:02x}", i_tiDataArea->andData); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | /** @brief Parse the TI info data area into map as hostboot data */ |
| 342 | void parseHbTiInfo(std::map<std::string, std::string>& i_map, |
| 343 | TiDataArea* i_tiDataArea) |
| 344 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 345 | if (nullptr == i_tiDataArea) |
| 346 | { |
| 347 | return; |
| 348 | } |
| 349 | |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 350 | i_map["0x00 TI Area Valid"] = |
| 351 | std::format("{:02x}", i_tiDataArea->tiAreaValid); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 352 | i_map["0x04 Reserved"] = std::format("{:02x}", i_tiDataArea->reserved1); |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 353 | i_map["0x05 HB_Term. Type"] = |
| 354 | std::format("{:02x}", i_tiDataArea->hbTerminateType); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 355 | i_map["0x0c HB Flags"] = std::format("{:02x}", i_tiDataArea->hbFlags); |
| 356 | i_map["0x0d Source"] = std::format("{:02x}", i_tiDataArea->source); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 357 | i_map["0x10 HB Word 0"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 358 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 359 | i_map["0x14 HB Word 2"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 360 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord13HbWord2)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 361 | i_map["0x18 HB Word 3"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 362 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord14HbWord3)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 363 | i_map["0x1c HB Word 4"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 364 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord15HbWord4)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 365 | i_map["0x20 HB Word 5"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 366 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord16HbWord5)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 367 | i_map["0x24 HB Word 6"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 368 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord17HbWord6)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 369 | i_map["0x28 HB Word 7"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 370 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord18HbWord7)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 371 | i_map["0x2c HB Word 8"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 372 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord19HbWord8)); |
Patrick Williams | a0c724d | 2024-08-16 15:21:54 -0400 | [diff] [blame] | 373 | i_map["0x30 error_data"] = |
| 374 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData0)); |
| 375 | i_map["0x34 EID"] = |
| 376 | std::format("{:08x}", be32toh(i_tiDataArea->asciiData1)); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 377 | } |
| 378 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 379 | } // namespace attn |