phal: Create PEL for empty guard file
Currently at the time of IPLing if the guard file is not present or
found empty, the IPLing terminates with an exception.
Added the new PEL "org.open_power.PHAL.Error.GuardPartitionAccess" to
address the above issue and continue to boot
Adding the IPL_ERR_GUARD_PARTITION_ACCESS enables us to generate the PEL
and "User Data 1" provides more information regarding the PEL
Tested:
Point to dummy file instead of actual guard file
Using the above error in the ipl callback, able to generate the below PEL
{
"0x50000E0C": {
"SRC": "BD8D300B",
"Message": "Guard partition access failure",
"PLID": "0x50000E0C",
"CreatorID": "BMC",
"Subsystem": "BMC Firmware",
"Commit Time": "10/06/2022 12:33:57",
"Sev": "Predictive Error",
"CompID": "0x3000"
}
}
...
},
"Callout Section": {
"Callout Count": "1",
"Callouts": [{
"FRU Type": "Maintenance Procedure Required",
"Priority": "Mandatory, replace all with this type as a
unit",
"Procedure": "BMC0001"
}]
}
},
...
"LOG013 2022-10-06 12:33:57": "Guard file
/var/lib/phosphor-software-manager/hostfw/running/NOFILE does not exist",
"_PID": "4393"
}
Signed-off-by: deepakala <deepakala.karthikeyan@ibm.com>
Change-Id: I07be6de35c9d5ce7b155e82fdcbc315a181d24c6
diff --git a/extensions/phal/phal_error.cpp b/extensions/phal/phal_error.cpp
index 009b9c0..6178ba2 100644
--- a/extensions/phal/phal_error.cpp
+++ b/extensions/phal/phal_error.cpp
@@ -443,6 +443,9 @@
// Handle non functional boot processor error.
processNonFunctionalBootProc();
break;
+ case IPL_ERR_GUARD_PARTITION_ACCESS:
+ processGuardPartitionAccessError();
+ break;
default:
createPEL("org.open_power.PHAL.Error.Boot");
// reset trace log and exit
@@ -946,6 +949,21 @@
}
}
+void processGuardPartitionAccessError()
+{
+ // Adding collected phal logs into PEL additional data
+ FFDCData pelAdditionalData;
+
+ for_each(
+ traceLog.begin(), traceLog.end(),
+ [&pelAdditionalData](std::pair<std::string, std::string>& ele) -> void {
+ pelAdditionalData.emplace_back(ele.first, ele.second);
+ });
+
+ openpower::pel::createPEL("org.open_power.PHAL.Error.GuardPartitionAccess",
+ pelAdditionalData);
+}
+
void reset()
{
// reset the trace log and counter