1 #include <assert.h>
2 
3 #include <analyzer_main.hpp>
4 #include <hei_main.hpp>
5 #include <hei_util.hpp>
6 #include <util/pdbg.hpp>
7 
8 #include <algorithm>
9 #include <limits>
10 #include <string>
11 
12 namespace analyzer
13 {
14 
15 //------------------------------------------------------------------------------
16 
17 bool __findRcsOscError(const std::vector<libhei::Signature>& i_list,
18                        libhei::Signature& o_rootCause)
19 {
20     // TODO: Consider returning all of them instead of one as root cause.
21     auto itr = std::find_if(i_list.begin(), i_list.end(), [&](const auto& t) {
22         return (libhei::hash<libhei::NodeId_t>("TP_LOCAL_FIR") == t.getId() &&
23                 (42 == t.getBit() || 43 == t.getBit()));
24     });
25 
26     if (i_list.end() != itr)
27     {
28         o_rootCause = *itr;
29         return true;
30     }
31 
32     return false;
33 }
34 
35 //------------------------------------------------------------------------------
36 
37 bool __findPllUnlock(const std::vector<libhei::Signature>& i_list,
38                      libhei::Signature& o_rootCause)
39 {
40     // TODO: Consider returning all of them instead of one as root cause.
41     auto itr = std::find_if(i_list.begin(), i_list.end(), [&](const auto& t) {
42         return (libhei::hash<libhei::NodeId_t>("PLL_UNLOCK") == t.getId() &&
43                 (0 == t.getBit() || 1 == t.getBit()));
44     });
45 
46     if (i_list.end() != itr)
47     {
48         o_rootCause = *itr;
49         return true;
50     }
51 
52     return false;
53 }
54 
55 //------------------------------------------------------------------------------
56 
57 bool __findMemoryChannelFailure(const std::vector<libhei::Signature>& i_list,
58                                 libhei::Signature& o_rootCause)
59 {
60     using namespace util::pdbg;
61 
62     using func  = libhei::NodeId_t (*)(const std::string& i_str);
63     func __hash = libhei::hash<libhei::NodeId_t>;
64 
65     static const auto mc_dstl_fir       = __hash("MC_DSTL_FIR");
66     static const auto mc_ustl_fir       = __hash("MC_USTL_FIR");
67     static const auto mc_omi_dl_err_rpt = __hash("MC_OMI_DL_ERR_RPT");
68 
69     for (const auto s : i_list)
70     {
71         const auto targetType = getTrgtType(getTrgt(s.getChip()));
72         const auto id         = s.getId();
73         const auto bit        = s.getBit();
74         const auto attnType   = s.getAttnType();
75 
76         // Look for any unit checkstop attentions from OCMBs.
77         if (TYPE_OCMB == targetType)
78         {
79             // Any unit checkstop attentions will trigger a channel failure.
80             if (libhei::ATTN_TYPE_UNIT_CS == attnType)
81             {
82                 o_rootCause = s;
83                 return true;
84             }
85         }
86         // Look for channel failure attentions on processors.
87         else if (TYPE_PROC == targetType)
88         {
89             // TODO: All of these channel failure bits are configurable.
90             //       Eventually, we will need some mechanism to check that
91             //       config registers for a more accurate analysis. For now,
92             //       simply check for all bits that could potentially be
93             //       configured to channel failure.
94 
95             // Any unit checkstop bit in the MC_DSTL_FIR or MC_USTL_FIR could
96             // be a channel failure.
97             if (libhei::ATTN_TYPE_UNIT_CS == attnType)
98             {
99                 // Ignore bits MC_DSTL_FIR[0:7] because they simply indicate
100                 // attentions occurred on the attached OCMBs.
101                 if ((mc_dstl_fir == id && 8 <= bit) || (mc_ustl_fir == id))
102                 {
103                     o_rootCause = s;
104                     return true;
105                 }
106             }
107 
108             // All bits in MC_OMI_DL_ERR_RPT eventually feed into
109             // MC_OMI_DL_FIR[0,20] which are configurable to channel failure.
110             if (mc_omi_dl_err_rpt == id)
111             {
112                 o_rootCause = s;
113                 return true;
114             }
115         }
116     }
117 
118     return false; // default, nothing found
119 }
120 
121 //------------------------------------------------------------------------------
122 
123 // Will query if a signature is a potential system checkstop root cause.
124 // attention. Note that this function excludes memory channel failure attentions
125 // which are checked in __findMemoryChannelFailure().
126 bool __findCsRootCause(const libhei::Signature& i_signature)
127 {
128     using namespace util::pdbg;
129 
130     using func  = libhei::NodeId_t (*)(const std::string& i_str);
131     func __hash = libhei::hash<libhei::NodeId_t>;
132 
133     // PROC registers
134     static const auto eq_core_fir      = __hash("EQ_CORE_FIR");
135     static const auto eq_l2_fir        = __hash("EQ_L2_FIR");
136     static const auto eq_l3_fir        = __hash("EQ_L3_FIR");
137     static const auto eq_ncu_fir       = __hash("EQ_NCU_FIR");
138     static const auto iohs_dlp_fir_oc  = __hash("IOHS_DLP_FIR_OC");
139     static const auto iohs_dlp_fir_smp = __hash("IOHS_DLP_FIR_SMP");
140     static const auto nx_cq_fir        = __hash("NX_CQ_FIR");
141     static const auto nx_dma_eng_fir   = __hash("NX_DMA_ENG_FIR");
142     static const auto pau_fir_0        = __hash("PAU_FIR_0");
143     static const auto pau_fir_1        = __hash("PAU_FIR_1");
144     static const auto pau_fir_2        = __hash("PAU_FIR_2");
145     static const auto pau_ptl_fir      = __hash("PAU_PTL_FIR");
146 
147     // OCMB registers
148     static const auto rdffir = __hash("RDFFIR");
149 
150     const auto targetType = getTrgtType(getTrgt(i_signature.getChip()));
151     const auto id         = i_signature.getId();
152     const auto bit        = i_signature.getBit();
153 
154     if (TYPE_PROC == targetType)
155     {
156         if (eq_core_fir == id &&
157             (0 == bit || 2 == bit || 3 == bit || 4 == bit || 5 == bit ||
158              7 == bit || 8 == bit || 9 == bit || 11 == bit || 12 == bit ||
159              13 == bit || 18 == bit || 21 == bit || 22 == bit || 24 == bit ||
160              25 == bit || 29 == bit || 31 == bit || 32 == bit || 36 == bit ||
161              37 == bit || 38 == bit || 43 == bit || 46 == bit || 47 == bit))
162         {
163             return true;
164         }
165 
166         if (eq_l2_fir == id &&
167             (1 == bit || 12 == bit || 13 == bit || 17 == bit || 18 == bit ||
168              20 == bit || 27 == bit))
169         {
170             return true;
171         }
172 
173         if (eq_l3_fir == id &&
174             (2 == bit || 5 == bit || 8 == bit || 11 == bit || 17 == bit))
175         {
176             return true;
177         }
178 
179         if (eq_ncu_fir == id && (3 == bit || 4 == bit || 5 == bit || 7 == bit ||
180                                  8 == bit || 10 == bit || 17 == bit))
181         {
182             return true;
183         }
184 
185         if (iohs_dlp_fir_oc == id && (54 <= bit && bit <= 61))
186         {
187             return true;
188         }
189 
190         if (iohs_dlp_fir_smp == id && (54 <= bit && bit <= 61))
191         {
192             return true;
193         }
194 
195         if (nx_cq_fir == id && (7 == bit || 16 == bit || 21 == bit))
196         {
197             return true;
198         }
199 
200         if (nx_dma_eng_fir == id && (0 == bit))
201         {
202             return true;
203         }
204 
205         if (pau_fir_0 == id &&
206             (15 == bit || 18 == bit || 19 == bit || 25 == bit || 26 == bit ||
207              29 == bit || 33 == bit || 34 == bit || 35 == bit || 40 == bit ||
208              42 == bit || 44 == bit || 45 == bit))
209         {
210             return true;
211         }
212 
213         if (pau_fir_1 == id &&
214             (13 == bit || 14 == bit || 15 == bit || 37 == bit || 39 == bit ||
215              40 == bit || 41 == bit || 42 == bit))
216         {
217             return true;
218         }
219 
220         if (pau_fir_2 == id &&
221             ((4 <= bit && bit <= 18) || (20 <= bit && bit <= 31) ||
222              (36 <= bit && bit <= 41) || 45 == bit || 47 == bit || 48 == bit ||
223              50 == bit || 51 == bit || 52 == bit))
224         {
225             return true;
226         }
227 
228         if (pau_ptl_fir == id && (4 == bit || 8 == bit))
229         {
230             return true;
231         }
232     }
233     else if (TYPE_OCMB == targetType)
234     {
235         if (rdffir == id && (14 == bit || 15 == bit || 17 == bit || 37 == bit))
236         {
237             return true;
238         }
239     }
240 
241     return false; // default, nothing found
242 }
243 
244 //------------------------------------------------------------------------------
245 
246 bool __findCsRootCause_RE(const std::vector<libhei::Signature>& i_list,
247                           libhei::Signature& o_rootCause)
248 {
249     for (const auto s : i_list)
250     {
251         // Only looking for recoverable attentions.
252         if (libhei::ATTN_TYPE_RECOVERABLE != s.getAttnType())
253         {
254             continue;
255         }
256 
257         if (__findCsRootCause(s))
258         {
259             o_rootCause = s;
260             return true;
261         }
262     }
263 
264     return false; // default, nothing found
265 }
266 
267 //------------------------------------------------------------------------------
268 
269 bool __findCsRootCause_UCS(const std::vector<libhei::Signature>& i_list,
270                            libhei::Signature& o_rootCause)
271 {
272     for (const auto s : i_list)
273     {
274         // Only looking for unit checkstop attentions.
275         if (libhei::ATTN_TYPE_UNIT_CS != s.getAttnType())
276         {
277             continue;
278         }
279 
280         if (__findCsRootCause(s))
281         {
282             o_rootCause = s;
283             return true;
284         }
285     }
286 
287     return false; // default, nothing found
288 }
289 
290 //------------------------------------------------------------------------------
291 
292 bool __findNonExternalCs(const std::vector<libhei::Signature>& i_list,
293                          libhei::Signature& o_rootCause)
294 {
295     using namespace util::pdbg;
296 
297     static const auto pb_ext_fir = libhei::hash<libhei::NodeId_t>("PB_EXT_FIR");
298 
299     for (const auto s : i_list)
300     {
301         const auto targetType = getTrgtType(getTrgt(s.getChip()));
302         const auto id         = s.getId();
303         const auto attnType   = s.getAttnType();
304 
305         // Find any processor with system checkstop attention that did not
306         // originate from the PB_EXT_FIR.
307         if ((TYPE_PROC == targetType) &&
308             (libhei::ATTN_TYPE_CHECKSTOP == attnType) && (pb_ext_fir != id))
309         {
310             o_rootCause = s;
311             return true;
312         }
313     }
314 
315     return false; // default, nothing found
316 }
317 
318 //------------------------------------------------------------------------------
319 
320 bool __findTiRootCause(const std::vector<libhei::Signature>& i_list,
321                        libhei::Signature& o_rootCause)
322 {
323     using namespace util::pdbg;
324 
325     using func  = libhei::NodeId_t (*)(const std::string& i_str);
326     func __hash = libhei::hash<libhei::NodeId_t>;
327 
328     // PROC registers
329     static const auto tp_local_fir        = __hash("TP_LOCAL_FIR");
330     static const auto occ_fir             = __hash("OCC_FIR");
331     static const auto pbao_fir            = __hash("PBAO_FIR");
332     static const auto n0_local_fir        = __hash("N0_LOCAL_FIR");
333     static const auto int_cq_fir          = __hash("INT_CQ_FIR");
334     static const auto nx_cq_fir           = __hash("NX_CQ_FIR");
335     static const auto nx_dma_eng_fir      = __hash("NX_DMA_ENG_FIR");
336     static const auto vas_fir             = __hash("VAS_FIR");
337     static const auto n1_local_fir        = __hash("N1_LOCAL_FIR");
338     static const auto mcd_fir             = __hash("MCD_FIR");
339     static const auto pb_station_fir_en_1 = __hash("PB_STATION_FIR_EN_1");
340     static const auto pb_station_fir_en_2 = __hash("PB_STATION_FIR_EN_2");
341     static const auto pb_station_fir_en_3 = __hash("PB_STATION_FIR_EN_3");
342     static const auto pb_station_fir_en_4 = __hash("PB_STATION_FIR_EN_4");
343     static const auto pb_station_fir_es_1 = __hash("PB_STATION_FIR_ES_1");
344     static const auto pb_station_fir_es_2 = __hash("PB_STATION_FIR_ES_2");
345     static const auto pb_station_fir_es_3 = __hash("PB_STATION_FIR_ES_3");
346     static const auto pb_station_fir_es_4 = __hash("PB_STATION_FIR_ES_4");
347     static const auto pb_station_fir_eq   = __hash("PB_STATION_FIR_EQ");
348     static const auto psihb_fir           = __hash("PSIHB_FIR");
349     static const auto pbaf_fir            = __hash("PBAF_FIR");
350     static const auto lpc_fir             = __hash("LPC_FIR");
351     static const auto eq_core_fir         = __hash("EQ_CORE_FIR");
352     static const auto eq_l2_fir           = __hash("EQ_L2_FIR");
353     static const auto eq_l3_fir           = __hash("EQ_L3_FIR");
354     static const auto eq_ncu_fir          = __hash("EQ_NCU_FIR");
355     static const auto eq_local_fir        = __hash("EQ_LOCAL_FIR");
356     static const auto eq_qme_fir          = __hash("EQ_QME_FIR");
357     static const auto iohs_local_fir      = __hash("IOHS_LOCAL_FIR");
358     static const auto iohs_dlp_fir_oc     = __hash("IOHS_DLP_FIR_OC");
359     static const auto iohs_dlp_fir_smp    = __hash("IOHS_DLP_FIR_SMP");
360     static const auto mc_local_fir        = __hash("MC_LOCAL_FIR");
361     static const auto mc_fir              = __hash("MC_FIR");
362     static const auto mc_dstl_fir         = __hash("MC_DSTL_FIR");
363     static const auto mc_ustl_fir         = __hash("MC_USTL_FIR");
364     static const auto nmmu_cq_fir         = __hash("NMMU_CQ_FIR");
365     static const auto nmmu_fir            = __hash("NMMU_FIR");
366     static const auto mc_omi_dl           = __hash("MC_OMI_DL");
367     static const auto pau_local_fir       = __hash("PAU_LOCAL_FIR");
368     static const auto pau_ptl_fir         = __hash("PAU_PTL_FIR");
369     static const auto pau_phy_fir         = __hash("PAU_PHY_FIR");
370     static const auto pau_fir_0           = __hash("PAU_FIR_0");
371     static const auto pau_fir_2           = __hash("PAU_FIR_2");
372     static const auto pci_local_fir       = __hash("PCI_LOCAL_FIR");
373     static const auto pci_iop_fir         = __hash("PCI_IOP_FIR");
374     static const auto pci_nest_fir        = __hash("PCI_NEST_FIR");
375 
376     // OCMB registers
377     static const auto ocmb_lfir = __hash("OCMB_LFIR");
378     static const auto mmiofir   = __hash("MMIOFIR");
379     static const auto srqfir    = __hash("SRQFIR");
380     static const auto rdffir    = __hash("RDFFIR");
381     static const auto tlxfir    = __hash("TLXFIR");
382     static const auto omi_dl    = __hash("OMI_DL");
383 
384     for (const auto& signature : i_list)
385     {
386         const auto targetType = getTrgtType(getTrgt(signature.getChip()));
387         const auto attnType   = signature.getAttnType();
388         const auto id         = signature.getId();
389         const auto bit        = signature.getBit();
390 
391         // Only looking for recoverable or unit checkstop attentions.
392         if (libhei::ATTN_TYPE_RECOVERABLE != attnType &&
393             libhei::ATTN_TYPE_UNIT_CS != attnType)
394         {
395             continue;
396         }
397 
398         // Ignore attentions that should not be blamed as root cause of a TI.
399         // This would include informational only FIRs or correctable errors.
400         if (TYPE_PROC == targetType)
401         {
402             if (tp_local_fir == id &&
403                 (0 == bit || 1 == bit || 2 == bit || 3 == bit || 4 == bit ||
404                  5 == bit || 7 == bit || 8 == bit || 9 == bit || 10 == bit ||
405                  11 == bit || 20 == bit || 22 == bit || 23 == bit ||
406                  24 == bit || 38 == bit || 40 == bit || 41 == bit ||
407                  46 == bit || 47 == bit || 48 == bit || 55 == bit ||
408                  56 == bit || 57 == bit || 58 == bit || 59 == bit))
409             {
410                 continue;
411             }
412 
413             if (occ_fir == id &&
414                 (9 == bit || 10 == bit || 15 == bit || 20 == bit || 21 == bit ||
415                  22 == bit || 23 == bit || 32 == bit || 33 == bit ||
416                  34 == bit || 36 == bit || 42 == bit || 43 == bit ||
417                  46 == bit || 47 == bit || 48 == bit || 51 == bit ||
418                  52 == bit || 53 == bit || 54 == bit || 57 == bit))
419             {
420                 continue;
421             }
422 
423             if (pbao_fir == id &&
424                 (0 == bit || 1 == bit || 2 == bit || 8 == bit || 11 == bit ||
425                  13 == bit || 15 == bit || 16 == bit || 17 == bit))
426             {
427                 continue;
428             }
429 
430             if ((n0_local_fir == id || n1_local_fir == id ||
431                  iohs_local_fir == id || mc_local_fir == id ||
432                  pau_local_fir == id || pci_local_fir == id) &&
433                 (0 == bit || 1 == bit || 2 == bit || 3 == bit || 4 == bit ||
434                  5 == bit || 6 == bit || 7 == bit || 8 == bit || 9 == bit ||
435                  10 == bit || 11 == bit || 20 == bit || 21 == bit))
436             {
437                 continue;
438             }
439 
440             if (int_cq_fir == id &&
441                 (0 == bit || 3 == bit || 5 == bit || 7 == bit || 36 == bit ||
442                  58 == bit || 59 == bit || 60 == bit))
443             {
444                 continue;
445             }
446 
447             if (nx_cq_fir == id &&
448                 (1 == bit || 4 == bit || 18 == bit || 32 == bit || 33 == bit))
449             {
450                 continue;
451             }
452 
453             if (nx_dma_eng_fir == id &&
454                 (4 == bit || 6 == bit || 9 == bit || 10 == bit || 11 == bit ||
455                  34 == bit || 35 == bit || 36 == bit || 37 == bit || 39 == bit))
456             {
457                 continue;
458             }
459 
460             if (vas_fir == id &&
461                 (8 == bit || 9 == bit || 11 == bit || 12 == bit || 13 == bit))
462             {
463                 continue;
464             }
465 
466             if (mcd_fir == id && (0 == bit))
467             {
468                 continue;
469             }
470 
471             if ((pb_station_fir_en_1 == id || pb_station_fir_en_2 == id ||
472                  pb_station_fir_en_3 == id || pb_station_fir_en_4 == id ||
473                  pb_station_fir_es_1 == id || pb_station_fir_es_2 == id ||
474                  pb_station_fir_es_3 == id || pb_station_fir_es_4 == id ||
475                  pb_station_fir_eq == id) &&
476                 (9 == bit))
477             {
478                 continue;
479             }
480 
481             if (psihb_fir == id && (0 == bit || 23 == bit))
482             {
483                 continue;
484             }
485 
486             if (pbaf_fir == id &&
487                 (0 == bit || 1 == bit || 3 == bit || 4 == bit || 5 == bit ||
488                  6 == bit || 7 == bit || 8 == bit || 9 == bit || 10 == bit ||
489                  11 == bit || 19 == bit || 20 == bit || 21 == bit ||
490                  28 == bit || 29 == bit || 30 == bit || 31 == bit ||
491                  32 == bit || 33 == bit || 34 == bit || 35 == bit || 36 == bit))
492             {
493                 continue;
494             }
495 
496             if (lpc_fir == id && (5 == bit))
497             {
498                 continue;
499             }
500 
501             if (eq_core_fir == id &&
502                 (0 == bit || 2 == bit || 4 == bit || 7 == bit || 9 == bit ||
503                  11 == bit || 13 == bit || 18 == bit || 21 == bit ||
504                  24 == bit || 29 == bit || 31 == bit || 37 == bit ||
505                  43 == bit || 56 == bit || 57 == bit))
506             {
507                 continue;
508             }
509 
510             if (eq_l2_fir == id &&
511                 (0 == bit || 6 == bit || 11 == bit || 19 == bit || 36 == bit))
512             {
513                 continue;
514             }
515 
516             if (eq_l3_fir == id &&
517                 (3 == bit || 4 == bit || 7 == bit || 10 == bit || 13 == bit))
518             {
519                 continue;
520             }
521 
522             if (eq_ncu_fir == id && (9 == bit))
523             {
524                 continue;
525             }
526 
527             if (eq_local_fir == id &&
528                 (0 == bit || 1 == bit || 2 == bit || 3 == bit || 5 == bit ||
529                  6 == bit || 7 == bit || 8 == bit || 9 == bit || 10 == bit ||
530                  11 == bit || 12 == bit || 13 == bit || 14 == bit ||
531                  15 == bit || 16 == bit || 20 == bit || 21 == bit ||
532                  22 == bit || 23 == bit || 24 == bit || 25 == bit ||
533                  26 == bit || 27 == bit || 28 == bit || 29 == bit ||
534                  30 == bit || 31 == bit || 32 == bit || 33 == bit ||
535                  34 == bit || 35 == bit || 36 == bit || 37 == bit ||
536                  38 == bit || 39 == bit))
537             {
538                 continue;
539             }
540 
541             if (eq_qme_fir == id && (7 == bit || 25 == bit))
542             {
543                 continue;
544             }
545 
546             if (iohs_dlp_fir_oc == id &&
547                 (6 == bit || 7 == bit || 8 == bit || 9 == bit || 10 == bit ||
548                  48 == bit || 49 == bit || 52 == bit || 53 == bit))
549             {
550                 continue;
551             }
552 
553             if (iohs_dlp_fir_smp == id &&
554                 (6 == bit || 7 == bit || 14 == bit || 15 == bit || 16 == bit ||
555                  17 == bit || 38 == bit || 39 == bit || 44 == bit ||
556                  45 == bit || 50 == bit || 51 == bit))
557             {
558                 continue;
559             }
560 
561             if (mc_fir == id &&
562                 (5 == bit || 8 == bit || 15 == bit || 16 == bit))
563             {
564                 continue;
565             }
566 
567             if (mc_dstl_fir == id &&
568                 (0 == bit || 1 == bit || 2 == bit || 3 == bit || 4 == bit ||
569                  5 == bit || 6 == bit || 7 == bit || 14 == bit || 15 == bit))
570             {
571                 continue;
572             }
573 
574             if (mc_ustl_fir == id &&
575                 (6 == bit || 20 == bit || 33 == bit || 34 == bit))
576             {
577                 continue;
578             }
579 
580             if (nmmu_cq_fir == id && (8 == bit || 11 == bit || 14 == bit))
581             {
582                 continue;
583             }
584 
585             if (nmmu_fir == id &&
586                 (0 == bit || 3 == bit || 8 == bit || 9 == bit || 10 == bit ||
587                  11 == bit || 12 == bit || 13 == bit || 14 == bit ||
588                  15 == bit || 30 == bit || 31 == bit || 41 == bit))
589             {
590                 continue;
591             }
592 
593             if (mc_omi_dl == id && (2 == bit || 3 == bit || 6 == bit ||
594                                     7 == bit || 9 == bit || 10 == bit))
595             {
596                 continue;
597             }
598 
599             if (pau_ptl_fir == id && (5 == bit || 9 == bit))
600             {
601                 continue;
602             }
603 
604             if (pau_phy_fir == id &&
605                 (2 == bit || 3 == bit || 6 == bit || 7 == bit || 15 == bit))
606             {
607                 continue;
608             }
609 
610             if (pau_fir_0 == id && (13 == bit || 30 == bit || 41 == bit))
611             {
612                 continue;
613             }
614 
615             if (pau_fir_2 == id && (19 == bit || 46 == bit || 49 == bit))
616             {
617                 continue;
618             }
619 
620             if (pci_iop_fir == id &&
621                 (0 == bit || 2 == bit || 4 == bit || 6 == bit || 7 == bit ||
622                  8 == bit || 10 == bit))
623             {
624                 continue;
625             }
626 
627             if (pci_nest_fir == id && (2 == bit || 5 == bit))
628             {
629                 continue;
630             }
631         }
632         else if (TYPE_OCMB == targetType)
633         {
634             if (ocmb_lfir == id &&
635                 (0 == bit || 1 == bit || 2 == bit || 8 == bit || 23 == bit ||
636                  37 == bit || 63 == bit))
637             {
638                 continue;
639             }
640 
641             if (mmiofir == id && (2 == bit))
642             {
643                 continue;
644             }
645 
646             if (srqfir == id &&
647                 (2 == bit || 4 == bit || 14 == bit || 15 == bit || 23 == bit ||
648                  25 == bit || 28 == bit))
649             {
650                 continue;
651             }
652 
653             if (rdffir == id &&
654                 (0 == bit || 1 == bit || 2 == bit || 3 == bit || 4 == bit ||
655                  5 == bit || 6 == bit || 7 == bit || 8 == bit || 9 == bit ||
656                  18 == bit || 38 == bit || 40 == bit || 41 == bit ||
657                  45 == bit || 46 == bit))
658             {
659                 continue;
660             }
661 
662             if (tlxfir == id && (0 == bit || 9 == bit || 26 == bit))
663             {
664                 continue;
665             }
666 
667             if (omi_dl == id && (2 == bit || 3 == bit || 6 == bit || 7 == bit ||
668                                  9 == bit || 10 == bit))
669             {
670                 continue;
671             }
672         }
673 
674         // At this point, the attention has not been explicitly ignored. So
675         // return this signature and exit.
676         o_rootCause = signature;
677         return true;
678     }
679 
680     return false; // default, nothing found
681 }
682 
683 //------------------------------------------------------------------------------
684 
685 bool filterRootCause(AnalysisType i_type,
686                      const libhei::IsolationData& i_isoData,
687                      libhei::Signature& o_rootCause)
688 {
689     // We'll need to make a copy of the list so that the original list is
690     // maintained for the PEL.
691     std::vector<libhei::Signature> list{i_isoData.getSignatureList()};
692 
693     // START WORKAROUND
694     // TODO: Filtering should be data driven. Until that support is available,
695     //       use the following isolation rules.
696 
697     // Ensure the list is not empty before continuing.
698     if (list.empty())
699     {
700         return false; // nothing more to do
701     }
702 
703     // First, look for any RCS OSC errors. This must always be first because
704     // they can cause downstream PLL unlock attentions.
705     if (__findRcsOscError(list, o_rootCause))
706     {
707         return true;
708     }
709 
710     // Second, look for any PLL unlock attentions. This must always be second
711     // because PLL unlock attentions can cause any number of downstream
712     // attentions, including a system checkstop.
713     if (__findPllUnlock(list, o_rootCause))
714     {
715         return true;
716     }
717 
718     // Regardless of the analysis type, always look for anything that could be
719     // blamed as the root cause of a system checkstop.
720 
721     // Memory channel failure attentions will produce SUEs and likely cause
722     // downstream attentions, including a system checkstop.
723     if (__findMemoryChannelFailure(list, o_rootCause))
724     {
725         return true;
726     }
727 
728     // Look for any recoverable attentions that have been identified as a
729     // potential root cause of a system checkstop attention. These would include
730     // any attention that would generate an SUE. Note that is it possible for
731     // recoverables to generate unit checkstop attentions so we must check them
732     // first.
733     if (__findCsRootCause_RE(list, o_rootCause))
734     {
735         return true;
736     }
737 
738     // Look for any unit checkstop attentions (other than memory channel
739     // failures) that have been identified as a potential root cause of a
740     // system checkstop attention. These would include any attention that would
741     // generate an SUE.
742     if (__findCsRootCause_UCS(list, o_rootCause))
743     {
744         return true;
745     }
746 
747     // Look for any system checkstop attentions that originated from within the
748     // chip that reported the attention. In other words, no external checkstop
749     // attentions.
750     if (__findNonExternalCs(list, o_rootCause))
751     {
752         return true;
753     }
754 
755     if (AnalysisType::SYSTEM_CHECKSTOP != i_type)
756     {
757         // No system checkstop root cause attentions were found. Next, look for
758         // any recoverable or unit checkstop attentions that could be associated
759         // with a TI.
760         if (__findTiRootCause(list, o_rootCause))
761         {
762             return true;
763         }
764 
765         if (AnalysisType::TERMINATE_IMMEDIATE != i_type)
766         {
767             // No attentions associated with a system checkstop or TI were
768             // found. Simply, return the first entry in the list.
769             o_rootCause = list.front();
770             return true;
771         }
772     }
773 
774     // END WORKAROUND
775 
776     return false; // default, no active attentions found.
777 }
778 
779 //------------------------------------------------------------------------------
780 
781 } // namespace analyzer
782