summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-11-08 19:59:12 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-20 20:35:24 -0600
commit998115739de18e82dd553309eac1a5be841fea1f (patch)
tree7fbc49ccab8abffd9460358b46ede7f1341d9ca1 /external
parentf6174ffe5a2efd0dd60a31882374191671668838 (diff)
downloadblackbird-skiboot-998115739de18e82dd553309eac1a5be841fea1f.tar.gz
blackbird-skiboot-998115739de18e82dd553309eac1a5be841fea1f.zip
gard: {list, show}: Fix the Type field in the output
The output of `gard list` has a field named "Type", however this doesn't actually indicate the type of the record. Rather, it shows the type of the path used to identify the hardware being GARDed. This is of pretty dubious value considering the Physical path seems to always be used when referring to GARDed hardware. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/gard/gard.c28
-rw-r--r--external/gard/gard.h20
-rw-r--r--external/gard/test/results/01-show_1.out2
-rw-r--r--external/gard/test/results/03-show_1-p9.out2
4 files changed, 49 insertions, 3 deletions
diff --git a/external/gard/gard.c b/external/gard/gard.c
index bb92402f..e7d8fba7 100644
--- a/external/gard/gard.c
+++ b/external/gard/gard.c
@@ -165,6 +165,30 @@ static const char *target_type_to_str(int type)
return "UNKNOWN";
}
+static const char *deconfig_reason_str(enum gard_reason reason)
+{
+ switch (reason) {
+ case GARD_NO_REASON:
+ return "None";
+ case GARD_MANUAL:
+ return "Manual";
+ case GARD_UNRECOVERABLE:
+ return "Unrecoverable";
+ case GARD_FATAL:
+ return "Fatal";
+ case GARD_PREDICTIVE:
+ return "Predictive";
+ case GARD_POWER:
+ return "Power"; // What does this even mean?
+ case GARD_HYP:
+ return "Hypervisor";
+ case GARD_RECONFIG:
+ return "Reconfig";
+ default:
+ return "Unknown";
+ }
+};
+
static const char *path_type_to_str(enum path_type t)
{
switch (t) {
@@ -320,7 +344,9 @@ static int do_show_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, vo
printf("Record ID: 0x%08x\n", id);
printf("========================\n");
printf("Error ID: 0x%08x\n", be32toh(gard->errlog_eid));
- printf("Error Type: 0x%02x\n", gard->error_type);
+ printf("Error Type: %s (0x%02x)\n",
+ deconfig_reason_str(gard->error_type),
+ gard->error_type);
printf("Path Type: %s\n", path_type_to_str(gard->target_id.type_size >> PATH_TYPE_SHIFT));
count = gard->target_id.type_size & PATH_ELEMENTS_MASK;
for (i = 0; i < count && i < MAX_PATH_ELEMENTS; i++)
diff --git a/external/gard/gard.h b/external/gard/gard.h
index 9c814a79..191cbafa 100644
--- a/external/gard/gard.h
+++ b/external/gard/gard.h
@@ -20,6 +20,26 @@
#define PATH_TYPE_SHIFT 4
#define PATH_ELEMENTS_MASK (0x0F)
+/*
+ * Sourced from hostboot: src/include/usr/hwas/common/hwasCallout.H
+ */
+enum gard_reason {
+ GARD_NO_REASON = 0x0,
+ GARD_MANUAL = 0xD2,
+ GARD_UNRECOVERABLE = 0xE2,
+ GARD_FATAL = 0xE3,
+ GARD_PREDICTIVE = 0xE6,
+ GARD_POWER = 0xE9,
+ GARD_HYP = 0xEA,
+ GARD_RECONFIG = 0xEB,
+
+ /*
+ * This should only occur if the GUARD partition isn't correctly
+ * programmed with ECC bits.
+ */
+ GARD_VOID = 0xFF,
+};
+
/* see src/include/usr/targeting/common/entitypath.H */
enum path_type {
PATH_NA = 0x00,
diff --git a/external/gard/test/results/01-show_1.out b/external/gard/test/results/01-show_1.out
index e48d89b8..60fcea26 100644
--- a/external/gard/test/results/01-show_1.out
+++ b/external/gard/test/results/01-show_1.out
@@ -1,7 +1,7 @@
Record ID: 0x00000001
========================
Error ID: 0x90000015
-Error Type: 0xe6
+Error Type: Predictive (0xe6)
Path Type: physical
>Sys, Instance #0
>Node, Instance #0
diff --git a/external/gard/test/results/03-show_1-p9.out b/external/gard/test/results/03-show_1-p9.out
index bdcf4186..c9ae5b21 100644
--- a/external/gard/test/results/03-show_1-p9.out
+++ b/external/gard/test/results/03-show_1-p9.out
@@ -1,7 +1,7 @@
Record ID: 0x00000001
========================
Error ID: 0x90000007
-Error Type: 0xe3
+Error Type: Fatal (0xe3)
Path Type: physical
>Sys, Instance #0
>Node, Instance #0
OpenPOWER on IntegriCloud