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