Jayanth Othayoth | b1eda6a | 2021-06-28 00:26:30 -0500 | [diff] [blame] | 1 | extern "C" |
| 2 | { |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 3 | #include <libpdbg.h> |
Jayanth Othayoth | b1eda6a | 2021-06-28 00:26:30 -0500 | [diff] [blame] | 4 | #include <libpdbg_sbe.h> |
| 5 | } |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 6 | |
Zane Shelley | a06dcf8 | 2021-11-03 10:23:21 -0500 | [diff] [blame] | 7 | #include <config.h> |
| 8 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 9 | #ifdef CONFIG_PHAL_API |
| 10 | #include <libphal.H> |
| 11 | #endif |
| 12 | |
Ben Tyner | 0205f3b | 2020-02-24 10:24:47 -0600 | [diff] [blame] | 13 | #include <analyzer/analyzer_main.hpp> |
Ben Tyner | b797b3e | 2020-06-29 10:12:05 -0500 | [diff] [blame] | 14 | #include <attn/attention.hpp> |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 15 | #include <attn/attn_common.hpp> |
Ben Tyner | b797b3e | 2020-06-29 10:12:05 -0500 | [diff] [blame] | 16 | #include <attn/attn_config.hpp> |
Ben Tyner | 4bbcb38 | 2021-02-22 09:29:00 -0600 | [diff] [blame] | 17 | #include <attn/attn_dbus.hpp> |
Ben Tyner | b797b3e | 2020-06-29 10:12:05 -0500 | [diff] [blame] | 18 | #include <attn/attn_handler.hpp> |
| 19 | #include <attn/attn_logging.hpp> |
| 20 | #include <attn/bp_handler.hpp> |
| 21 | #include <attn/ti_handler.hpp> |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 22 | #include <attn/vital_handler.hpp> |
Ben Tyner | fe2c50d | 2021-07-23 13:38:53 -0500 | [diff] [blame] | 23 | #include <util/dbus.hpp> |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 24 | #include <util/ffdc_file.hpp> |
Ben Tyner | 6a69e6e | 2022-04-05 23:18:29 -0500 | [diff] [blame] | 25 | #include <util/pdbg.hpp> |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 26 | #include <util/trace.hpp> |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 27 | |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 28 | #include <algorithm> |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 29 | #include <iomanip> |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 30 | #include <map> |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 31 | #include <sstream> |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 32 | #include <vector> |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 33 | |
| 34 | namespace attn |
| 35 | { |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 36 | /** |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 37 | * @brief Handle checkstop attention |
| 38 | * |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 39 | * @param i_attention Attention object |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 40 | * @return 0 indicates that the checkstop attention was successfully handled |
| 41 | * 1 indicates that the checkstop attention was NOT successfully |
| 42 | * handled. |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 43 | */ |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 44 | int handleCheckstop(Attention* i_attention); |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * @brief Handle special attention |
| 48 | * |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 49 | * @param i_attention Attention object |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 50 | * @return 0 indicates that the special attention was successfully handled |
| 51 | * 1 indicates that the special attention was NOT successfully handled |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 52 | */ |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 53 | int handleSpecial(Attention* i_attention); |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 54 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 55 | #ifdef CONFIG_PHAL_API |
| 56 | /** @brief Handle phal sbe exception */ |
| 57 | void phalSbeExceptionHandler(openpower::phal::exception::SbeError& e, |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 58 | uint32_t chipPosition, uint32_t command); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 59 | #endif |
| 60 | |
| 61 | /** @brief Get static TI info data based on host state */ |
| 62 | void getStaticTiInfo(uint8_t*& tiInfoPtr); |
| 63 | |
| 64 | /** @brief Check if TI info data is valid */ |
| 65 | bool tiInfoValid(uint8_t* tiInfo); |
| 66 | |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 67 | /** |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 68 | * @brief The main attention handler logic |
Ben Tyner | 970fd4f | 2020-02-19 13:46:42 -0600 | [diff] [blame] | 69 | * |
| 70 | * @param i_breakpoints true = breakpoint special attn handling enabled |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 71 | */ |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 72 | void attnHandler(Config* i_config) |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 73 | { |
austinfcui | d28d5f8 | 2022-04-28 16:20:39 -0500 | [diff] [blame] | 74 | // Check if enClrAttnIntr is enabled |
| 75 | if (true == i_config->getFlag(enClrAttnIntr)) |
| 76 | { |
| 77 | // Clear attention interrupts that may still be active (MPIPL) |
| 78 | clearAttnInterrupts(); |
| 79 | } |
Ben Tyner | 6a69e6e | 2022-04-05 23:18:29 -0500 | [diff] [blame] | 80 | |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 81 | // Vector of active attentions to be handled |
| 82 | std::vector<Attention> active_attentions; |
| 83 | |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 84 | uint32_t isr_val, isr_mask; |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 85 | |
| 86 | // loop through processors looking for active attentions |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 87 | trace::inf("Attention handler started"); |
Ben Tyner | 117af99 | 2020-05-22 13:32:11 -0500 | [diff] [blame] | 88 | |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 89 | pdbg_target* target; |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 90 | pdbg_for_each_class_target("proc", target) |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 91 | { |
| 92 | if (PDBG_TARGET_ENABLED == pdbg_target_probe(target)) |
| 93 | { |
Zane Shelley | a79f6c8 | 2021-01-12 16:38:49 -0600 | [diff] [blame] | 94 | auto proc = pdbg_target_index(target); // get processor number |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 95 | |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 96 | // Use PIB target to determine if a processor is enabled |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 97 | char path[16]; |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 98 | sprintf(path, "/proc%d/pib", proc); |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 99 | pdbg_target* pibTarget = pdbg_target_from_path(nullptr, path); |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 100 | |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 101 | // sanity check |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 102 | if (nullptr == pibTarget) |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 103 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 104 | trace::inf("pib path or target not found"); |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 105 | continue; |
| 106 | } |
| 107 | |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 108 | // check if pib target is enabled |
| 109 | if (PDBG_TARGET_ENABLED == pdbg_target_probe(pibTarget)) |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 110 | { |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 111 | // The processor FSI target is required for CFAM read |
| 112 | sprintf(path, "/proc%d/fsi", proc); |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 113 | pdbg_target* fsiTarget = pdbg_target_from_path(nullptr, path); |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 114 | |
| 115 | // sanity check |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 116 | if (nullptr == fsiTarget) |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 117 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 118 | trace::inf("fsi path or target not found"); |
Ben Tyner | b83c852 | 2020-11-20 10:45:26 -0600 | [diff] [blame] | 119 | continue; |
| 120 | } |
| 121 | |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 122 | // trace the proc number |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 123 | trace::inf("proc: %u", proc); |
Ben Tyner | 1965e50 | 2020-11-20 10:32:24 -0600 | [diff] [blame] | 124 | |
Ben Tyner | 5adc96e | 2020-11-20 10:54:12 -0600 | [diff] [blame] | 125 | isr_val = 0xffffffff; // invalid isr value |
| 126 | |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 127 | // get active attentions on processor |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 128 | if (RC_SUCCESS != fsi_read(fsiTarget, 0x1007, &isr_val)) |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 129 | { |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 130 | // log cfam read error |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 131 | trace::err("cfam read 0x1007 FAILED"); |
Ben Tyner | 7a0dd54 | 2021-02-12 09:33:44 -0600 | [diff] [blame] | 132 | eventAttentionFail((int)AttnSection::attnHandler | |
| 133 | ATTN_PDBG_CFAM); |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 134 | } |
Ben Tyner | 5adc96e | 2020-11-20 10:54:12 -0600 | [diff] [blame] | 135 | else if (0xffffffff == isr_val) |
| 136 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 137 | trace::err("cfam read 0x1007 INVALID"); |
Ben Tyner | 5adc96e | 2020-11-20 10:54:12 -0600 | [diff] [blame] | 138 | continue; |
| 139 | } |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 140 | else |
| 141 | { |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 142 | // trace isr value |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 143 | trace::inf("cfam 0x1007 = 0x%08x", isr_val); |
Ben Tyner | 1965e50 | 2020-11-20 10:32:24 -0600 | [diff] [blame] | 144 | |
Ben Tyner | 5adc96e | 2020-11-20 10:54:12 -0600 | [diff] [blame] | 145 | isr_mask = 0xffffffff; // invalid isr mask |
| 146 | |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 147 | // get interrupt enabled special attentions mask |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 148 | if (RC_SUCCESS != fsi_read(fsiTarget, 0x100d, &isr_mask)) |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 149 | { |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 150 | // log cfam read error |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 151 | trace::err("cfam read 0x100d FAILED"); |
Ben Tyner | 7a0dd54 | 2021-02-12 09:33:44 -0600 | [diff] [blame] | 152 | eventAttentionFail((int)AttnSection::attnHandler | |
| 153 | ATTN_PDBG_CFAM); |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 154 | } |
Ben Tyner | 5adc96e | 2020-11-20 10:54:12 -0600 | [diff] [blame] | 155 | else if (0xffffffff == isr_mask) |
| 156 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 157 | trace::err("cfam read 0x100d INVALID"); |
Ben Tyner | 5adc96e | 2020-11-20 10:54:12 -0600 | [diff] [blame] | 158 | continue; |
| 159 | } |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 160 | else |
| 161 | { |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 162 | // trace true mask |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 163 | trace::inf("cfam 0x100d = 0x%08x", isr_mask); |
Ben Tyner | 1965e50 | 2020-11-20 10:32:24 -0600 | [diff] [blame] | 164 | |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 165 | // SBE vital attention active and not masked? |
Ben Tyner | 1965e50 | 2020-11-20 10:32:24 -0600 | [diff] [blame] | 166 | if (true == activeAttn(isr_val, isr_mask, SBE_ATTN)) |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 167 | { |
| 168 | active_attentions.emplace_back(Attention::Vital, |
| 169 | handleVital, target, |
| 170 | i_config); |
| 171 | } |
| 172 | |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 173 | // Checkstop attention active and not masked? |
| 174 | if (true == |
Ben Tyner | 1965e50 | 2020-11-20 10:32:24 -0600 | [diff] [blame] | 175 | activeAttn(isr_val, isr_mask, CHECKSTOP_ATTN)) |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 176 | { |
| 177 | active_attentions.emplace_back(Attention::Checkstop, |
| 178 | handleCheckstop, |
| 179 | target, i_config); |
| 180 | } |
| 181 | |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 182 | // Special attention active and not masked? |
Ben Tyner | 1965e50 | 2020-11-20 10:32:24 -0600 | [diff] [blame] | 183 | if (true == activeAttn(isr_val, isr_mask, SPECIAL_ATTN)) |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 184 | { |
| 185 | active_attentions.emplace_back(Attention::Special, |
| 186 | handleSpecial, |
| 187 | target, i_config); |
| 188 | } |
| 189 | } // cfam 0x100d valid |
| 190 | } // cfam 0x1007 valid |
Ben Tyner | 8882c32 | 2021-02-05 12:13:21 -0600 | [diff] [blame] | 191 | } // fsi target enabled |
| 192 | } // pib target enabled |
Ben Tyner | 5e622d8 | 2020-09-11 10:10:24 -0500 | [diff] [blame] | 193 | } // next processor |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 194 | |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 195 | // convert to heap, highest priority is at front |
| 196 | if (!std::is_heap(active_attentions.begin(), active_attentions.end())) |
| 197 | { |
| 198 | std::make_heap(active_attentions.begin(), active_attentions.end()); |
| 199 | } |
| 200 | |
| 201 | // call the attention handler until one is handled or all were attempted |
| 202 | while (false == active_attentions.empty()) |
| 203 | { |
| 204 | // handle highest priority attention, done if successful |
| 205 | if (RC_SUCCESS == active_attentions.front().handle()) |
| 206 | { |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 207 | // an attention was handled so we are done |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 208 | break; |
| 209 | } |
| 210 | |
| 211 | // move attention to back of vector |
| 212 | std::pop_heap(active_attentions.begin(), active_attentions.end()); |
| 213 | |
| 214 | // remove attention from vector |
| 215 | active_attentions.pop_back(); |
| 216 | } |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | /** |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 220 | * @brief Handle checkstop attention |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 221 | * |
| 222 | * @param i_attention Attention object |
| 223 | * @return 0 indicates that the checkstop attention was successfully handled |
| 224 | * 1 indicates that the checkstop attention was NOT successfully |
| 225 | * handled. |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 226 | */ |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 227 | int handleCheckstop(Attention* i_attention) |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 228 | { |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 229 | int rc = RC_SUCCESS; // assume checkstop handled |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 230 | |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 231 | trace::inf("checkstop handler started"); |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 232 | |
Ben Tyner | b833556 | 2021-07-16 12:43:52 -0500 | [diff] [blame] | 233 | // capture some additional data for logs/traces |
| 234 | addHbStatusRegs(); |
| 235 | |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 236 | // if checkstop handling enabled, handle checkstop attention |
| 237 | if (false == (i_attention->getConfig()->getFlag(enCheckstop))) |
| 238 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 239 | trace::inf("Checkstop handling disabled"); |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 240 | } |
| 241 | else |
| 242 | { |
Ben Tyner | 2b26b2b | 2022-12-15 15:42:02 -0600 | [diff] [blame] | 243 | // check for power fault before starting analyses |
Ben Tyner | 07ebb9b | 2021-12-01 12:16:24 -0600 | [diff] [blame] | 244 | sleepSeconds(POWER_FAULT_WAIT); |
Ben Tyner | 2b26b2b | 2022-12-15 15:42:02 -0600 | [diff] [blame] | 245 | if (!util::dbus::powerFault()) |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 246 | { |
Ben Tyner | 2b26b2b | 2022-12-15 15:42:02 -0600 | [diff] [blame] | 247 | // Look for any attentions found in hardware. This will generate and |
| 248 | // commit a PEL if any errors are found. |
| 249 | DumpParameters dumpParameters; |
| 250 | auto logid = analyzer::analyzeHardware( |
| 251 | analyzer::AnalysisType::SYSTEM_CHECKSTOP, dumpParameters); |
| 252 | if (0 == logid) |
| 253 | { |
| 254 | // A PEL should exist for a checkstop attention. |
| 255 | rc = RC_ANALYZER_ERROR; |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | requestDump(logid, dumpParameters); |
| 260 | util::dbus::transitionHost(util::dbus::HostState::Quiesce); |
| 261 | } |
Ben Tyner | 7029e52 | 2021-08-09 19:18:24 -0500 | [diff] [blame] | 262 | } |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 263 | } |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 264 | |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 265 | return rc; |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * @brief Handle special attention |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 270 | * |
| 271 | * @param i_attention Attention object |
| 272 | * @return 0 indicates that the special attention was successfully handled |
| 273 | * 1 indicates that the special attention was NOT successfully handled |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 274 | */ |
Ben Tyner | b481d90 | 2020-03-05 10:24:23 -0600 | [diff] [blame] | 275 | int handleSpecial(Attention* i_attention) |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 276 | { |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 277 | int rc = RC_SUCCESS; // assume special attention handled |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 278 | |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 279 | // The TI info chipop will give us a pointer to the TI info data |
Ben Tyner | 98430b3 | 2020-08-19 19:14:02 -0500 | [diff] [blame] | 280 | uint8_t* tiInfo = nullptr; // ptr to TI info data |
| 281 | uint32_t tiInfoLen = 0; // length of TI info data |
| 282 | pdbg_target* attnProc = i_attention->getTarget(); // proc with attention |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 283 | |
Ben Tyner | 29651ef | 2021-02-08 10:51:03 -0600 | [diff] [blame] | 284 | bool tiInfoStatic = false; // assume TI info was provided (not created) |
| 285 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 286 | // need proc target to get dynamic TI info |
| 287 | if (nullptr != attnProc) |
Ben Tyner | 89c0a7a | 2020-08-07 12:07:35 -0500 | [diff] [blame] | 288 | { |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 289 | #ifdef CONFIG_PHAL_API |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 290 | trace::inf("using libphal to get TI info"); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 291 | |
| 292 | // phal library uses proc target for get ti info |
| 293 | if (PDBG_TARGET_ENABLED == pdbg_target_probe(attnProc)) |
| 294 | { |
| 295 | try |
| 296 | { |
| 297 | // get dynamic TI info |
| 298 | openpower::phal::sbe::getTiInfo(attnProc, &tiInfo, &tiInfoLen); |
| 299 | } |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 300 | catch (openpower::phal::exception::SbeError& sbeError) |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 301 | { |
| 302 | // library threw an exception |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 303 | // note: phal::sbe::getTiInfo = command class | command == |
| 304 | // 0xa900 | 0x04 = 0xa904. The sbe fifo command class and |
Ben Tyner | 6a69e6e | 2022-04-05 23:18:29 -0500 | [diff] [blame] | 305 | // commands are defined in the sbefifo library source code |
| 306 | // but do not seem to be exported/installed for consumption |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 307 | // externally. |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 308 | uint32_t procNum = pdbg_target_index(attnProc); |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 309 | phalSbeExceptionHandler(sbeError, procNum, 0xa904); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 310 | } |
| 311 | } |
| 312 | #else |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 313 | trace::inf("using libpdbg to get TI info"); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 314 | |
| 315 | // pdbg library uses pib target for get ti info |
Ben Tyner | 98430b3 | 2020-08-19 19:14:02 -0500 | [diff] [blame] | 316 | char path[16]; |
| 317 | sprintf(path, "/proc%d/pib", pdbg_target_index(attnProc)); |
| 318 | pdbg_target* tiInfoTarget = pdbg_target_from_path(nullptr, path); |
| 319 | |
| 320 | if (nullptr != tiInfoTarget) |
Ben Tyner | 89c0a7a | 2020-08-07 12:07:35 -0500 | [diff] [blame] | 321 | { |
Ben Tyner | 98430b3 | 2020-08-19 19:14:02 -0500 | [diff] [blame] | 322 | if (PDBG_TARGET_ENABLED == pdbg_target_probe(tiInfoTarget)) |
| 323 | { |
Ben Tyner | 98430b3 | 2020-08-19 19:14:02 -0500 | [diff] [blame] | 324 | sbe_mpipl_get_ti_info(tiInfoTarget, &tiInfo, &tiInfoLen); |
Ben Tyner | 98430b3 | 2020-08-19 19:14:02 -0500 | [diff] [blame] | 325 | } |
Ben Tyner | 89c0a7a | 2020-08-07 12:07:35 -0500 | [diff] [blame] | 326 | } |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 327 | #endif |
Ben Tyner | 89c0a7a | 2020-08-07 12:07:35 -0500 | [diff] [blame] | 328 | } |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 329 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 330 | // dynamic TI info is not available |
| 331 | if (nullptr == tiInfo) |
Ben Tyner | 970fd4f | 2020-02-19 13:46:42 -0600 | [diff] [blame] | 332 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 333 | trace::inf("TI info data ptr is invalid"); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 334 | getStaticTiInfo(tiInfo); |
| 335 | tiInfoStatic = true; |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 336 | } |
Ben Tyner | 0fe5df4 | 2020-12-03 08:57:17 -0600 | [diff] [blame] | 337 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 338 | // check TI info for validity and handle |
| 339 | if (true == tiInfoValid(tiInfo)) |
| 340 | { |
| 341 | // TI info is valid handle TI if support enabled |
| 342 | if (true == (i_attention->getConfig()->getFlag(enTerminate))) |
| 343 | { |
| 344 | // Call TI special attention handler |
| 345 | rc = tiHandler((TiDataArea*)tiInfo); |
| 346 | } |
| 347 | } |
| 348 | else |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 349 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 350 | trace::inf("TI info NOT valid"); |
Ben Tyner | 98430b3 | 2020-08-19 19:14:02 -0500 | [diff] [blame] | 351 | |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 352 | // if configured to handle TI as default special attention |
Ben Tyner | fe15649 | 2021-04-08 07:28:13 -0500 | [diff] [blame] | 353 | if (i_attention->getConfig()->getFlag(dfltTi)) |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 354 | { |
Ben Tyner | fe15649 | 2021-04-08 07:28:13 -0500 | [diff] [blame] | 355 | // TI handling may be disabled |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 356 | if (true == (i_attention->getConfig()->getFlag(enTerminate))) |
| 357 | { |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 358 | // Call TI special attention handler |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 359 | rc = tiHandler((TiDataArea*)tiInfo); |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 360 | } |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 361 | } |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 362 | // configured to handle breakpoint as default special attention |
Ben Tyner | fe15649 | 2021-04-08 07:28:13 -0500 | [diff] [blame] | 363 | else |
| 364 | { |
| 365 | // breakpoint handling may be disabled |
| 366 | if (true == (i_attention->getConfig()->getFlag(enBreakpoints))) |
| 367 | { |
| 368 | // Call the breakpoint special attention handler |
| 369 | rc = bpHandler(); |
| 370 | } |
| 371 | } |
Ben Tyner | 970fd4f | 2020-02-19 13:46:42 -0600 | [diff] [blame] | 372 | } |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 373 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 374 | // release TI data buffer if not ours |
| 375 | if (false == tiInfoStatic) |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 376 | { |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 377 | // sanity check |
| 378 | if (nullptr != tiInfo) |
| 379 | { |
| 380 | free(tiInfo); |
| 381 | } |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 382 | } |
| 383 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 384 | // trace non-successful exit condition |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 385 | if (RC_SUCCESS != rc) |
| 386 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 387 | trace::inf("Special attn not handled"); |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 388 | } |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 389 | |
| 390 | return rc; |
| 391 | } |
| 392 | |
Ben Tyner | 9051685 | 2022-12-14 21:04:18 -0600 | [diff] [blame] | 393 | /** @brief Determine if attention is active and not masked */ |
Ben Tyner | 1965e50 | 2020-11-20 10:32:24 -0600 | [diff] [blame] | 394 | bool activeAttn(uint32_t i_val, uint32_t i_mask, uint32_t i_attn) |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 395 | { |
Zane Shelley | 9fb657f | 2021-01-12 15:30:58 -0600 | [diff] [blame] | 396 | bool rc = false; // assume attn masked and/or inactive |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 397 | |
| 398 | // if attention active |
| 399 | if (0 != (i_val & i_attn)) |
| 400 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 401 | std::string msg; |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 402 | |
Zane Shelley | 9fb657f | 2021-01-12 15:30:58 -0600 | [diff] [blame] | 403 | bool validAttn = true; // known attention type |
| 404 | |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 405 | switch (i_attn) |
| 406 | { |
| 407 | case SBE_ATTN: |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 408 | msg = "SBE attn"; |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 409 | break; |
| 410 | case CHECKSTOP_ATTN: |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 411 | msg = "Checkstop attn"; |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 412 | break; |
| 413 | case SPECIAL_ATTN: |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 414 | msg = "Special attn"; |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 415 | break; |
| 416 | default: |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 417 | msg = "Unknown attn"; |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 418 | validAttn = false; |
| 419 | } |
| 420 | |
| 421 | // see if attention is masked |
| 422 | if (true == validAttn) |
| 423 | { |
| 424 | if (0 != (i_mask & i_attn)) |
| 425 | { |
| 426 | rc = true; // attention active and not masked |
| 427 | } |
| 428 | else |
| 429 | { |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 430 | msg += " masked"; |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 431 | } |
| 432 | } |
| 433 | |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 434 | trace::inf(msg.c_str()); // commit trace stream |
Ben Tyner | fb19054 | 2020-11-06 09:27:56 -0600 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | return rc; |
| 438 | } |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 439 | |
| 440 | #ifdef CONFIG_PHAL_API |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 441 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 442 | /** |
| 443 | * @brief Handle phal sbe exception |
| 444 | * |
| 445 | * @param[in] e - exception object |
| 446 | * @param[in] procNum - processor number associated with sbe exception |
| 447 | */ |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 448 | void phalSbeExceptionHandler(openpower::phal::exception::SbeError& sbeError, |
| 449 | uint32_t chipPosition, uint32_t command) |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 450 | { |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 451 | trace::err("Attention handler phal exception handler"); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 452 | |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 453 | // Trace exception details |
| 454 | trace::err(sbeError.what()); |
| 455 | |
| 456 | // Create event log entry with SBE FFDC data if provided |
| 457 | auto fd = sbeError.getFd(); |
| 458 | if (fd > 0) |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 459 | { |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 460 | trace::err("SBE FFDC data is available"); |
| 461 | |
| 462 | // FFDC parser expects chip position and command (command class | |
| 463 | // command) to be in the additional data. |
| 464 | std::map<std::string, std::string> additionalData = { |
| 465 | {"SRC6", std::to_string((chipPosition << 16) | command)}}; |
| 466 | |
Ben Tyner | 6a69e6e | 2022-04-05 23:18:29 -0500 | [diff] [blame] | 467 | // See phosphor-logging/extensions/openpower-pels/README.md, "Self |
| 468 | // Boot Engine(SBE) First Failure Data Capture(FFDC)" - SBE FFDC |
| 469 | // file type is 0xCB, version is 0x01. |
Ben Tyner | 76e52f6 | 2022-02-01 10:46:44 -0600 | [diff] [blame] | 470 | std::vector<util::FFDCTuple> ffdc{util::FFDCTuple{ |
| 471 | util::FFDCFormat::Custom, static_cast<uint8_t>(0xCB), |
| 472 | static_cast<uint8_t>(0x01), fd}}; |
| 473 | |
| 474 | // Create event log entry with FFDC data |
Ben Tyner | 1315968 | 2022-02-16 14:55:38 -0600 | [diff] [blame] | 475 | util::dbus::createPel("org.open_power.Processor.Error.SbeChipOpFailure", |
| 476 | levelPelError, additionalData, ffdc); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 477 | } |
| 478 | } |
| 479 | #endif |
| 480 | |
| 481 | /** |
| 482 | * @brief Get static TI info data based on host state |
| 483 | * |
| 484 | * @param[out] tiInfo - pointer to static TI info data |
| 485 | */ |
| 486 | void getStaticTiInfo(uint8_t*& tiInfo) |
| 487 | { |
| 488 | util::dbus::HostRunningState runningState = util::dbus::hostRunningState(); |
| 489 | |
| 490 | // assume host state is unknown |
| 491 | std::string stateString = "host state unknown"; |
| 492 | |
| 493 | if ((util::dbus::HostRunningState::Started == runningState) || |
| 494 | (util::dbus::HostRunningState::Unknown == runningState)) |
| 495 | { |
| 496 | if (util::dbus::HostRunningState::Started == runningState) |
| 497 | { |
| 498 | stateString = "host started"; |
| 499 | } |
| 500 | tiInfo = (uint8_t*)defaultPhypTiInfo; |
| 501 | } |
| 502 | else |
| 503 | { |
| 504 | stateString = "host not started"; |
| 505 | tiInfo = (uint8_t*)defaultHbTiInfo; |
| 506 | } |
| 507 | |
| 508 | // trace host state |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 509 | trace::inf(stateString.c_str()); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 510 | } |
| 511 | |
| 512 | /** |
| 513 | * @brief Check if TI info data is valid |
| 514 | * |
| 515 | * @param[in] tiInfo - pointer to TI info data |
| 516 | * @return true if TI info data is valid, else false |
| 517 | */ |
| 518 | bool tiInfoValid(uint8_t* tiInfo) |
| 519 | { |
| 520 | bool tiInfoValid = false; // assume TI info invalid |
| 521 | |
| 522 | // TI info data[0] non-zero indicates TI info valid (usually) |
| 523 | if ((nullptr != tiInfo) && (0 != tiInfo[0])) |
| 524 | { |
| 525 | TiDataArea* tiDataArea = (TiDataArea*)tiInfo; |
| 526 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 527 | // trace a few known TI data area values |
Ben Tyner | 535a8d4 | 2022-03-08 18:07:14 -0600 | [diff] [blame] | 528 | trace::inf("TI data command = 0x%02x", tiDataArea->command); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 529 | |
| 530 | // Another check for valid TI Info since it has been seen that |
| 531 | // tiInfo[0] != 0 but TI info is not valid |
| 532 | if (0xa1 == tiDataArea->command) |
| 533 | { |
| 534 | tiInfoValid = true; |
| 535 | |
| 536 | // trace some more data since TI info appears valid |
Ben Tyner | 535a8d4 | 2022-03-08 18:07:14 -0600 | [diff] [blame] | 537 | trace::inf("TI data term-type = 0x%02x", |
austinfcui | bfa831a | 2022-01-26 15:37:07 -0600 | [diff] [blame] | 538 | tiDataArea->hbTerminateType); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 539 | |
Ben Tyner | 535a8d4 | 2022-03-08 18:07:14 -0600 | [diff] [blame] | 540 | trace::inf("TI data SRC format = 0x%02x", tiDataArea->srcFormat); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 541 | |
Ben Tyner | 535a8d4 | 2022-03-08 18:07:14 -0600 | [diff] [blame] | 542 | trace::inf("TI data source = 0x%02x", tiDataArea->source); |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 543 | } |
| 544 | } |
| 545 | |
| 546 | return tiInfoValid; |
| 547 | } |
| 548 | |
Ben Tyner | 9051685 | 2022-12-14 21:04:18 -0600 | [diff] [blame] | 549 | /** @brief Clear attention interrupts */ |
Ben Tyner | 6a69e6e | 2022-04-05 23:18:29 -0500 | [diff] [blame] | 550 | void clearAttnInterrupts() |
| 551 | { |
| 552 | trace::inf("Clearing attention interrupts"); |
| 553 | |
| 554 | // loop through processors clearing attention interrupts |
| 555 | pdbg_target* procTarget; |
| 556 | pdbg_for_each_class_target("proc", procTarget) |
| 557 | { |
| 558 | // active processors only |
| 559 | if (PDBG_TARGET_ENABLED != |
| 560 | pdbg_target_probe(util::pdbg::getPibTrgt(procTarget))) |
| 561 | { |
| 562 | continue; |
| 563 | } |
| 564 | |
| 565 | // get cfam is an fsi read |
| 566 | pdbg_target* fsiTarget = util::pdbg::getFsiTrgt(procTarget); |
| 567 | uint32_t int_val; |
| 568 | |
| 569 | // get attention interrupts on processor |
| 570 | if (RC_SUCCESS == fsi_read(fsiTarget, 0x100b, &int_val)) |
| 571 | { |
| 572 | // trace int value |
| 573 | trace::inf("cfam 0x100b = 0x%08x", int_val); |
| 574 | |
| 575 | int_val &= ~(ANY_ATTN | CHECKSTOP_ATTN | SPECIAL_ATTN | |
| 576 | RECOVERABLE_ATTN | SBE_ATTN); |
| 577 | |
| 578 | // clear attention interrupts on processor |
| 579 | if (RC_SUCCESS != fsi_write(fsiTarget, 0x100b, int_val)) |
| 580 | { |
| 581 | // log cfam write error |
| 582 | trace::err("cfam write 0x100b FAILED"); |
| 583 | } |
| 584 | } |
| 585 | else |
| 586 | { |
| 587 | // log cfam read error |
| 588 | trace::err("cfam read 0x100b FAILED"); |
| 589 | } |
| 590 | } |
| 591 | } |
| 592 | |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 593 | } // namespace attn |