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); |
| 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 |
| 139 | if (0 != i_tiDataArea->hbDumpFlag) |
| 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 |
| 179 | tiAdditionalData["recoverables"] = |
| 180 | recoverableErrors() ? "true" : "false"; |
| 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 | |
| 196 | // Generate event log |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 197 | eventTerminate(tiAdditionalData, (char*)i_tiDataArea); |
| 198 | } |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 199 | |
| 200 | if (HB_SRC_KEY_TRANSITION != reasonCode) |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 201 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 202 | util::dbus::transitionHost(util::dbus::HostState::Quiesce); |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 203 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 204 | } |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 205 | else |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 206 | { |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 207 | // TI data was not available, this should not happen |
| 208 | eventAttentionFail((int)AttnSection::handleHbTi | ATTN_INFO_NULL); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * @brief Handle a hostboot terminate immediate special attention |
| 214 | * |
| 215 | * The TI info data area will contain information pertaining to the TI |
| 216 | * condition. The course of action to take regarding the host state will |
| 217 | * depend on the contents of the TI info data area. We will also create a |
| 218 | * PEL containing the TI info data and FFDC data captured in the system |
| 219 | * journal. |
| 220 | * |
| 221 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 222 | */ |
| 223 | void handleHbTi(TiDataArea* i_tiDataArea) |
| 224 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 225 | trace::inf("HB TI"); |
Ben Tyner | 0f481a4 | 2021-10-19 11:23:43 -0500 | [diff] [blame] | 226 | |
| 227 | // handle specific hostboot reason codes |
| 228 | if (nullptr != i_tiDataArea) |
| 229 | { |
| 230 | uint8_t terminateType = i_tiDataArea->hbTerminateType; |
| 231 | |
| 232 | if (TI_WITH_SRC == terminateType) |
| 233 | { |
| 234 | handleHbTiWithSrc(i_tiDataArea); |
| 235 | } |
| 236 | else |
| 237 | { |
| 238 | handleHbTiWithEid(i_tiDataArea); |
| 239 | } |
| 240 | } |
| 241 | else |
| 242 | { |
| 243 | // TI data was not available, this should not happen |
| 244 | eventAttentionFail((int)AttnSection::handleHbTi | ATTN_INFO_NULL); |
Ben Tyner | 063f6bd | 2021-03-26 07:45:56 -0500 | [diff] [blame] | 245 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | /** @brief Parse the TI info data area into map as PHYP/OPAL data */ |
| 249 | void parsePhypOpalTiInfo(std::map<std::string, std::string>& i_map, |
| 250 | TiDataArea* i_tiDataArea) |
| 251 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 252 | if (nullptr == i_tiDataArea) |
| 253 | { |
| 254 | return; |
| 255 | } |
| 256 | |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 257 | i_map["0x00 TI Area Valid"] = |
| 258 | fmt::format("{:02x}", i_tiDataArea->tiAreaValid); |
| 259 | i_map["0x01 Command"] = fmt::format("{:02x}", i_tiDataArea->command); |
| 260 | i_map["0x02 Num. Data Bytes"] = |
| 261 | fmt::format("{:04x}", be16toh(i_tiDataArea->numDataBytes)); |
| 262 | i_map["0x04 Reserved"] = fmt::format("{:02x}", i_tiDataArea->reserved1); |
| 263 | i_map["0x06 HWDump Type"] = |
| 264 | fmt::format("{:04x}", be16toh(i_tiDataArea->hardwareDumpType)); |
| 265 | i_map["0x08 SRC Format"] = fmt::format("{:02x}", i_tiDataArea->srcFormat); |
| 266 | i_map["0x09 SRC Flags"] = fmt::format("{:02x}", i_tiDataArea->srcFlags); |
| 267 | i_map["0x0a Num. ASCII Words"] = |
| 268 | fmt::format("{:02x}", i_tiDataArea->numAsciiWords); |
| 269 | i_map["0x0b Num. Hex Words"] = |
| 270 | fmt::format("{:02x}", i_tiDataArea->numHexWords); |
| 271 | i_map["0x0e Length of SRC"] = |
| 272 | fmt::format("{:04x}", be16toh(i_tiDataArea->lenSrc)); |
| 273 | i_map["0x10 SRC Word 12"] = |
| 274 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
| 275 | i_map["0x14 SRC Word 13"] = |
| 276 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord13HbWord2)); |
| 277 | i_map["0x18 SRC Word 14"] = |
| 278 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord14HbWord3)); |
| 279 | i_map["0x1c SRC Word 15"] = |
| 280 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord15HbWord4)); |
| 281 | i_map["0x20 SRC Word 16"] = |
| 282 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord16HbWord5)); |
| 283 | i_map["0x24 SRC Word 17"] = |
| 284 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord17HbWord6)); |
| 285 | i_map["0x28 SRC Word 18"] = |
| 286 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord18HbWord7)); |
| 287 | i_map["0x2c SRC Word 19"] = |
| 288 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord19HbWord8)); |
| 289 | i_map["0x30 ASCII Data"] = |
| 290 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData0)); |
| 291 | i_map["0x34 ASCII Data"] = |
| 292 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData1)); |
| 293 | i_map["0x38 ASCII Data"] = |
| 294 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData2)); |
| 295 | i_map["0x3c ASCII Data"] = |
| 296 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData3)); |
| 297 | i_map["0x40 ASCII Data"] = |
| 298 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData4)); |
| 299 | i_map["0x44 ASCII Data"] = |
| 300 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData5)); |
| 301 | i_map["0x48 ASCII Data"] = |
| 302 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData6)); |
| 303 | i_map["0x4c ASCII Data"] = |
| 304 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData7)); |
| 305 | i_map["0x50 Location"] = fmt::format("{:02x}", i_tiDataArea->location); |
| 306 | i_map["0x51 Code Sections"] = |
| 307 | fmt::format("{:02x}", i_tiDataArea->codeSection); |
| 308 | i_map["0x52 Additional Size"] = |
| 309 | fmt::format("{:02x}", i_tiDataArea->additionalSize); |
| 310 | i_map["0x53 Additional Data"] = |
| 311 | fmt::format("{:02x}", i_tiDataArea->andData); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | /** @brief Parse the TI info data area into map as hostboot data */ |
| 315 | void parseHbTiInfo(std::map<std::string, std::string>& i_map, |
| 316 | TiDataArea* i_tiDataArea) |
| 317 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 318 | if (nullptr == i_tiDataArea) |
| 319 | { |
| 320 | return; |
| 321 | } |
| 322 | |
austinfcui | 444fa1c | 2022-02-08 10:20:37 -0600 | [diff] [blame] | 323 | i_map["0x00 TI Area Valid"] = |
| 324 | fmt::format("{:02x}", i_tiDataArea->tiAreaValid); |
| 325 | i_map["0x04 Reserved"] = fmt::format("{:02x}", i_tiDataArea->reserved1); |
| 326 | i_map["0x05 HB_Term. Type"] = |
| 327 | fmt::format("{:02x}", i_tiDataArea->hbTerminateType); |
| 328 | i_map["0x0c HB Dump Flag"] = |
| 329 | fmt::format("{:02x}", i_tiDataArea->hbDumpFlag); |
| 330 | i_map["0x0d Source"] = fmt::format("{:02x}", i_tiDataArea->source); |
| 331 | i_map["0x10 HB Word 0"] = |
| 332 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord12HbWord0)); |
| 333 | i_map["0x14 HB Word 2"] = |
| 334 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord13HbWord2)); |
| 335 | i_map["0x18 HB Word 3"] = |
| 336 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord14HbWord3)); |
| 337 | i_map["0x1c HB Word 4"] = |
| 338 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord15HbWord4)); |
| 339 | i_map["0x20 HB Word 5"] = |
| 340 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord16HbWord5)); |
| 341 | i_map["0x24 HB Word 6"] = |
| 342 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord17HbWord6)); |
| 343 | i_map["0x28 HB Word 7"] = |
| 344 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord18HbWord7)); |
| 345 | i_map["0x2c HB Word 8"] = |
| 346 | fmt::format("{:08x}", be32toh(i_tiDataArea->srcWord19HbWord8)); |
| 347 | i_map["0x30 error_data"] = |
| 348 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData0)); |
| 349 | i_map["0x34 EID"] = |
| 350 | fmt::format("{:08x}", be32toh(i_tiDataArea->asciiData1)); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 351 | } |
| 352 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 353 | } // namespace attn |