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 | { |
| 137 | // see if HB dump is requested |
Ben Tyner | ac5bd05 | 2022-03-03 14:09:13 -0600 | [diff] [blame] | 138 | if (i_tiDataArea->hbFlags & hbDumpFlag) |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 139 | { |
| 140 | // retrieve log ID from TI info data |
| 141 | uint32_t logId = be32toh(i_tiDataArea->asciiData1); |
Zane Shelley | 611b344 | 2021-11-19 16:02:01 -0600 | [diff] [blame] | 142 | requestDump(logId, DumpParameters{0, DumpType::Hostboot}); |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 143 | } |
| 144 | } |
| 145 | |
| 146 | util::dbus::transitionHost(util::dbus::HostState::Quiesce); |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * @brief Handle a hostboot terminate immediate with SRC provided |
| 151 | * |
| 152 | * The TI info will contain the reason code and additional data necessary |
| 153 | * to create a PEL on behalf of hostboot. A hostboot dump may be created |
| 154 | * (after generating the PEL) and the host may be transitioned depending |
| 155 | * on the reason code. |
| 156 | * |
| 157 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 158 | */ |
| 159 | void handleHbTiWithSrc(TiDataArea* i_tiDataArea) |
| 160 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 161 | trace::inf("HB TI with SRC"); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 162 | |
| 163 | // handle specific hostboot reason codes |
| 164 | if (nullptr != i_tiDataArea) |
| 165 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 166 | // Reason code is byte 2 and 3 of 4 byte srcWord12HbWord0 |
| 167 | uint16_t reasonCode = be32toh(i_tiDataArea->srcWord12HbWord0); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 168 | |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 169 | trace::inf("reason code %04x", reasonCode); |
Ben Tyner | 86aa97a | 2021-12-12 21:29:16 -0600 | [diff] [blame] | 170 | |
| 171 | // for clean shutdown (reason code 050B) no PEL and no dump |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 172 | if (reasonCode != HB_SRC_SHUTDOWN_REQUEST) |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 173 | { |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 174 | // gather additional data for PEL |
| 175 | std::map<std::string, std::string> tiAdditionalData; |
| 176 | |
Ben Tyner | 135793a | 2021-10-27 09:18:41 -0500 | [diff] [blame] | 177 | // make note of recoverable errors present |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 178 | tiAdditionalData["recoverables"] = recoverableErrors() ? "true" |
| 179 | : "false"; |
Ben Tyner | 135793a | 2021-10-27 09:18:41 -0500 | [diff] [blame] | 180 | |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 181 | parseHbTiInfo(tiAdditionalData, i_tiDataArea); |
| 182 | |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 183 | tiAdditionalData["Subsystem"] = std::to_string( |
| 184 | static_cast<uint8_t>(pel::SubsystemID::hostboot)); |
| 185 | |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 186 | // Translate hex src value to ascii. This results in an 8 |
| 187 | // character SRC (hostboot SRC is 32 bits) |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 188 | tiAdditionalData["SrcAscii"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 189 | std::format("{:08X}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 190 | |
Ben Tyner | 86aa97a | 2021-12-12 21:29:16 -0600 | [diff] [blame] | 191 | // dump flag is only valid for TI with EID (not TI with SRC) |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 192 | trace::inf("Ignoring TI info dump flag for HB TI with SRC"); |
Ben Tyner | 86aa97a | 2021-12-12 21:29:16 -0600 | [diff] [blame] | 193 | tiAdditionalData["Dump"] = "true"; |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 194 | |
Ben Tyner | ac5bd05 | 2022-03-03 14:09:13 -0600 | [diff] [blame] | 195 | // TI with SRC will honor hbNotVisibleFlag |
| 196 | if (i_tiDataArea->hbFlags & hbNotVisibleFlag) |
| 197 | { |
| 198 | tiAdditionalData["hidden"] = "true"; |
| 199 | } |
| 200 | |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 201 | // Generate event log |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 202 | eventTerminate(tiAdditionalData, (char*)i_tiDataArea); |
| 203 | } |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 204 | |
| 205 | if (HB_SRC_KEY_TRANSITION != reasonCode) |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 206 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 207 | util::dbus::transitionHost(util::dbus::HostState::Quiesce); |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 208 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 209 | } |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 210 | else |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 211 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 212 | // TI data was not available, this should not happen |
| 213 | eventAttentionFail((int)AttnSection::handleHbTi | ATTN_INFO_NULL); |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * @brief Handle a hostboot terminate immediate special attention |
| 219 | * |
| 220 | * The TI info data area will contain information pertaining to the TI |
| 221 | * condition. The course of action to take regarding the host state will |
| 222 | * depend on the contents of the TI info data area. We will also create a |
| 223 | * PEL containing the TI info data and FFDC data captured in the system |
| 224 | * journal. |
| 225 | * |
| 226 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 227 | */ |
| 228 | void handleHbTi(TiDataArea* i_tiDataArea) |
| 229 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 230 | trace::inf("HB TI"); |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 231 | |
| 232 | // handle specific hostboot reason codes |
| 233 | if (nullptr != i_tiDataArea) |
| 234 | { |
| 235 | uint8_t terminateType = i_tiDataArea->hbTerminateType; |
| 236 | |
| 237 | if (TI_WITH_SRC == terminateType) |
| 238 | { |
| 239 | handleHbTiWithSrc(i_tiDataArea); |
| 240 | } |
| 241 | else |
| 242 | { |
| 243 | handleHbTiWithEid(i_tiDataArea); |
| 244 | } |
| 245 | } |
| 246 | else |
| 247 | { |
| 248 | // TI data was not available, this should not happen |
| 249 | eventAttentionFail((int)AttnSection::handleHbTi | ATTN_INFO_NULL); |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 250 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | /** @brief Parse the TI info data area into map as PHYP/OPAL data */ |
| 254 | void parsePhypOpalTiInfo(std::map<std::string, std::string>& i_map, |
| 255 | TiDataArea* i_tiDataArea) |
| 256 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 257 | if (nullptr == i_tiDataArea) |
| 258 | { |
| 259 | return; |
| 260 | } |
| 261 | |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 262 | i_map["0x00 TI Area Valid"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 263 | i_tiDataArea->tiAreaValid); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 264 | i_map["0x01 Command"] = std::format("{:02x}", i_tiDataArea->command); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 265 | i_map["0x02 Num. Data Bytes"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 266 | std::format("{:04x}", be16toh(i_tiDataArea->numDataBytes)); |
| 267 | i_map["0x04 Reserved"] = std::format("{:02x}", i_tiDataArea->reserved1); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 268 | i_map["0x06 HWDump Type"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 269 | std::format("{:04x}", be16toh(i_tiDataArea->hardwareDumpType)); |
| 270 | i_map["0x08 SRC Format"] = std::format("{:02x}", i_tiDataArea->srcFormat); |
| 271 | i_map["0x09 SRC Flags"] = std::format("{:02x}", i_tiDataArea->srcFlags); |
| 272 | i_map["0x0a Num. ASCII Words"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 273 | i_tiDataArea->numAsciiWords); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 274 | i_map["0x0b Num. Hex Words"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 275 | i_tiDataArea->numHexWords); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 276 | i_map["0x0e Length of SRC"] = std::format("{:04x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 277 | be16toh(i_tiDataArea->lenSrc)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 278 | i_map["0x10 SRC Word 12"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 279 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 280 | i_map["0x14 SRC Word 13"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 281 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord13HbWord2)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 282 | i_map["0x18 SRC Word 14"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 283 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord14HbWord3)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 284 | i_map["0x1c SRC Word 15"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 285 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord15HbWord4)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 286 | i_map["0x20 SRC Word 16"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 287 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord16HbWord5)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 288 | i_map["0x24 SRC Word 17"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 289 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord17HbWord6)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 290 | i_map["0x28 SRC Word 18"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 291 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord18HbWord7)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 292 | i_map["0x2c SRC Word 19"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 293 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord19HbWord8)); |
| 294 | i_map["0x30 ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 295 | be32toh(i_tiDataArea->asciiData0)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 296 | i_map["0x34 ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 297 | be32toh(i_tiDataArea->asciiData1)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 298 | i_map["0x38 ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 299 | be32toh(i_tiDataArea->asciiData2)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 300 | i_map["0x3c ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 301 | be32toh(i_tiDataArea->asciiData3)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 302 | i_map["0x40 ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 303 | be32toh(i_tiDataArea->asciiData4)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 304 | i_map["0x44 ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 305 | be32toh(i_tiDataArea->asciiData5)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 306 | i_map["0x48 ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 307 | be32toh(i_tiDataArea->asciiData6)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 308 | i_map["0x4c ASCII Data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 309 | be32toh(i_tiDataArea->asciiData7)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 310 | i_map["0x50 Location"] = std::format("{:02x}", i_tiDataArea->location); |
| 311 | i_map["0x51 Code Sections"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 312 | i_tiDataArea->codeSection); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 313 | i_map["0x52 Additional Size"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 314 | i_tiDataArea->additionalSize); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 315 | i_map["0x53 Additional Data"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 316 | i_tiDataArea->andData); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 317 | } |
| 318 | |
| 319 | /** @brief Parse the TI info data area into map as hostboot data */ |
| 320 | void parseHbTiInfo(std::map<std::string, std::string>& i_map, |
| 321 | TiDataArea* i_tiDataArea) |
| 322 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 323 | if (nullptr == i_tiDataArea) |
| 324 | { |
| 325 | return; |
| 326 | } |
| 327 | |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 328 | i_map["0x00 TI Area Valid"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 329 | i_tiDataArea->tiAreaValid); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 330 | i_map["0x04 Reserved"] = std::format("{:02x}", i_tiDataArea->reserved1); |
| 331 | i_map["0x05 HB_Term. Type"] = std::format("{:02x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 332 | i_tiDataArea->hbTerminateType); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 333 | i_map["0x0c HB Flags"] = std::format("{:02x}", i_tiDataArea->hbFlags); |
| 334 | i_map["0x0d Source"] = std::format("{:02x}", i_tiDataArea->source); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 335 | i_map["0x10 HB Word 0"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 336 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 337 | i_map["0x14 HB Word 2"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 338 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord13HbWord2)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 339 | i_map["0x18 HB Word 3"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 340 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord14HbWord3)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 341 | i_map["0x1c HB Word 4"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 342 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord15HbWord4)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 343 | i_map["0x20 HB Word 5"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 344 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord16HbWord5)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 345 | i_map["0x24 HB Word 6"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 346 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord17HbWord6)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 347 | i_map["0x28 HB Word 7"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 348 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord18HbWord7)); |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 349 | i_map["0x2c HB Word 8"] = |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 350 | std::format("{:08x}", be32toh(i_tiDataArea->srcWord19HbWord8)); |
| 351 | i_map["0x30 error_data"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 352 | be32toh(i_tiDataArea->asciiData0)); |
Patrick Williams | 710101c | 2024-02-13 21:37:47 -0600 | [diff] [blame] | 353 | i_map["0x34 EID"] = std::format("{:08x}", |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 354 | be32toh(i_tiDataArea->asciiData1)); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 355 | } |
| 356 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 357 | } // namespace attn |